Implemented register to register instructions
This commit is contained in:
@ -28,8 +28,13 @@ func (a *Assembler) Finalize() ([]byte, []byte) {
|
||||
for _, x := range a.Instructions {
|
||||
switch x.Mnemonic {
|
||||
case MOVE:
|
||||
regNum := x.Data.(*RegisterNumber)
|
||||
code = x64.MoveRegNum32(code, uint8(regNum.Register), uint32(regNum.Number))
|
||||
switch operands := x.Data.(type) {
|
||||
case *RegisterNumber:
|
||||
code = x64.MoveRegNum32(code, operands.Register, uint32(operands.Number))
|
||||
|
||||
case *RegisterRegister:
|
||||
code = x64.MoveRegReg64(code, operands.Destination, operands.Source)
|
||||
}
|
||||
|
||||
case RETURN:
|
||||
code = x64.Return(code)
|
||||
|
Reference in New Issue
Block a user