mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-23 20:08:05 +11:00
Inline SCPY
I'm planning a string reform and it's standing in the way.
This commit is contained in:
parent
a59322c252
commit
2d2a846b25
3
blk/058
3
blk/058
@ -5,9 +5,6 @@ LIT -- Write a LIT entry. You're expected to write
|
||||
LIT< x -- Read following word and write to HERE as a
|
||||
string literal.
|
||||
S= a1 a2 -- f Returns whether string a1 == a2.
|
||||
SCPY a -- Copy string at addr a into HERE, without
|
||||
NULL termination.
|
||||
|
||||
|
||||
|
||||
|
||||
|
6
blk/367
6
blk/367
@ -1,6 +0,0 @@
|
||||
: SCPY
|
||||
BEGIN ( a )
|
||||
C@+ ( a+1 c )
|
||||
?DUP NOT IF DROP EXIT THEN
|
||||
C, ( a c )
|
||||
AGAIN ;
|
4
blk/368
4
blk/368
@ -1,5 +1,7 @@
|
||||
: +! TUCK @ + SWAP ! ;
|
||||
: [entry] ( w -- )
|
||||
H@ SWAP SCPY ( h )
|
||||
H@ SWAP
|
||||
BEGIN C@+ ( w+1 c ) ?DUP IF C, 0 ELSE 1 THEN UNTIL DROP
|
||||
H@ SWAP - ( sz )
|
||||
( write prev value )
|
||||
H@ CURRENT @ - ,
|
||||
|
4
blk/369
4
blk/369
@ -1,11 +1,7 @@
|
||||
( Words here until the end of the low part, unlike words
|
||||
preceeding them, aren't immediately needed for boot. But its
|
||||
better to have as many words as possible in the xcomp part. )
|
||||
: IMMEDIATE
|
||||
CURRENT @ 1-
|
||||
DUP C@ 128 OR SWAP C! ;
|
||||
: IMMED? 1- C@ 0x80 AND ;
|
||||
: +! TUCK @ + SWAP ! ;
|
||||
: -^ SWAP - ;
|
||||
: / /MOD NIP ;
|
||||
: MOD /MOD DROP ;
|
||||
|
2
blk/399
2
blk/399
@ -1,9 +1,9 @@
|
||||
: LIT< WORD 34 , BEGIN C@+ DUP C, NOT UNTIL DROP ; IMMEDIATE
|
||||
: BEGIN H@ ; IMMEDIATE
|
||||
: AGAIN COMPILE (br) H@ - _bchk , ; IMMEDIATE
|
||||
: UNTIL COMPILE (?br) H@ - _bchk , ; IMMEDIATE
|
||||
: [ INTERPRET ; IMMEDIATE
|
||||
: ] R> DROP ;
|
||||
: LIT< WORD 34 , SCPY 0 C, ; IMMEDIATE
|
||||
: LITA 36 , , ;
|
||||
: COMPILE ' LITA ['] , , ; IMMEDIATE
|
||||
: [COMPILE] ' , ; IMMEDIATE
|
||||
|
BIN
emul/forth.bin
BIN
emul/forth.bin
Binary file not shown.
Loading…
Reference in New Issue
Block a user