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

@ -275,7 +275,8 @@ module Risc
end
def handle_putstring
str = get_register( :r0 ) # should test length, ie r2
# should test length, syscall_3 (syscall_1 is file_descriptor, ie stdout)
str = get_register( std_reg(:syscall_2) )
case str
when Symbol
@stdout << str.to_s

View File

@ -40,6 +40,8 @@ module Risc
:r0
when :syscall_2
:r1
when :syscall_3
:r2
when :saved_message
:r14
else