Added push and pop instructions
This commit is contained in:
parent
0d8891d8a7
commit
8867845310
4 changed files with 45 additions and 0 deletions
|
@ -91,6 +91,18 @@ func (a *Assembler) Finalize() ([]byte, []byte) {
|
|||
code = x64.MoveRegisterRegister64(code, operands.Destination, operands.Source)
|
||||
}
|
||||
|
||||
case POP:
|
||||
switch operands := x.Data.(type) {
|
||||
case *Register:
|
||||
code = x64.PopRegister(code, operands.Register)
|
||||
}
|
||||
|
||||
case PUSH:
|
||||
switch operands := x.Data.(type) {
|
||||
case *Register:
|
||||
code = x64.PushRegister(code, operands.Register)
|
||||
}
|
||||
|
||||
case RETURN:
|
||||
code = x64.Return(code)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue