I'm looking at the Fig Forth 6502 source code. I recall seeing this before when I was doing my port, but I'm looking at it again.
If you look at the
Fig Forth source, in Forth, you come across this definition for VOCABULARY:
Code:
: VOCABULARY ( CREATE VOCAB WITH 'V-HEAD' AT VOC INTERSECT. *)
<BUILDS A081 , CURRENT @ CFA ,
HERE VOC-LINK @ , VOC-LINK !
DOES> 2+ CONTEXT ! ;
The machine code is essentially a literal translation of this:
Code:
;
; VOCABULARY
; SCREEN 53 LINE 4
;
L2321 .BYTE $8A,'VOCABULAR',$D9
.WORD L2309 ; link to IMMEDIATE
.WORD DOCOL
.WORD BUILD
.WORD LIT,$A081
.WORD COMMA
.WORD CURR
.WORD AT
.WORD CFA
.WORD COMMA
.WORD HERE
.WORD VOCL
.WORD AT
.WORD COMMA
.WORD VOCL
.WORD STORE
.WORD DOES
DOVOC .WORD TWOP
.WORD CON
.WORD STORE
.WORD SEMIS
And here we see the implementation, in machine code, of the word FORTH, which is a VOCABULARY:
Code:
L2346 .BYTE $C5,'FORT',$C8
.WORD L2321 ; link to VOCABULARY
FORTH .WORD DODOE
.WORD DOVOC
.WORD $A081
XFOR .WORD NTOP ; points to top name in FORTH
VL0 .WORD 0 ; last vocab link ends at zero
My question.
Does any one have ANY idea of what the $A081 is for. It looks sinisterly like a magic number.
In 6502, it's simply LDY#81. Which is fine, but what is it doing here? I can't see why anything would jump to this? There's no code surrounding it. It's not an address -- the Fig listing doesn't go that high (and who would hard code an address like that).
Also, Y is a scratch register in Fig.
So, I was trying to grok out vocabularies, and this just stands out like a big shiny red history eraser button, look but don't touch, and I was curious what it could be for.