Browse Source

forth: Forth-ify SYSVNXT

pull/95/head
Virgil Dupras 4 years ago
parent
commit
e984efe6c3
2 changed files with 11 additions and 21 deletions
  1. +7
    -2
      forth/core.fs
  2. +4
    -19
      forth/forth.asm

+ 7
- 2
forth/core.fs View File

@@ -86,9 +86,14 @@


: (sysv) : (sysv)
(entry) (entry)
( JTBL+0 == sysvarWord )
[ JTBL LITN ] , [ JTBL LITN ] ,
SYSVNXT @ ,
2 SYSVNXT +!
( JTBL+42 == SYSVNXT )
[ JTBL 42 + @ LITN ] DUP ( a a )
( Get new sysv addr )
@ , ( a )
( increase current sysv counter )
2 SWAP +!
; ;


: ." : ."


+ 4
- 19
forth/forth.asm View File

@@ -127,6 +127,7 @@ LIT:
jp strcmp jp strcmp
.dw RS_ADDR .dw RS_ADDR
.dw CINPTR .dw CINPTR
.dw SYSVNXT


; *** Code *** ; *** Code ***
forthMain: forthMain:
@@ -163,19 +164,11 @@ forthMain:
.bootName: .bootName:
.db "BOOT", 0 .db "BOOT", 0


.fill 93
.fill 91


; STABLE ABI ; STABLE ABI
; Offset: 00cd ; Offset: 00cd
.out $ .out $
; *** Collapse OS lib copy ***
; In the process of Forth-ifying Collapse OS, apps will be slowly rewritten to
; Forth and the concept of ASM libs will become obsolete. To facilitate this
; transition, I make, right now, a copy of the routines actually used by Forth's
; native core. This also has the effect of reducing binary size right now and
; give us an idea of Forth's compactness.
; These routines below are copy/paste from apps/lib and stdio.

; copy (HL) into DE, then exchange the two, utilising the optimised HL instructions. ; copy (HL) into DE, then exchange the two, utilising the optimised HL instructions.
; ld must be done little endian, so least significant byte first. ; ld must be done little endian, so least significant byte first.
intoHL: intoHL:
@@ -834,18 +827,10 @@ FLAGS_:
.dw sysvarWord .dw sysvarWord
.dw FLAGS .dw FLAGS


.db "SYSVNXT"
.dw $-FLAGS_
.db 7
SYSVNXT_:
.dw sysvarWord
.dw SYSVNXT


.fill 51
.fill 65


.db "_bend" .db "_bend"
.dw $-SYSVNXT_
.dw $-FLAGS_
.db 5 .db 5
; Offset: 0647 ; Offset: 0647
.out $ .out $

Loading…
Cancel
Save