@@ 202,24 202,24 @@ branchA, --
Instructions:
-@, op -- Read source into dest
-!, op -- Write dest to source
-@!, op -- Swap dest and source
-+, op -- *Z* Add source to dest
-[@], op -- Read indirect source into dest
-[!], op -- Write indirect source into dest
-compare, op -- Compare source to dest
-[+n], n op -- *Z* Add n to source without affecting dest
-addr, op -- Store the effective address of the operand in dest
-
-ps+, n -- Add n to PSP
-rs+, n -- Add n to RSP
-W+n, n -- *Z* Add n to W
-A+n, n -- *Z* Add n to A
-W>A, -- Copy W to A
-A>W, -- Copy A to W
-W<>A, -- Swap W and A
--W, -- W = -W
+@, op -- Read source into dest
+!, op -- Write dest to source
+@!, op -- Swap dest and source
++, op -- Z Add source to dest
+[@], op -- Read indirect source into dest
+[!], op -- Write indirect source into dest
+compare, op -- Compare source to dest
+[+n], n op -- Z Add n to source without affecting dest
+addr, op -- Store the effective address of the operand in dest
+
+ps+, n -- Add n to PSP
+rs+, n -- Add n to RSP
+W+n, n -- Z Add n to W
+A+n, n -- Z Add n to A
+W>A, -- Copy W to A
+A>W, -- Copy A to W
+W<>A, -- Swap W and A
+-W, -- W = -W
## High HAL
@@ 245,12 245,12 @@ s>=)
Instructions:
--, op -- dest - operand
-*, op -- dest * operand
-/, op -- dest / operand
-%, op -- dest modulo operand
-<<, op -- dest lshift operand
->>, op -- dest rshift operand
-&, op -- dest and operand
-|, op -- dest or operand
-^, op -- dest xor operand
+-, op -- dest - operand
+*, op -- dest * operand
+/, op -- dest / operand
+%, op -- dest modulo operand
+<<, op -- dest lshift operand
+>>, op -- dest rshift operand
+&, op -- Z dest and operand
+|, op -- Z dest or operand
+^, op -- Z dest xor operand
@@ 1,7 1,13 @@
\ CRC implementations
+?f<< /asm/hal.fs
-?f<< comp/c/cc.fs
-cc<< lib/crc.c
+code crc32 ( crc c -- crc )
+ PSP) ^,
+ 8 i) A>) @, PSP) A>) !, begin \ counter in PSP+0
+ W>A, 1 i) >>,
+ 1 i) A>) &, 0 Z) branchC, $edb88320 i) ^, then
+ -1 PSP) [+n], NZ) branchC, drop
+ nip, exit,
\ Computes CRC32 over range "a u".
: crc32[] ( a u -- crc )
@@ 563,7 563,8 @@ static BinOp binops[BINOPCNT] = {
};
static void _binop() {
byte binopidx = gpcb(); readop();
- opdset(binops[binopidx](opdget(), opsget())); }
+ dword n = binops[binopidx](opdget(), opsget());
+ opdset(n); vm.Z = n == 0; }
static void WBINOP() { M32B; _binop(); } // 0x48
static void WBINOP16() { M16B; _binop(); }
static void WBINOP8() { M8B; _binop(); }