Skip to content

Commit

Permalink
Implement U. natively
Browse files Browse the repository at this point in the history
  • Loading branch information
remko committed Nov 8, 2019
1 parent 29a8f5c commit eaf5264
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
17 changes: 5 additions & 12 deletions src/waforth.wat
Expand Up @@ -1291,9 +1291,11 @@
(data (i32.const 136844) "|\u0016\u0002\u0000\u0004TYPE\u0000\u0000\u0000\u0085\u0000\u0000\u0000")
(elem (i32.const 0x85) $TYPE) ;; none

(func $U. (call $fail (i32.const 0x20084))) ;; not implemented
(data (i32.const 136860) "\u008c\u0016\u0002\u0000\u0002_.\u0000\u0086\u0000\u0000\u0000")
(elem (i32.const 0x86) $U.) ;; TODO: Rename
(func $U.
(call $U._ (call $pop) (i32.load (i32.const !baseBase)))
(call $shell_emit (i32.const 0x20)))
(data (i32.const 136860) "\u008c\u0016\u0002\u0000\u0002U.\u0000\u0086\u0000\u0000\u0000")
(elem (i32.const 0x86) $U.)

;; 6.1.2340
(func $U<
Expand Down Expand Up @@ -1585,15 +1587,6 @@

;; High-level words
(!prelude #<<EOF
\ 6.1.2320
: U.
BASE @ /MOD
?DUP IF RECURSE THEN
DUP 10 < IF 48 ELSE 10 - 65 THEN
+
EMIT
;

\ 6.2.0210
: .R
SWAP
Expand Down
2 changes: 1 addition & 1 deletion tests/tests.js
Expand Up @@ -1470,7 +1470,7 @@ function loadTests(wasmModule, arrayToBase64) {
expect(output).to.include(
"YOU SHOULD SEE THE NUMBER RANGES OF SIGNED AND UNSIGNED NUMBERS:\n SIGNED: -80000000 7FFFFFFF \n"
);
expect(output).to.include("UNSIGNED: 0/\n");
expect(output).to.include("UNSIGNED: 0 FFFFFFFF \n");
});
});
});
Expand Down

0 comments on commit eaf5264

Please sign in to comment.