Incorporated requested function into stage2 forth
This commit is contained in:
parent
37fc186cbc
commit
54f4019767
|
@ -18,6 +18,7 @@
|
||||||
** Added
|
** Added
|
||||||
Incorporated High level prototypes into makefile
|
Incorporated High level prototypes into makefile
|
||||||
Added logic to catch non-existent input files and report a useful error message
|
Added logic to catch non-existent input files and report a useful error message
|
||||||
|
Added DP! to stage2 forth
|
||||||
|
|
||||||
** Changed
|
** Changed
|
||||||
Extended VPATH in makefile to shorten dependency names
|
Extended VPATH in makefile to shorten dependency names
|
||||||
|
|
|
@ -174,7 +174,7 @@ Then we use our M0 Line macro assembler to convert our assembly into hex2 format
|
||||||
Then we need to assemble that hex into our desired program:
|
Then we need to assemble that hex into our desired program:
|
||||||
./bin/vm --rom roms/stage1_assembler-2 --tape_01 temp2 --tape_02 roms/forth --memory 48K
|
./bin/vm --rom roms/stage1_assembler-2 --tape_01 temp2 --tape_02 roms/forth --memory 48K
|
||||||
|
|
||||||
roms/forth should with the sha256sum of 2328f09db939a69cbd244293d6131060c95e253ffe1212aae43890fdfd263a42
|
roms/forth should with the sha256sum of 110dfd9cf2187ed8bf68a07510f054d96a55ec26377fe9d3a8e1f44ced2313f4
|
||||||
|
|
||||||
Our forth will first attempt to evaluate any code in tape_01 and then evaluate any code that the user types in
|
Our forth will first attempt to evaluate any code in tape_01 and then evaluate any code that the user types in
|
||||||
(Otherwise there is no way for a forth fan to have a chance against the lisp in terms of being able to bootstrap something cool)
|
(Otherwise there is no way for a forth fan to have a chance against the lisp in terms of being able to bootstrap something cool)
|
||||||
|
|
|
@ -699,13 +699,25 @@
|
||||||
PUSHR R8 R14 ; Put HERE onto stack
|
PUSHR R8 R14 ; Put HERE onto stack
|
||||||
JSR_COROUTINE R11 ; NEXT
|
JSR_COROUTINE R11 ; NEXT
|
||||||
|
|
||||||
|
;; UPDATE_HERE
|
||||||
|
:Update_Here_Text
|
||||||
|
"DP!"
|
||||||
|
:Update_Here_Entry
|
||||||
|
&Here_Entry ; Pointer to HERE
|
||||||
|
&Update_Here_Text ; Pointer to Name
|
||||||
|
NOP ; Flags
|
||||||
|
&Update_Here_Code ; Where assembly is Stored
|
||||||
|
:Update_Here_Code
|
||||||
|
POPR R8 R14 ; Pop STACK onto HERE
|
||||||
|
JSR_COROUTINE R11 ; NEXT
|
||||||
|
|
||||||
;; Return Stack functions
|
;; Return Stack functions
|
||||||
|
|
||||||
;; >R
|
;; >R
|
||||||
:TOR_Text
|
:TOR_Text
|
||||||
">R"
|
">R"
|
||||||
:TOR_Entry
|
:TOR_Entry
|
||||||
&Here_Entry ; Pointer to HERE
|
&Update_Here_Entry ; Pointer to UPDATE_HERE
|
||||||
&TOR_Text ; Pointer to Name
|
&TOR_Text ; Pointer to Name
|
||||||
NOP ; Flags
|
NOP ; Flags
|
||||||
&TOR_Code ; Where assembly is Stored
|
&TOR_Code ; Where assembly is Stored
|
||||||
|
@ -1087,13 +1099,17 @@
|
||||||
NOP ; Flags
|
NOP ; Flags
|
||||||
&Create_Code ; Where assembly is Stored
|
&Create_Code ; Where assembly is Stored
|
||||||
:Create_Code
|
:Create_Code
|
||||||
COPY R0 R8 ; Preserve HERE for next LATEST
|
POPR R0 R14 ; Get Length
|
||||||
PUSHR R9 R8 ; Store LATEST onto HEAP
|
POPR R1 R14 ; Get Pointer
|
||||||
POPR R1 R14 ; Get pointer to string
|
FALSE R2 ; Set to Zero
|
||||||
PUSHR R1 R8 ; Store string pointer onto HEAP
|
CMPJUMPI.LE R0 R2 @Create_Code_1 ; Prevent size below 1
|
||||||
FALSE R1 ; Prepare NOP for Flag
|
:Create_Code_0
|
||||||
PUSHR R1 R8 ; Push NOP Flag
|
LOAD8 R2 R1 0 ; Read Byte
|
||||||
MOVE R0 R9 ; Set LATEST
|
STORE8 R2 R8 0 ; Write at HERE
|
||||||
|
ADDUI R8 R8 1 ; Increment HERE
|
||||||
|
SUBUI R0 R0 1 ; Decrement Length
|
||||||
|
JUMP.NZ R0 @Create_Code_0 ; Keep Looping
|
||||||
|
:Create_Code_1
|
||||||
JSR_COROUTINE R11 ; NEXT
|
JSR_COROUTINE R11 ; NEXT
|
||||||
|
|
||||||
;; DEFINE
|
;; DEFINE
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
8f465d3ec1cba00a7d024a1964e74bb6d241f86a73c77d95d8ceb10d09c8f7b9 roms/CAT
|
8f465d3ec1cba00a7d024a1964e74bb6d241f86a73c77d95d8ceb10d09c8f7b9 roms/CAT
|
||||||
59f0502748af32e3096e026a95e77216179cccfe803a05803317414643e2fcec roms/DEHEX
|
59f0502748af32e3096e026a95e77216179cccfe803a05803317414643e2fcec roms/DEHEX
|
||||||
2328f09db939a69cbd244293d6131060c95e253ffe1212aae43890fdfd263a42 roms/forth
|
110dfd9cf2187ed8bf68a07510f054d96a55ec26377fe9d3a8e1f44ced2313f4 roms/forth
|
||||||
4c146297da8c672955698a82207295b28feb389c9856a2c6ea6a60ce7e84260a roms/lisp
|
4c146297da8c672955698a82207295b28feb389c9856a2c6ea6a60ce7e84260a roms/lisp
|
||||||
2b9727381aec15a504c0898189fbc2344209d8e04451e3fa5d743e08e38f64cf roms/M0
|
2b9727381aec15a504c0898189fbc2344209d8e04451e3fa5d743e08e38f64cf roms/M0
|
||||||
24a4d74eb2eb7a82e68335643855658b27b5a6c3b13db473539f3e08d6f26ceb roms/SET
|
24a4d74eb2eb7a82e68335643855658b27b5a6c3b13db473539f3e08d6f26ceb roms/SET
|
||||||
|
|
Loading…
Reference in New Issue