Now putting strings in an entirely seperate block of memory

This commit is contained in:
Jeremiah Orians 2016-10-31 22:35:12 -04:00
parent 4cae5c35fa
commit 2136cbc220
No known key found for this signature in database
GPG Key ID: 7457821534D2ACCD
1 changed files with 10 additions and 3 deletions

View File

@ -49,6 +49,9 @@
:RETURN_BASE :RETURN_BASE
'00040000' '00040000'
:STRING_BASE
'00050000'
:PARAMETER_BASE :PARAMETER_BASE
'00060000' '00060000'
@ -799,6 +802,8 @@
:Word_Direct :Word_Direct
COPY R1 R7 ; Using designated IO COPY R1 R7 ; Using designated IO
FALSE R2 ; Starting at index 0 FALSE R2 ; Starting at index 0
PUSHR R8 R15 ; Protect the HEAP
LOADR R8 @STRING_BASE ; Use the STRING_BASE instead
:Word_Start :Word_Start
FGETC ; Read a byte FGETC ; Read a byte
@ -850,9 +855,11 @@
:Word_Done :Word_Done
PUSHR R8 R14 ; Push pointer to string on parameter stack PUSHR R8 R14 ; Push pointer to string on parameter stack
PUSHR R2 R14 ; Push number of bytes in length onto stack PUSHR R2 R14 ; Push number of bytes in length onto stack
CMPSKIPI.LE R2 0 ; If number of bytes is greater than 0 ADDUI R2 R2 4 ; Add a null to end of string
ADDUI R2 R2 1 ; Add a null to end of string ANDI R2 R2 -4 ; Rounded up the next for or to Zero
ADD R8 R8 R2 ; Update HEAP pointer ADD R8 R8 R2 ; Update pointer
STORER R8 @STRING_BASE ; Save its value
POPR R8 R15 ; Restore HEAP
RET R15 RET R15
;; NUMBER ;; NUMBER