Implemented data labels
This commit is contained in:
parent
ff0b8ecb10
commit
1b75529bb3
18 changed files with 428 additions and 327 deletions
|
@ -16,3 +16,14 @@ type RegisterNumber struct {
|
|||
func (data *RegisterNumber) String() string {
|
||||
return fmt.Sprintf("%s, %d", data.Register, data.Number)
|
||||
}
|
||||
|
||||
// RegisterNumber adds an instruction with a register and a number.
|
||||
func (a *Assembler) RegisterNumber(mnemonic Mnemonic, reg cpu.Register, number int) {
|
||||
a.Instructions = append(a.Instructions, Instruction{
|
||||
Mnemonic: mnemonic,
|
||||
Data: &RegisterNumber{
|
||||
Register: reg,
|
||||
Number: number,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue