Added push and pop instructions
This commit is contained in:
parent
0d8891d8a7
commit
8867845310
4 changed files with 45 additions and 0 deletions
|
@ -24,6 +24,16 @@ func (a *Assembler) RegisterRegister(mnemonic Mnemonic, left cpu.Register, right
|
|||
})
|
||||
}
|
||||
|
||||
// Register adds an instruction using a single register.
|
||||
func (a *Assembler) Register(mnemonic Mnemonic, register cpu.Register) {
|
||||
a.Instructions = append(a.Instructions, Instruction{
|
||||
Mnemonic: mnemonic,
|
||||
Data: &Register{
|
||||
Register: register,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// 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