projects
/
rrq
/
rrqforth.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bug fix to use stream
[rrq/rrqforth.git]
/
temp.asm
diff --git
a/temp.asm
b/temp.asm
index 9759f546eee4e62dbbbb1e6079f15ecac59d3b28..8e0be257f11e4f7bbf022d82dba366f94528141c 100644
(file)
--- a/
temp.asm
+++ b/
temp.asm
@@
-7,9
+7,9
@@
WORD p_objectspace,'TEMPSPACE',dovariable
;; Holds size and address of the object space.
WORD p_objectspace,'TEMPSPACE',dovariable
;; Holds size and address of the object space.
- dq 104857600 ; Total object space size (request size)
- dq 0 ; Object space base address
- dq 0 ; Currently used.
+ dq 104857600 ;
[0]
Total object space size (request size)
+ dq 0 ;
[8]
Object space base address
+ dq 0 ;
[16]
Currently used.
WORD p_temp,'TEMP',fasm
;; ( size -- addr )
WORD p_temp,'TEMP',fasm
;; ( size -- addr )
@@
-29,6
+29,7
@@
p_objecthole_initialized:
mov qword [p_objectspace_DFA+16],0
mov rax,qword [rsp]
p_objecthole_from_tail:
mov qword [p_objectspace_DFA+16],0
mov rax,qword [rsp]
p_objecthole_from_tail:
+ ;; rax = new usage count
mov rbx,qword [p_objectspace_DFA+16]
mov qword [p_objectspace_DFA+16],rax
add rbx,qword [p_objectspace_DFA+8]
mov rbx,qword [p_objectspace_DFA+16]
mov qword [p_objectspace_DFA+16],rax
add rbx,qword [p_objectspace_DFA+8]
@@
-36,15
+37,25
@@
p_objecthole_from_tail:
popr rsi
next
popr rsi
next
- WORD p_str2temp,'STR>TEMP'
+ WORD p_str2temp,'STR>TEMP'
,fasm
;; ( char* n -- char* n )
;; Capture a given [n:char*] string as a new temp object with
;; leading size cell.
;; ( char* n -- char* n )
;; Capture a given [n:char*] string as a new temp object with
;; leading size cell.
- dq p_dup, p_gtR ; size
- dq p_dup, p_temp
- dq p_dup, p_gtR ; address
- dq p_2dup, p_put
- dq p_literal, 8, p_plus
- dq p_swap, p_strncpy
- dq p_Rgt, p_Rgt, p_swap
- dq p_exit
+ pushr rsi
+ mov rax,qword [rsp]
+ add rax,8
+ push rax
+ DOFORTH p_temp ; ( -- char* n addr )
+ pop rax
+ pop rbx
+ mov qword[rax],rbx
+ add rax,8
+ pop rcx
+ push rax
+ push rbx
+ push rcx
+ push rax
+ push rbx ; ( -- addr n char* addr n )
+ DOFORTH p_strncpy
+ popr rsi
+ next