give labels an integer that will end up being the position at runtime

Since integers are first class objects, we need to use an integer object
as the return address. The actual address can not be stored in an
instance variable since it is not an object.
The address is unique to the label and never changes after positioning
(using the int is next up)
This commit is contained in:
Torsten Ruger
2018-05-29 20:26:00 +03:00
parent 7847420d49
commit 8322fca7b3
11 changed files with 24 additions and 19 deletions

View File

@ -13,7 +13,7 @@ module Arm
end
def translate_Label( code )
Risc::Label.new( code.source , code.name )
Risc.label( code.source , code.name , code.integer)
end
# arm indexes are