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

Remove BIT@ and BIT!

They were only used in the ti84 recipe and were not worth their cost.
This commit is contained in:
Virgil Dupras 2020-10-27 22:51:08 -04:00
parent fc63541725
commit 04bd57b527
4 changed files with 4 additions and 12 deletions

View File

@ -6,9 +6,3 @@
; ;
: , H@ ! H@ 2+ HERE ! ; : , H@ ! H@ 2+ HERE ! ;
: C, H@ C! H@ 1+ HERE ! ; : C, H@ C! H@ 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! ;

Binary file not shown.

View File

@ -151,8 +151,6 @@ J -- n Copy RS third item to PS
! 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.

View File

@ -7,7 +7,7 @@ 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@ [ KBD_MEM LITN ] C@ 1 AND ;
: _2nd! 0 [ KBD_MEM LITN ] BIT! ; : _2nd! [ KBD_MEM LITN ] C@ 0xfe AND + [ KBD_MEM LITN ] C! ;
: _alock@ 1 [ KBD_MEM LITN ] BIT@ ; : _alock@ [ KBD_MEM LITN ] C@ 2 AND ;
: _alock^ _alock@ NOT 1 [ KBD_MEM LITN ] BIT! ; : _alock^ [ KBD_MEM LITN ] C@ 2 XOR [ KBD_MEM LITN ] C! ;