Implemented calls using memory addresses
This commit is contained in:
@ -35,9 +35,27 @@ func (mem *Memory) Format(custom string) string {
|
||||
tmp.WriteString(strconv.Itoa(int(mem.Offset)))
|
||||
}
|
||||
|
||||
tmp.WriteString("], ")
|
||||
tmp.WriteString(custom)
|
||||
tmp.WriteString("]")
|
||||
|
||||
if custom != "" {
|
||||
tmp.WriteString(", ")
|
||||
tmp.WriteString(custom)
|
||||
}
|
||||
|
||||
tmp.WriteString(", ")
|
||||
tmp.WriteString(strconv.Itoa(int(mem.Length)))
|
||||
return tmp.String()
|
||||
}
|
||||
|
||||
// String returns a human readable version.
|
||||
func (mem *Memory) String() string {
|
||||
return mem.Format("")
|
||||
}
|
||||
|
||||
// Memory adds an instruction with a memory address.
|
||||
func (a *Assembler) Memory(mnemonic Mnemonic, address Memory) {
|
||||
a.Instructions = append(a.Instructions, Instruction{
|
||||
Mnemonic: mnemonic,
|
||||
Data: &address,
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user