anchor.diff:  	SWAP 19 RSHIFT $1000 AND OR
   	DUP $1000 AND NEGATE OR ;
   
  +\ As with S>UJ, but for load instructions.
  +: S>LD ( displacement 0 -- n )
  +	SWAP $FFF AND 20 LSHIFT OR ;
  +
  +\ As with UJ>S, but for load instructions.
  +: LD>S ( n 0 -- displacement )
  +	SWAP 20 RSHIFT $FFF AND OR
  +	DUP $800 AND NEGATE OR ;
  +
  +\ As with S>UJ, but for store instructions.
  +: S>ST ( displacement 0 -- n )
  +	OVER $01F AND 7 LSHIFT OR
  +	SWAP $FE0 AND 20 LSHIFT OR ;
  +
  +\ As with UJ>S, but for store instructions.
  +: ST>S ( n 0 -- displacement )
  +	OVER 7 RSHIFT $01F AND OR
  +	SWAP 20 RSHIFT $FE0 AND OR
  +	DUP $800 AND NEGATE OR ;
  +
   \ Recover the displacement from a UJ-format instruction in image memory.
   : UJ@ ( addr -- displacement )
   	IW@ 0 UJ>S ;
  
positive.code: 
  	\ Fixes up a GP-relative offset for LOAD instructions.
  : fixup-gl ( a -- )
  	LC OVER 3 CELLS + @ - 4095 AND 20 LSHIFT >R
  	2 CELLS + @ DUP IW@ R> + SWAP IW! ;
  
  	\ glreloc creates an global pointer-relative relocation record in the
  	\ Forth dictionary.
  
negative.code: : UJ! ( displacement addr -- )
  	>R 0 S>UJ R@ IW@ $FFF AND OR R> IW! ;
  
  \ As with UJ@, but for Bxx conditional branch instructions.
  : SB@ ( addr -- displacement )
  	IW@ 0 SB>S ;
  
  \ As with UJ!, but for Bxx conditional branch instructions.
  : SB! ( displacement addr -- )
  	>R 0 S>SB R@ IW@ $01FFF07F AND OR R> IW! ;
  
  \ As with UJ@, but for loads and other I-format instructions.
  : LD@ ( addr -- displacement )
  	IW@ 0 LD>S ;
  
  \ As with UJ!, but for loads and other I-format instructions.
  : LD! ( displacement addr -- )
  	>R 0 S>LD R@ IW@ $000FFFFF AND OR R> IW! ;
  
  \ As with UJ@, but for loads and other S-format instructions.
  : ST@ ( addr -- displacement )
  	IW@ 0 ST>S ;
  
  \ As with UJ!, but for loads and other S-format instructions.
  : ST! ( displacement addr -- )
  	>R 0 S>ST R@ IW@ $01FFF07F AND OR R> IW! ;
  
  \ R, I, S, SB, U, and UJ, function like B, H, W, and D, above.  However, they
  \ place actual CPU instructions, and as such take additional parameters.
  