Implemented register calls

This commit is contained in:
2025-03-02 17:53:18 +01:00
parent d7f30d8319
commit c3054369e3
16 changed files with 133 additions and 43 deletions

View File

@ -21,11 +21,11 @@ func (a *Assembler) CanSkip(mnemonic Mnemonic, left cpu.Register, right cpu.Regi
return false
}
if lastData.Destination == left && lastData.Source == right {
if lastData.Destination == right && lastData.Source == left {
return true
}
if lastData.Destination == right && lastData.Source == left {
if lastData.Destination == left && lastData.Source == right {
return true
}
}

View File

@ -10,16 +10,6 @@ func (a *Assembler) Comment(text string) {
})
}
// Call calls a function whose position is identified by a label.
func (a *Assembler) Call(name string) {
a.Instructions = append(a.Instructions, Instruction{
Mnemonic: CALL,
Data: &Label{
Name: name,
},
})
}
// DLLCall calls a function in a DLL file.
func (a *Assembler) DLLCall(name string) {
a.Instructions = append(a.Instructions, Instruction{