about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorNaren Ratan <narenratan@gmail.com>2019-12-06 22:29:14 +0000
committerNaren Ratan <narenratan@gmail.com>2019-12-06 22:29:14 +0000
commit13042477656e8c03e477038cce174042b7b99e0c (patch)
tree2be219dff09c389489bba5c649603413e5aab991
parentf5d5e45149efd64967eb3a080f84d4cae4df58a3 (diff)
downloadjonesforth_arm64_apl-13042477656e8c03e477038cce174042b7b99e0c.tar.gz
Add CLZ, increase data segment size
-rw-r--r--jonesforth.S3
-rw-r--r--jonesforth.f2
2 files changed, 3 insertions, 2 deletions
diff --git a/jonesforth.S b/jonesforth.S
index 99733ce..4af6701 100644
--- a/jonesforth.S
+++ b/jonesforth.S
@@ -87,6 +87,7 @@ def 40⌽; pop D,x0; rev x0,x0; push D,x0; NEXT;				def 20⌽; pop D,x0; rev32 x
 def 10⌽; pop D,x0; rev16 x0,x0; push D,x0; NEXT;			def 1⌽; pop D,x0; rbit x0,x0; push D,x0; NEXT
 def >>;	pop2 D,x0,x1; lsr x0,x1,x0; push D,x0; NEXT;			def <<;	pop2 D,x0,x1; lsl x0,x1,x0; push D,x0; NEXT
 def ⌽>;	pop2 D,x0,x1; ror x0,x1,x0; push D,x0; NEXT
+def CLZ; pop D,x0; clz x0,x0; push D,x0; NEXT
 
 // Memory
 def !; pop2 D,x0,x1; str x1,[x0]; NEXT;					def @; pop D,x0; ldr x0,[x0]; push D,x0; NEXT
@@ -254,4 +255,4 @@ _start:	mov D,sp					// Initialize Data stack pointer
 	.data
 first:	.xword QUIT
 	.bss
-	.align 3; Dstart: .space 16384; Rtop:		// Space for data area (pointed to by H) and return stack
+	.align 3; Dstart: .space 262144; Rtop:		// Space for data area (pointed to by H) and return stack
diff --git a/jonesforth.f b/jonesforth.f
index 44db111..18c3500 100644
--- a/jonesforth.f
+++ b/jonesforth.f
@@ -85,7 +85,7 @@
 ∇ 1DUMP ↑ U. SPACE @ 40⌽ U. ∇ / a→ /
 ∇ DUMP ( ↑ ∥ ↕ ↑ 1DUMP CR 8+ ↕ 1- ) 2↓ ∇ / an→ /
 
-∇ INDATA? [ find EXIT ] LITERAL [ find MOD 4000 + ] LITERAL WITHIN ∇                    / a→n Check if address is in data area /
+∇ INDATA? [ find EXIT ] LITERAL [ find MOD 40000 + ] LITERAL WITHIN ∇                   / a→n Check if address is in data area /
 ∇ CEXIT [ find EXIT >CFA ] LITERAL ∇                                                    / →a  Codeword address of EXIT /
 ∇ SEE find >DFA ( ↑ @ CEXIT ≠ ∥ ↑ ↑ 1DUMP SPACE @ ↑ INDATA? { 8- ID. | . } CR 8+ ) ↓ ∇  / Decompile a word (try printing names of words, print literals) /