Added an EXECUTE command primitive to stage2 forth

This commit is contained in:
Jeremiah Orians 2017-06-16 16:36:03 -04:00
parent 77795c669c
commit 8b0384b370
No known key found for this signature in database
GPG Key ID: 7457821534D2ACCD
4 changed files with 16 additions and 3 deletions

View File

@ -19,6 +19,7 @@
Incorporated High level prototypes into makefile
Added logic to catch non-existent input files and report a useful error message
Added DP! to stage2 forth
Added EXECUTE to stage2 forth
Added string print and address to output of High level prototype disassembler
** Changed

View File

@ -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:
./bin/vm --rom roms/stage1_assembler-2 --tape_01 temp2 --tape_02 roms/forth --memory 48K
roms/forth should with the sha256sum of 82e88791a784d9633a457e5cabbed5383e6c4f54d0711428c034c4ae2424fc21
roms/forth should with the sha256sum of bfa6723d360439c9893951f1101e343b03369bf2267a820b8a1c80543595bf33
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)

View File

@ -1221,13 +1221,25 @@
ADD R13 R13 R0 ; Set NEXT to NEXT plus the offset
JSR_COROUTINE R11 ; NEXT
;; EXECUTE
:Execute_Text
"EXECUTE"
:Execute_Entry
&0Branch_Entry ; Pointer to 0Branch
&Execute_Text ; Pointer to Name
NOP ; Flags
&Execute_Code ; Where assembly is Stored
:Execute_Code
POPR R0 R14 ; Get value off parameter stack
JSR_COROUTINE R0 ; Jump to that address
;; Interaction Commands
;; QUIT
:Quit_Text
"QUIT"
:Quit_Entry
&0Branch_Entry ; Pointer to 0Branch
&Execute_Entry ; Pointer to Execute
&Quit_Text ; Pointer to Name
NOP ; Flags
:Quit_Code

View File

@ -1,6 +1,6 @@
8f465d3ec1cba00a7d024a1964e74bb6d241f86a73c77d95d8ceb10d09c8f7b9 roms/CAT
59f0502748af32e3096e026a95e77216179cccfe803a05803317414643e2fcec roms/DEHEX
82e88791a784d9633a457e5cabbed5383e6c4f54d0711428c034c4ae2424fc21 roms/forth
bfa6723d360439c9893951f1101e343b03369bf2267a820b8a1c80543595bf33 roms/forth
4c146297da8c672955698a82207295b28feb389c9856a2c6ea6a60ce7e84260a roms/lisp
2b9727381aec15a504c0898189fbc2344209d8e04451e3fa5d743e08e38f64cf roms/M0
24a4d74eb2eb7a82e68335643855658b27b5a6c3b13db473539f3e08d6f26ceb roms/SET