Implemented addition
This commit is contained in:
parent
b6722c5482
commit
0657b88945
6 changed files with 78 additions and 23 deletions
|
@ -2,6 +2,17 @@ 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) {
|
||||
a.Instructions = append(a.Instructions, Instruction{
|
||||
Mnemonic: ADD,
|
||||
Data: &RegisterNumber{
|
||||
Register: reg,
|
||||
Number: number,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// MoveRegisterNumber moves a number into the given register.
|
||||
func (a *Assembler) MoveRegisterNumber(reg cpu.Register, number uint64) {
|
||||
a.Instructions = append(a.Instructions, Instruction{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue