Does that „split-action” have any merits behind it? Or is it just on the rule: „well, someone years ago" made it this way, and then all the followers copied that because it worked doing no harm”?"NEXT is a run-time routine of the address interpreter. IP usually points to the next word to be executed in a colon definition. After the current word is executed, the contents of IP is moved into W and now IP is incremented, pointing to the next word to be executed. Now, W contains the address of
the current word to be executed, and an indirect jump to the address in W starts the execution process of this word. In the mean time, W is also incremented to point to the parameter field address of the word being executed. All code definitions ends with the routine NEXT, which allows the next word after this code definition to be pulled in and executed." C.H.Ting, Systems Guide to figForth
Does this help?
Does that „split-action” have any merits behind it? Or is it just on the rule: „well, someone years ago" made it this way, and then all the followers copied that because it worked doing no harm”?
Advantage of doing it in NEXT: Less code; you don't need the
incrementing code replicated in DOCOL, DOVAR, maybe DOCON, DODOES.
Disadvantage of doing it in NEXT: It costs time that is wasted if the
next word does not use W (primitives), or can do it cheaper as part of
an addressing mode (maybe DOCON, DODOES).
Unless I need to save the last byte, I would not put it in NEXT on the
8086.
Incrementing W in NEXT by at least one was unavoidable. It would have aided portability to have W point to the same place in every FIG implementation.
Be prepared to find vestigial organs in fig.
Replace it with:
NEXT: LODSW
MOV BX,AX
JMP [BX]
NEXT1: MOV DX,BX
INC DX
JMP [BX]
They were not familiar to the very powerful (?!) 8086 instruction set
DOCOL:
DEC BP }
DEC BP } push si on the returns stack
MOV [BP],SI }
MOV SI,[BX+2]
JMP NEXT
Saving the manipulation with reg DX.
They were not familiar to the very powerful (?!) 8086 instruction set
DOCOL:
DEC BP }
DEC BP } push si on the returns stack
MOV [BP],SI }
MOV SI,[BX+2]
JMP NEXT
Saving the manipulation with reg DX.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 49:30:12 |
Calls: | 6,711 |
Calls today: | 4 |
Files: | 12,243 |
Messages: | 5,354,781 |
Posted today: | 1 |