> So given the following definition with a name and a body but no stack
> comment, how would I replace the question marks with the correct interface
> components. I do not quite understand what 'TYPE+' does.
> : TYPE+ ( ? -- ? ) 0 DO DUP C@ EMIT 1+ LOOP ;
TYPE+ requires 2 arguments on top of stack:
- first a count on top of stack, as second argument to DO ( limit start -- ),
- then an address, each time in the loop first DUPlicated to C@ a byte and EMIT
it, then incremented for the next time in the loop
Then the stack comment could be ( addr u -- addr1 ), or more clearly:
: TYPE+ ( addr u -- addr+u ) 0 DO DUP C@ EMIT 1+ LOOP ;
A more elegant, more compact, and more efficient equivalent definition:
: TYPE+ ( addr u -- addr+u ) 2DUP TYPE + ;
Have fun,
CL