introduce load_data instruction

which just loads data to a register (used internally)
as opposed to integers, which are objects
This commit is contained in:
Torsten Ruger
2018-03-31 12:38:30 +03:00
parent ee8b9469af
commit 6e941ebcb7
10 changed files with 56 additions and 26 deletions

View File

@ -92,7 +92,8 @@ module Risc
# for computationally building code (ie writing assembler) these short cuts
# help to instantiate risc instructions and add them immediately
[:label, :reg_to_slot , :slot_to_reg , :load_constant, :function_return , :function_call,
[:label, :reg_to_slot , :slot_to_reg , :load_constant, :load_data,
:function_return , :function_call,
:transfer , :reg_to_slot , :byte_to_reg , :reg_to_byte].each do |method|
define_method("add_#{method}".to_sym) do |*args|
add_code Risc.send( method , *args )