1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-26 15:28:05 +11:00

Compare commits

..

No commits in common. "2af959a13dc543d0fc6efec7962e478a5f8e63d1" and "80891d7ec172bc22e5dc7594b1b87dbdea92ffdb" have entirely different histories.

6 changed files with 35 additions and 50 deletions

View File

@ -1,6 +1,6 @@
TARGETS = runbin/runbin forth/forth
# Those Forth source files are in a particular order
FORTHSRCS = core.fs print.fs str.fs parse.fs readln.fs fmt.fs z80a.fs
FORTHSRCS = core.fs str.fs parse.fs readln.fs fmt.fs z80a.fs
FORTHSRC_PATHS = ${FORTHSRCS:%=../forth/%} forth/run.fs
OBJS = emul.o libz80/libz80.o
SLATEST = ../tools/slatest

Binary file not shown.

View File

@ -118,3 +118,29 @@
( Set up initial SYSVNXT value, which is 2 bytes after its
own address )
46 RAM+ DUP 2 + SWAP !
: (print)
BEGIN
DUP C@ ( a c )
( exit if null )
DUP NOT IF 2DROP EXIT THEN
EMIT ( a )
1 + ( a+1 )
AGAIN
;
: ."
LIT
BEGIN
C< DUP ( c c )
( 34 is ASCII for " )
DUP 34 = IF DROP DROP 0 0 THEN
C,
0 = UNTIL
COMPILE (print)
; IMMEDIATE
: ABORT" [COMPILE] ." COMPILE ABORT ; IMMEDIATE
: (uflw) ABORT" stack underflow" ;
: (wnf) ABORT" word not found" ;

View File

@ -53,11 +53,7 @@
' ( get word )
-^ ( apply offset )
, ( write! )
;
( We can't use IMMEDIATE because the one we've just compiled
in z80c target's the *target*'s RAM addr, not the host's.
manually set namelen field. )
0x82 CURRENT @ 1 - C!
; IMMEDIATE
: RAM+
[ RAMSTART LITN ] _c +
@ -223,10 +219,7 @@
( : and ; have to be defined last because it can't be
executed now also, they can't have their real name
right away. We also can't use IMMEDIATE because the offset
used for CURRENT is the *target*'s RAM offset. we're still
on the host.
)
right away )
: X
_c (entry)
@ -242,17 +235,15 @@
( maybe number )
ELSE _c (parse*) _c @ EXECUTE _c LITN THEN
AGAIN
;
; IMMEDIATE
: Y
['] EXIT _c ,
_c R> _c DROP ( exit : )
;
; IMMEDIATE
( Give ":" and ";" their real name and make them IMMEDIATE )
0x81 ' X 1 - C!
( Give ":" and ";" their real name )
':' ' X 4 - C!
0x81 ' Y 1 - C!
';' ' Y 4 - C!
( Add dummy entry. we use CREATE because (entry) is, at this

View File

@ -1,30 +0,0 @@
( Words allowing printing strings. Require core )
( This used to be in core, but some drivers providing EMIT
are much much easier to write with access to core words,
and these words below need EMIT... )
: (print)
BEGIN
DUP C@ ( a c )
( exit if null )
DUP NOT IF 2DROP EXIT THEN
EMIT ( a )
1 + ( a+1 )
AGAIN
;
: ."
LIT
BEGIN
C< DUP ( c c )
( 34 is ASCII for " )
DUP 34 = IF DROP DROP 0 0 THEN
C,
0 = UNTIL
COMPILE (print)
; IMMEDIATE
: ABORT" [COMPILE] ." COMPILE ABORT ; IMMEDIATE
: (uflw) ABORT" stack underflow" ;
: (wnf) ABORT" word not found" ;

View File

@ -313,8 +313,7 @@ CODE R>
;CODE
CODE IMMEDIATE
( CURRENT == RAM+2 )
RAMSTART 0x02 + LDHL(nn),
CURRENT LDHL(nn),
HL DECss,
7 (HL) SETbr,
;CODE
@ -394,8 +393,7 @@ L1 FSET ( found )
CODE SCPY
HL POPqq,
chkPS,
( HERE == RAM+4 )
DE RAMSTART 0x04 + LDdd(nn),
DE HERE LDdd(nn),
B 0 LDrn,
L1 BSET ( loop )
A (HL) LDrr,
@ -406,7 +404,7 @@ L1 BSET ( loop )
A ORr,
JRNZ, L1 BWR ( loop )
DE A LD(dd)r
RAMSTART 0x04 + DE LD(nn)dd,
HERE DE LD(nn)dd,
;CODE
CODE (im1)