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:
@ -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
|
||||
|
@ -40,6 +40,8 @@ module Risc
|
||||
:r0
|
||||
when :syscall_2
|
||||
:r1
|
||||
when :syscall_3
|
||||
:r2
|
||||
when :saved_message
|
||||
:r14
|
||||
else
|
||||
|
Reference in New Issue
Block a user