anchor.diff: +\ The image buffer is where the assembler assembles its bytes.	The /image
  +\ (pronounced "per-image") constant configures how large of a buffer it is.
  +
   65536 CONSTANT /image
   CREATE image
   /image ALLOT
  +
  +\ lc0 contains the origin of the program.  Generally, you shouldn't have to
  +\ care about the origin.  The RISC-V instruction set is fully
  +\ position-independent for both data and code.	But, sometimes, if you want to
  +\ perform address arithmetic on absolute addresses, setting the origin may
  +\ prove useful.
  +\ 
  +\ The bc variable contains the offset into the above image buffer where the
  +\ assembler should place the next byte.
   
   VARIABLE lc0
   VARIABLE bc
  
positive.code: : (d,) ( d -- )		dwcomponents (w,) (w,) ;
  : D, ( d -- )		8 room (d,) ;
  
  : ALIGN ( n -- )	DUP 1- bc @ + SWAP NEGATE AND bc ! ;
  
  : (rs1)			SWAP 15 LSHIFT OR ;
  : (rs2)			SWAP 20 LSHIFT OR ;
  : (rd)			SWAP 7 LSHIFT OR ;
  
  : R, ( rs1 rs2 rd opmask -- )
  	(rd) (rs2) (rs1) W, ;
  
  : I, ( rs1 imm rd opmask -- )
  	(rd) (rs2) (rs1) W, ;
  
  : S, ( rs1 rs2 imm opmask -- )
  	OVER 31 AND 7 LSHIFT OR
  	SWAP 5 RSHIFT 25 LSHIFT OR
  	(rs2) (rs1) W, ;
  
  : SB, ( rs1 rs2 disp opmask -- )
  	OVER $01E AND 7 LSHIFT OR	( bits 4..1 )
  	OVER $800 AND 4 RSHIFT OR	( bits 4..1,11 )
  	OVER $7E0 AND 20 LSHIFT OR	( bits 10..5, 4..1, 11 )
  
negative.code: 	(rs2) (rs1) W, ;
  
  : U, ( imm rd opmask -- )
  	4 ALIGN (rd) SWAP $FFFFF000 AND OR W, ;
  
  : UJ, ( disp rd opmask -- )
  	4 ALIGN (rd)
  	OVER $100000 AND 11 LSHIFT OR
  	OVER $0007FE AND 20 LSHIFT OR
  	OVER $000800 AND 9 LSHIFT OR
  