From 13042477656e8c03e477038cce174042b7b99e0c Mon Sep 17 00:00:00 2001 From: Naren Ratan Date: Fri, 6 Dec 2019 22:29:14 +0000 Subject: Add CLZ, increase data segment size --- jonesforth.S | 3 ++- jonesforth.f | 2 +- 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) / -- cgit 1.4.1-2-gfad0