Implemented register to register instructions
This commit is contained in:
parent
1c27f0cad2
commit
a9d43a8716
11 changed files with 171 additions and 16 deletions
|
@ -13,6 +13,17 @@ func (a *Assembler) MoveRegisterNumber(reg cpu.Register, number uint64) {
|
|||
})
|
||||
}
|
||||
|
||||
// MoveRegisterRegister moves a register value into another register.
|
||||
func (a *Assembler) MoveRegisterRegister(destination cpu.Register, source cpu.Register) {
|
||||
a.Instructions = append(a.Instructions, Instruction{
|
||||
Mnemonic: MOVE,
|
||||
Data: &RegisterRegister{
|
||||
Destination: destination,
|
||||
Source: source,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// Label adds a label at the current position.
|
||||
func (a *Assembler) Label(name string) {
|
||||
a.Instructions = append(a.Instructions, Instruction{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue