Implemented subtraction
This commit is contained in:
@ -3,7 +3,7 @@ package asm
|
||||
import "git.akyoto.dev/cli/q/src/build/cpu"
|
||||
|
||||
// AddRegisterNumber adds a number to the given register.
|
||||
func (a *Assembler) AddRegisterNumber(reg cpu.Register, number uint64) {
|
||||
func (a *Assembler) AddRegisterNumber(reg cpu.Register, number int) {
|
||||
a.Instructions = append(a.Instructions, Instruction{
|
||||
Mnemonic: ADD,
|
||||
Data: &RegisterNumber{
|
||||
@ -13,8 +13,19 @@ func (a *Assembler) AddRegisterNumber(reg cpu.Register, number uint64) {
|
||||
})
|
||||
}
|
||||
|
||||
// SubRegisterNumber subtracts a number from the given register.
|
||||
func (a *Assembler) SubRegisterNumber(reg cpu.Register, number int) {
|
||||
a.Instructions = append(a.Instructions, Instruction{
|
||||
Mnemonic: SUB,
|
||||
Data: &RegisterNumber{
|
||||
Register: reg,
|
||||
Number: number,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// MoveRegisterNumber moves a number into the given register.
|
||||
func (a *Assembler) MoveRegisterNumber(reg cpu.Register, number uint64) {
|
||||
func (a *Assembler) MoveRegisterNumber(reg cpu.Register, number int) {
|
||||
a.Instructions = append(a.Instructions, Instruction{
|
||||
Mnemonic: MOVE,
|
||||
Data: &RegisterNumber{
|
||||
|
Reference in New Issue
Block a user