fix register use in putstring

was off by one, the syscall is write 
and the first arg is file_descriptor
ie 1 == stdout
This commit is contained in:
2020-03-25 18:58:10 +02:00
parent 231ce0f69b
commit 4bae5c418b
6 changed files with 16 additions and 8 deletions

View File

@ -3,8 +3,8 @@ module SlotMachine
def to_risc(compiler)
builder = compiler.builder(compiler.source)
integer = builder.prepare_int_return # makes integer_tmp variable as return
word = Risc.syscall_reg(1).set_compiler(compiler)
length = Risc.syscall_reg(2).set_compiler(compiler)
word = Risc.syscall_reg(2).set_compiler(compiler)
length = Risc.syscall_reg(3).set_compiler(compiler)
builder.build do
string = message[:receiver].to_reg.known_type(:Word)
integer << string[:char_length]