Files
avo/internal/inst/table.go

16 lines
457 B
Go
Raw Normal View History

2018-11-24 14:55:51 -08:00
package inst
2018-11-25 17:11:24 -08:00
//go:generate avogen -bootstrap -data ../data -output ztable.go godata
//go:generate avogen -bootstrap -data ../data -output ztable_test.go godatatest
2018-11-24 14:55:51 -08:00
// Lookup returns the instruction with the given opcode. Boolean return value
// indicates whether the instruction was found.
2018-11-24 14:55:51 -08:00
func Lookup(opcode string) (Instruction, bool) {
for _, i := range Instructions {
if i.Opcode == opcode {
return i, true
}
}
return Instruction{}, false
}