From b40fba6baf84dcf8b6d4f108418e55f0da7b0730 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Tue, 26 Nov 2024 07:48:52 -0500 Subject: add base --- core.fth | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'core.fth') diff --git a/core.fth b/core.fth index 1a6f1dd..ed28e1f 100644 --- a/core.fth +++ b/core.fth @@ -16,6 +16,7 @@ : ip [ _d cell+ cell+ ] literal ; : here dp @ ; : unused [ _d 8 cells + ] literal @ here - ; +: base [ _d 9 cells + ] literal ; : latest [ _d 4 cells + ] literal @ ; \ : dup sp@ @ ; @@ -39,7 +40,10 @@ : 1+ 1 + ; : 1- 1 - ; -: if ['] _jmp0 , here 0 , ; immediate -: then here swap ! ; immediate -: else ['] _jmp , here 0 , swap here swap ! ; immediate +: if ['] _jmp0 , here 0 , ; immediate +: then here swap ! ; immediate +: else ['] _jmp , here 0 , swap here swap ! ; immediate + +: decimal 10 base ! ; +: hex 16 base ! ; -- cgit v1.2.3