Fixings remaining stack offset bugs

This commit is contained in:
Jeremiah Orians 2017-06-14 21:25:41 -04:00
parent 02b2d231a6
commit 2a12799d82
No known key found for this signature in database
GPG Key ID: 7457821534D2ACCD
4 changed files with 7 additions and 5 deletions

View File

@ -20,9 +20,11 @@ Incorporated High level prototypes into makefile
** Changed ** Changed
Extended VPATH in makefile to shorten dependency names Extended VPATH in makefile to shorten dependency names
Updated checksum for stage2 forth
** Fixed ** Fixed
Stack offset bug in stage2 forth was found and fixed by reepca in record time Stack offset bug in stage2 forth was found and fixed by reepca in record time
Fixed 2DUP and ?DUP in stage2 forth
** Removed ** Removed

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: 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 7f2645eada56a748f209dabbca39f72c4594017a78e6fcc8aed77a51a73093f7 roms/forth should with the sha256sum of 2328f09db939a69cbd244293d6131060c95e253ffe1212aae43890fdfd263a42
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)

View File

@ -227,8 +227,8 @@
NOP ; Flags NOP ; Flags
&2Dup_Code ; Where assembly is Stored &2Dup_Code ; Where assembly is Stored
:2Dup_Code :2Dup_Code
LOAD R0 R14 0 ; Get top of stack LOAD R0 R14 -4 ; Get top of stack
LOAD R1 R14 -4 ; Get second on stack LOAD R1 R14 -8 ; Get second on stack
PUSHR R1 R14 PUSHR R1 R14
PUSHR R0 R14 PUSHR R0 R14
JSR_COROUTINE R11 ; NEXT JSR_COROUTINE R11 ; NEXT
@ -262,7 +262,7 @@
NOP ; Flags NOP ; Flags
&QDup_Code ; Where assembly is Stored &QDup_Code ; Where assembly is Stored
:QDup_Code :QDup_Code
LOAD R0 R14 0 ; Get Top of stack LOAD R0 R14 -4 ; Get Top of stack
CMPSKIPI.E R0 0 ; Skip if Zero CMPSKIPI.E R0 0 ; Skip if Zero
PUSHR R0 R14 ; Duplicate value PUSHR R0 R14 ; Duplicate value
JSR_COROUTINE R11 ; NEXT JSR_COROUTINE R11 ; NEXT

View File

@ -1,6 +1,6 @@
8f465d3ec1cba00a7d024a1964e74bb6d241f86a73c77d95d8ceb10d09c8f7b9 roms/CAT 8f465d3ec1cba00a7d024a1964e74bb6d241f86a73c77d95d8ceb10d09c8f7b9 roms/CAT
59f0502748af32e3096e026a95e77216179cccfe803a05803317414643e2fcec roms/DEHEX 59f0502748af32e3096e026a95e77216179cccfe803a05803317414643e2fcec roms/DEHEX
7f2645eada56a748f209dabbca39f72c4594017a78e6fcc8aed77a51a73093f7 roms/forth 2328f09db939a69cbd244293d6131060c95e253ffe1212aae43890fdfd263a42 roms/forth
4c146297da8c672955698a82207295b28feb389c9856a2c6ea6a60ce7e84260a roms/lisp 4c146297da8c672955698a82207295b28feb389c9856a2c6ea6a60ce7e84260a roms/lisp
2b9727381aec15a504c0898189fbc2344209d8e04451e3fa5d743e08e38f64cf roms/M0 2b9727381aec15a504c0898189fbc2344209d8e04451e3fa5d743e08e38f64cf roms/M0
24a4d74eb2eb7a82e68335643855658b27b5a6c3b13db473539f3e08d6f26ceb roms/SET 24a4d74eb2eb7a82e68335643855658b27b5a6c3b13db473539f3e08d6f26ceb roms/SET