X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=blobdiff_plain;f=src%2Fdebug.4th;fp=src%2Fdebug.4th;h=91ea3ddebc98d2595db2d404a408d1d6dfe7dbbf;hb=4b2f52917ce00e4af92d2a3a86e199d21748da5b;hp=0000000000000000000000000000000000000000;hpb=d0d02a9174dd0a8e4e0c37dc2d990d692ee9a73d;p=forth.jl.git diff --git a/src/debug.4th b/src/debug.4th new file mode 100644 index 0000000..91ea3dd --- /dev/null +++ b/src/debug.4th @@ -0,0 +1,41 @@ +: CFA> + LATEST @ + BEGIN + ?DUP + WHILE + 2DUP SWAP + < IF + NIP + EXIT + THEN + @ + REPEAT + DROP + 0 +; + +: DECIMAL 10 BASE ! ; +: HEX 16 BASE ! ; + +: ID. + 1+ + DUP @ + F_LENMASK AND + + BEGIN + DUP 0> + WHILE + SWAP 1+ + DUP @ EMIT + SWAP 1- + REPEAT + 2DROP +; + +: name cfa> id. ; + +: [trace] immediate + trace ; + +\ : test 20 0 [trace] do 42 emit [trace] loop ; +