Conditional return instructions
This commit is contained in:
@@ -3,10 +3,8 @@ package asm
|
||||
import "github.com/firestuff/subcoding/vm"
|
||||
|
||||
var opCodeByName = map[string]vm.OpCodeType{
|
||||
"noop": vm.OpNoOp,
|
||||
"nop": vm.OpNop,
|
||||
"return": vm.OpReturn,
|
||||
"ret": vm.OpRet,
|
||||
"noop": vm.OpNoOp,
|
||||
"nop": vm.OpNop,
|
||||
|
||||
"move": vm.OpMove,
|
||||
"mov": vm.OpMov,
|
||||
@@ -53,6 +51,13 @@ var opCodeByName = map[string]vm.OpCodeType{
|
||||
"calt": vm.OpCalT,
|
||||
"calliffalse": vm.OpCallIfFalse,
|
||||
"calf": vm.OpCalF,
|
||||
|
||||
"return": vm.OpReturn,
|
||||
"ret": vm.OpRet,
|
||||
"returniftrue": vm.OpReturnIfTrue,
|
||||
"rett": vm.OpRetT,
|
||||
"returniffalse": vm.OpReturnIfFalse,
|
||||
"retf": vm.OpRetF,
|
||||
}
|
||||
|
||||
type operandType int
|
||||
@@ -66,7 +71,6 @@ const (
|
||||
|
||||
var operandsByOpCode = map[vm.OpCodeType][]operandType{
|
||||
vm.OpNop: []operandType{},
|
||||
vm.OpRet: []operandType{},
|
||||
|
||||
vm.OpMov: []operandType{r, us},
|
||||
vm.OpAdd: []operandType{r, us},
|
||||
@@ -92,4 +96,8 @@ var operandsByOpCode = map[vm.OpCodeType][]operandType{
|
||||
vm.OpCal: []operandType{s},
|
||||
vm.OpCalT: []operandType{s},
|
||||
vm.OpCalF: []operandType{s},
|
||||
|
||||
vm.OpRet: []operandType{},
|
||||
vm.OpRetT: []operandType{},
|
||||
vm.OpRetF: []operandType{},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user