Browse Source

forth: Forth-ify "-"

pull/95/head
Virgil Dupras 4 years ago
parent
commit
941224be94
3 changed files with 11 additions and 14 deletions
  1. BIN
      emul/forth/z80c.bin
  2. +2
    -14
      forth/forth.asm
  3. +9
    -0
      forth/z80c.fs

BIN
emul/forth/z80c.bin View File


+ 2
- 14
forth/forth.asm View File

@@ -1318,23 +1318,11 @@ PLUS:
push hl
jp next

; ( a b -- c ) A - B
.db "-"
.dw $-PLUS
.db 1
MINUS:
.dw nativeWord
pop de ; B
pop hl ; A
call chkPS
or a ; reset carry
sbc hl, de
push hl
jp next
.fill 18

; ( a1 a2 -- b )
.db "SCMP"
.dw $-MINUS
.dw $-PLUS
.db 4
SCMP:
.dw nativeWord


+ 9
- 0
forth/z80c.fs View File

@@ -113,6 +113,15 @@ CODE XOR
HL PUSHqq,
;CODE

CODE -
DE POPqq,
HL POPqq,
chkPS,
A ORr,
DE SBCHLss,
HL PUSHqq,
;CODE

CODE *
DE POPqq,
BC POPqq,


Loading…
Cancel
Save