duskos

dusk os fork
git clone git://git.alexwennerberg.com/duskos
Log | Files | Refs | README | LICENSE

commit 518096c94478edb1076627eaf8d71907828a83bf
parent 3b8fc71428286e9331f272246790cf71abd1616c
Author: Virgil Dupras <hsoft@hardcoded.net>
Date:   Sat,  1 Jul 2023 08:31:39 -0400

hal: remove addr,

Overlaps "&) @," in functionality.

Diffstat:
Mfs/doc/hal.txt | 5++---
Mfs/xcomp/arm/rpi/kernel.fs | 4++--
Mfs/xcomp/bootlo.fs | 6+++---
Mfs/xcomp/i386/kernel.fs | 5++---
Mposix/vm.c | 8+++-----
5 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/fs/doc/hal.txt b/fs/doc/hal.txt @@ -179,7 +179,7 @@ W) -- op Indirect W register A) -- op Indirect A register PSP) -- op Indirect PSP register RSP) -- op Indirect RSP register -i) n -- op Immediate operand +i) n -- op Immediate operand. Can't use with <>) m) addr -- op Absolute address +) op disp -- op Apply displacement to op. Can be applied multiple times. A>) op -- op A register is the destination instead of W @@ -229,7 +229,7 @@ popret, -- Instructions: @, op -- Read source into dest -!, op -- Write dest to source +!, op -- Write dest to source. Shortcut for "<>) @," @!, op -- Swap dest and source +, op -- Z Add source to dest -, op -- dest - operand @@ -245,7 +245,6 @@ Instructions: [!+], op -- Write dest into indirect source and add 4 to source. compare, op -- A Compare source to dest (all flags set) +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 diff --git a/fs/xcomp/arm/rpi/kernel.fs b/fs/xcomp/arm/rpi/kernel.fs @@ -712,7 +712,7 @@ xcode !, ( operand -- ) ( pc ) r0 pc@>reg, L4 abs>rel b) ,) pc add) 0 imm) ,) -xcode addr, ( operand -- ) +pc to L1 r0 binstart HBANK movi2, ldr) r0 rdn) ,) tst) rTOP rn) $20 imm) ,) mov) nz) rTOP rd) r0 rm) ,) @@ -739,7 +739,7 @@ xcode @!, ( operand -- ) tst) rTOP rn) $10 imm) ,) \ has offset? forward b) z) ,) xdup, setrd0) rTOP rdn) ,) - wcall, addr, + L1 abscall, setrn0) rTOP rdn) ,) forward! ( pc ) r0 pc@>reg, diff --git a/fs/xcomp/bootlo.fs b/fs/xcomp/bootlo.fs @@ -129,8 +129,8 @@ code ^ -1 i) ^, exit, : r@ dup, RSP) @, ; immediate : r> [compile] r@ [compile] rdrop ; immediate : >r [compile] r! drop, ; immediate -code scnt pushret, dup, PSP) addr, ] PSTOP -^ >> >> 1- ; -code rcnt pushret, dup, RSP) addr, ] RSTOP -^ >> >> ; +code scnt pushret, dup, PSP) &) @, ] PSTOP -^ >> >> 1- ; +code rcnt pushret, dup, RSP) &) @, ] RSTOP -^ >> >> ; : while [compile] if swap ; immediate : repeat [compile] again [compile] then ; immediate @@ -184,7 +184,7 @@ _to to@+ @@+ _@@+, :16b 16b) [!+], drop, ; :8b 8b) [!+], drop, ; _to to!+ @!+ _@!+, -: _addr, dup, addr, ; :16b dup, addr, ; :8b dup, addr, ; +: _addr, dup, &) @, ; :16b dup, &) @, ; :8b dup, &) @, ; _to to' noop _addr, : _toexec ( a -- ) compiling if m) then toptr@ execute ; : value doer , immediate does> _toexec ; diff --git a/fs/xcomp/i386/kernel.fs b/fs/xcomp/i386/kernel.fs @@ -143,6 +143,7 @@ $5 xconst NZ) $2 xconst <) $3 xconst >=) $6 xconst <=) $7 xconst >) $c xconst s<) $d xconst s>=) $e xconst s<=) $f xconst s>) +\ TODO: make into rolling bank pc to lblhbank 0 le, lblhbank xconst HBANK xcode m) ( a -- operand ) @@ -155,6 +156,7 @@ xcode i) ( n -- operand ) ax HALIMM i) mov, ret, +\ TODO: allow multiple applications pc to L1 xdrop, ret, xcode +) ( operand n -- operand ) ax ax test, L1 abs>rel jz, @@ -295,9 +297,6 @@ xcode !, ( operand -- ) xcode @!, ( operand -- ) \ operand ax xchg, ax $8600 i) or, lblregularwr absjmp, -xcode addr, ( operand -- ) \ ax operand lea, - ax $8d00 i) or, lblregularwr absjmp, - xcode +n, ( n operand -- ) \ operand n i) add, si 0 d) 1 i) cmp, forward8 jnz, xnip, ax $fe00 i) or, lblregularwr absjmp, forward! diff --git a/posix/vm.c b/posix/vm.c @@ -308,7 +308,6 @@ static void ADDN() { M32B; _maddn(); } static void WCMP() { M32B; _wcmp(); } static void WIFETCHINC() { M32B; _wifetchinc(); } static void WISTOREINC() { M32B; _wistoreinc(); } -static void WLEA() { readop(); opdset((dword)((byte*)opsrc-vm.mem)); } static void WFETCH16() { M16B; _wfetch(); } // 0x18 static void WSWAP16() { M16B; _wswap(); } @@ -894,9 +893,9 @@ static void DRVWR() { static void (*ops[OPCNT])() = { BR, CALL, RET, BRWR, BRA, BRC, NULL, YIELD, PSADD, RSADD, NULL, NULL, NULL, NULL, NULL, NULL, - WFETCH, NULL, WSWAP, ADDN, WCMP, WIFETCHINC, WISTOREINC, WLEA, - WFETCH16, NULL, WSWAP16, ADDN16, WCMP16, WIFETCHINC16, WISTOREINC16, WLEA, - WFETCH8, NULL, WSWAP8, ADDN8, WCMP8, WIFETCHINC8, WISTOREINC8, WLEA, + WFETCH, NULL, WSWAP, ADDN, WCMP, WIFETCHINC, WISTOREINC, NULL, + WFETCH16, NULL, WSWAP16, ADDN16, WCMP16, WIFETCHINC16, WISTOREINC16, NULL, + WFETCH8, NULL, WSWAP8, ADDN8, WCMP8, WIFETCHINC8, WISTOREINC8, NULL, MOVE, BOOTRD, STDOUT, MAYBEKEY, RANGEEQ, MAKEMEM, ADDDISP, CIDX, MAYBEWORD, WORD, PARSE, FIND, WNF, FINDMOD, NULL, NULL, STACKCHK, COMPWORD, RUNWORD, COMPILING, STARTCOMP, STOPCOMP, RSADDWR, COMPOP, @@ -1000,7 +999,6 @@ static void buildsysdict() { entry("&,"); compbinopwr(0x08); retwr(); entry("|,"); compbinopwr(0x09); retwr(); entry("^,"); compbinopwr(0x0a); retwr(); - entry("addr,"); compopwr(0x17); retwr(); entry("-W,"); compileop(0x4e); retwr(); entry("C>W,"); compileop(0x5e); cwritewr(); retwr(); entry("exit,"); compileop(0x02); retwr();