rework macro tests, or are they builtin
small fixes too
This commit is contained in:
@ -22,6 +22,10 @@ module Mom
|
||||
def to_risc(compiler)
|
||||
compiler.add_code Risc::Branch.new(self , return_label.risc_label(compiler))
|
||||
end
|
||||
|
||||
def to_s
|
||||
"ReturnJump: #{return_label}"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
@ -3,7 +3,7 @@ module Mom
|
||||
def to_risc(compiler)
|
||||
builder = compiler.builder(compiler.source)
|
||||
builder.prepare_int_return # makes integer_tmp variable as return
|
||||
Builtin.exit_sequence(builder)
|
||||
Macro.exit_sequence(builder)
|
||||
return compiler
|
||||
end
|
||||
end
|
||||
|
@ -1,6 +1,10 @@
|
||||
module Mom
|
||||
class Macro < Instruction
|
||||
|
||||
def to_s
|
||||
self.class.name.split("::").last
|
||||
end
|
||||
|
||||
# emit the syscall with given name
|
||||
# there is a Syscall instruction, but the message has to be saved and restored
|
||||
def self.emit_syscall( builder , name )
|
||||
|
@ -3,7 +3,7 @@ module Mom
|
||||
def to_risc(compiler)
|
||||
builder = compiler.builder(compiler.source)
|
||||
builder.prepare_int_return # makes integer_tmp variable as return
|
||||
Builtin.emit_syscall( builder , :exit )
|
||||
Macro.emit_syscall( builder , :exit )
|
||||
return compiler
|
||||
end
|
||||
end
|
||||
|
@ -7,7 +7,7 @@ module Mom
|
||||
word! << message[:receiver]
|
||||
integer! << word[Parfait::Word.get_length_index]
|
||||
end
|
||||
Mom::Builtin.emit_syscall( builder , :putstring )
|
||||
Mom::Macro.emit_syscall( builder , :putstring )
|
||||
compiler
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user