home .. forth .. misc mail list archive ..

Re: Help w/Ting's '21H Assmebler


Dave Lowry wrote:
> 
> MISC Readers-
> 
> Can't seem to get Ting's assembler working...  Uploaded does.seq from
> the lessons directory of the diskette that came with the '21H kit.
> 
> Then tried many things, including:
> 
> CODE NOP
> @+ push ;'
> END-CODE
> 
> which should be just a "next".  But, NOP just hangs up the chip.  Any ideas?
>
Note:  { and }  marks  MUP21H  code.
The { @+ push ;' nop }    was not xored with AAAAA  The previous cell was 
xored with AAAAA  causing it to be wrong also.   You can solve this by simply
by starting with  { 0 , } and   an  { align nop } at the end.   You can factor 
the assembler to remove this unfortunate side effect by changing these definitions 
from Ting's Does.seq assembler:
\ : p,  ,  ;     \ 32 bit host assembler creating  Mup21 memory image.
: p,   AAAAA XOR ,  ;   \  Assemble on Mup21. every other data bit is inverted.
. . . . . . . .
\: ,I   Hi @ 4 AND IF  AAAAA ,w 0 Hi !  CP @ Hw !  0 p,  THEN
 \  Hi @ mask + @ AND  ,w  1 Hi +! ;
: ,I   Hi @ 4 AND IF            0 Hi !  CP @ Hw !  0 p,  THEN
   Hi @ mask + @ AND  ,w  1 Hi +! ;  \ rep
. . . . . . . . 
\: p   3314C ,I  AAAAA XOR p, ;
: p   3314C ,I  p, ;  \ rep

Reason:    The {   AAAAA ,w  }  in ,I  xor's the previous cell
not the current cell causing the  last cell assembled not to be xored.
Removing AAAAA w, from I, and the AAAAA XOR from p  and  
Putting the AAAAA XOR in p, causes  all the  memory image to be correct.  
Note1: The p,   in  I, and p     now does the AAAAA XOR on this cell. 
,W  uses the Hw  memory pointer  and p, uses eForth's CP pointer
causing some very strange problems because they don't always point 
to the same place  because of MUP21 literals and eForths use of CP.
Note2: This assembler is written for Mup21 memory image as  viewd from 
a  PROM programmer.  placing the  AAAAA xor  in P,  gives it the view 
from inside the Mup21.
 

> 
> Also, is it possible to include the assembler in the metacompile build?
 Yes   But Meta28.seq  has a limit on the size of the memory image and 
needs to be refactored to increase the  target memory size.
> 
> Thanks.
> 
> -Dave