Re: Why is the dictionary checked before looking for a number?
- From: Bruce McFarling <agila61@xxxxxxxxxxxx>
- Date: 28 Apr 2007 13:49:31 -0700
It wasn't uncommon on older forths to define
0 CONSTANT 0
1 CONSTANT 1
2 CONSTANT 2
since constants took only one cell in ITC whereas literals
took 2. On some systems constants are faster than literals
as well.
For example, LIT in a simple subroutine threaded 6502 forth is slow,
but if A and Y are free between primitives, then a constant
such as:
; ...
LDA #$FE
LDY #$00
JMP DOCONSTANT
DOCONSTANT:
DEX
STA SH,X
TYA
STA SL,X
RTS
can be much faster.
.
- References:
- Why is the dictionary checked before looking for a number?
- From: Ged Byrne
- Re: Why is the dictionary checked before looking for a number?
- From: George Hubert
- Why is the dictionary checked before looking for a number?
- Prev by Date: Re: Forth Frustrations
- Next by Date: Re: Eliminating All Ambiguous Conditions
- Previous by thread: Re: Why is the dictionary checked before looking for a number?
- Next by thread: Re: Why is the dictionary checked before looking for a number?
- Index(es):