fix bug in 16/16 reloc
parent
2fae4a59a9
commit
a88f4275c9
|
|
@ -195,7 +195,7 @@ USING: compiler errors kernel math memory words ;
|
|||
|
||||
G: (B) ( dest aa lk -- ) [ pick ] [ type ] ;
|
||||
M: integer (B) i-form 18 insn ;
|
||||
M: word (B) 0 swap (B) relative-24 ;
|
||||
M: word (B) 0 (B) relative-24 ;
|
||||
|
||||
: B 0 0 (B) ; : BA 1 0 (B) ; : BL 0 1 (B) ; : BLA 1 1 (B) ;
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ M: %call-label generate-node ( vop -- )
|
|||
B ;
|
||||
|
||||
: word-addr ( word -- )
|
||||
dup 0 1 rel-primitive word-xt 19 LOAD32 ;
|
||||
dup word-xt 19 LOAD32 0 1 rel-word ;
|
||||
|
||||
: compile-call ( label -- )
|
||||
#! Far C call for primitives, near C call for compiled defs.
|
||||
|
|
|
|||
|
|
@ -50,11 +50,11 @@ void relocate_code();
|
|||
given address */
|
||||
INLINE CELL reloc_get_16_16(CELL cell)
|
||||
{
|
||||
return ((get(cell) & 0xffff) << 16) | (get(cell + 1) & 0xffff);
|
||||
return ((get(cell - CELLS) & 0xffff) << 16) | (get(cell) & 0xffff);
|
||||
}
|
||||
|
||||
INLINE void reloc_set_16_16(CELL cell, CELL value)
|
||||
{
|
||||
put(cell,((get(cell) & ~0xffff) | ((value >> 16) & 0xffff)));
|
||||
put(cell + 1,((get(cell + 1) & ~0xffff) | (value & 0xffff)));
|
||||
put(cell - CELLS,((get(cell - CELLS) & ~0xffff) | ((value >> 16) & 0xffff)));
|
||||
put(cell,((get(cell) & ~0xffff) | (value & 0xffff)));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue