1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-02 08:30:55 +11:00

Compare commits

..

No commits in common. "06a4674317d51d4e79cdcc7ad3c71e8a32913624" and "244776a7ebac4c3df5e6616f067d10d1c6b63db7" have entirely different histories.

7 changed files with 11 additions and 26 deletions

View File

@ -4,8 +4,6 @@ Memory
! n a -- Store n in address a ! n a -- Store n in address a
? a -- Print value of addr a ? a -- Print value of addr a
+! n a -- Increase value of addr a by n +! n a -- Increase value of addr a by n
BIT@ b a -- f Get bit b from addr a.
BIT! f b a -- Set bit b to f in addr a.
C@ a -- c Set c to byte at address a C@ a -- c Set c to byte at address a
C@+ a -- a+1 c Fetch c from a and inc a. C@+ a -- a+1 c Fetch c from a and inc a.
C@- a -- a-1 c Fetch c from a and dec a. C@- a -- a-1 c Fetch c from a and dec a.
@ -13,4 +11,6 @@ C! c a -- Store byte c in address a
C!+ c a -- a+1 Store byte c in a and inc a. C!+ c a -- a+1 Store byte c in a and inc a.
C!- c a -- a-1 Store byte c in a and dec a. C!- c a -- a-1 Store byte c in a and dec a.
CURRENT -- a Set a to wordref of last added entry. CURRENT -- a Set a to wordref of last added entry.
CURRENT* -- a A pointer to active CURRENT*. Useful
when we have multiple active dicts.
(cont.) (cont.)

View File

@ -1,5 +1,3 @@
CURRENT* -- a A pointer to active CURRENT*. Useful
when we have multiple active dicts.
FILL a n b -- Fill n bytes at addr a with val b. FILL a n b -- Fill n bytes at addr a with val b.
HERE -- a Push HERE's address HERE -- a Push HERE's address
H@ -- a HERE @ H@ -- a HERE @

10
blk/404
View File

@ -4,11 +4,9 @@
DUP NOT IF DROP 0x0c RAM+ @ THEN ( 0c == C<* ) DUP NOT IF DROP 0x0c RAM+ @ THEN ( 0c == C<* )
EXECUTE EXECUTE
; ;
: , HERE @ ! HERE @ 2+ HERE ! ; : , HERE @ ! HERE @ 2+ HERE ! ;
: C, HERE @ C! HERE @ 1+ HERE ! ; : C, HERE @ C! HERE @ 1+ HERE ! ;
: BIT@ ( bit addr -- f ) C@ SWAP RSHIFT 0x01 AND ;
: BIT! ( f bit addr -- )
SWAP 0x01 SWAP LSHIFT ROT ( addr mask f )
IF OVER C@ OR
ELSE 0xff XOR OVER C@ AND THEN ( addr flg )
SWAP C! ;

View File

@ -7,7 +7,3 @@ CREATE _atbl
0x20 C, 'Y' C, 'T' C, 'O' C, 'J' C, 'E' C, 'B' C, 0 C, 0x20 C, 'Y' C, 'T' C, 'O' C, 'J' C, 'E' C, 'B' C, 0 C,
0 C, 'X' C, 'S' C, 'N' C, 'I' C, 'D' C, 'A' C, 0x80 C, 0 C, 'X' C, 'S' C, 'N' C, 'I' C, 'D' C, 'A' C, 0x80 C,
0 C, 0 C, 0 C, 0 C, 0 C, 0x81 ( 2nd ) C, 0 C, 0x7f C, 0 C, 0 C, 0 C, 0 C, 0 C, 0x81 ( 2nd ) C, 0 C, 0x7f C,
: _2nd@ 0 [ KBD_MEM LITN ] BIT@ ;
: _2nd! 0 [ KBD_MEM LITN ] BIT! ;
: _alock@ 1 [ KBD_MEM LITN ] BIT@ ;
: _alock^ _alock@ NOT 1 [ KBD_MEM LITN ] BIT! ;

14
blk/570
View File

@ -1,12 +1,6 @@
: _tbl^ ( swap input tbl )
_atbl = IF _dtbl ELSE _atbl THEN ;
: (key) : (key)
0 _2nd! 0 ( lastchr ) BEGIN _dtbl 0 ( dummy ) BEGIN ( tbl 0 )
_alock@ IF _atbl ELSE _dtbl THEN DROP DUP ( tbl ) _gti + C@
OVER 0x80 ( alpha ) = DUP 0x80 = IF ( alpha ) 2DROP _atbl 0 THEN
IF _tbl^ _2nd@ IF _alock^ THEN THEN DUP UNTIL ( tbl c -- loop if null ) SWAP DROP
SWAP 0x81 = _2nd!
_gti + C@
DUP 0 0x80 >< UNTIL ( loop if not in range )
_wait ; _wait ;
: KBD$ 0 [ KBD_MEM LITN ] C! ;

Binary file not shown.

View File

@ -1,7 +1,6 @@
0x8000 CONSTANT RAMSTART 0x8000 CONSTANT RAMSTART
0xb000 CONSTANT RS_ADDR 0xb000 CONSTANT RS_ADDR
RAMSTART 0x70 + CONSTANT LCD_MEM RAMSTART 0x70 + CONSTANT LCD_MEM
RAMSTART 0x72 + CONSTANT KBD_MEM
0x01 CONSTANT KBD_PORT 0x01 CONSTANT KBD_PORT
212 LOAD ( z80 assembler ) 212 LOAD ( z80 assembler )
262 LOAD ( xcomp ) 262 LOAD ( xcomp )
@ -26,6 +25,6 @@ PC ORG @ 8 + !
422 437 XPACKR ( core ) 422 437 XPACKR ( core )
558 560 XPACKR ( LCD high ) 558 560 XPACKR ( LCD high )
438 451 XPACKR ( print fmt readln ) 438 451 XPACKR ( print fmt readln )
," : _ LCD$ KBD$ (ok) RDLN$ ; _ " ," : _ LCD$ (ok) RDLN$ ; _ "
ORG @ 256 /MOD 2 PC! 2 PC! ORG @ 256 /MOD 2 PC! 2 PC!
H@ 256 /MOD 2 PC! 2 PC! H@ 256 /MOD 2 PC! 2 PC!