1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-24 14:28:06 +11:00

forth: Forth-ify "C!" and "C@"

This commit is contained in:
Virgil Dupras 2020-03-25 17:52:51 -04:00
parent 66412a1c30
commit 6d8edeec63
4 changed files with 18 additions and 30 deletions

Binary file not shown.

View File

@ -1288,23 +1288,10 @@ STORE:
ld (iy+1), h
jp next
; ( n a -- )
.db "C!"
.fill 5
.dw $-STORE
.db 0
CSTORE:
.dw nativeWord
pop hl
pop de
call chkPS
ld (hl), e
jp next
; ( a -- n )
.db "@"
.fill 6
.dw $-CSTORE
.dw $-STORE
.db 0
FETCH:
.dw nativeWord
@ -1314,24 +1301,10 @@ FETCH:
push hl
jp next
; ( a -- c )
.db "C@"
.fill 5
.dw $-FETCH
.db 0
CFETCH:
.dw nativeWord
pop hl
call chkPS
ld l, (hl)
ld h, 0
push hl
jp next
; ( a -- )
.db "DROP"
.fill 3
.dw $-CFETCH
.dw $-FETCH
.db 0
DROP:
.dw nativeWord

View File

@ -43,7 +43,6 @@
;
0x04 OP1r INCr,
0x46 OP1r LDr(HL),
0x70 OP1r LD(HL)r,
( r -- )
: OP1r0
@ -52,6 +51,7 @@
C@ ( r op )
OR A,
;
0x70 OP1r0 LD(HL)r,
0xa0 OP1r0 ANDr,
0xb0 OP1r0 ORr,
0xa8 OP1r0 XORr,

View File

@ -110,6 +110,21 @@ CODE XOR
HL PUSHqq,
;CODE
CODE C!
HL POPqq,
DE POPqq,
chkPS,
E LD(HL)r,
;CODE
CODE C@
HL POPqq,
chkPS,
L LDr(HL),
H 0 LDrn,
HL PUSHqq,
;CODE
CODE PC!
BC POPqq,
HL POPqq,