duskos

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

commit b6be887df7461771def1cbcdedab2134a255c7fb
parent e0c771841d61046d0f8cb73e43c9e004d32bd246
Author: Virgil Dupras <hsoft@hardcoded.net>
Date:   Wed, 28 Jun 2023 21:31:18 -0400

hal: re-add A>)

Diffstat:
Mfs/xcomp/arm/rpi/kernel.fs | 5+++++
Mfs/xcomp/bootlo.fs | 12++++++------
Mfs/xcomp/i386/kernel.fs | 9++++++---
3 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/fs/xcomp/arm/rpi/kernel.fs b/fs/xcomp/arm/rpi/kernel.fs @@ -497,6 +497,11 @@ xcode 32b) ( operand -- operand ) orr) rTOP rdn) $04000000 imm) ,) exit, +xcode A>) ( operand -- operand ) + setrd0) rTOP rdn) ,) + orr) rTOP rdn) rA 12 lshift imm) ,) + exit, + xcode &) ( operand -- operand ) orr) rTOP rdn) HALDEREF imm) ,) exit, diff --git a/fs/xcomp/bootlo.fs b/fs/xcomp/bootlo.fs @@ -17,9 +17,9 @@ code8b HERE @ W) 8b) @, exit, code c@ branch, drop code w@ branch, drop -code ! A) &) !, PSP) @, A) !, 2drop, exit, -code16b HERE @ A) &) !, PSP) @, A) 16b) !, 2drop, exit, -code8b HERE @ A) &) !, PSP) @, A) 8b) !, 2drop, exit, +code ! PSP) A>) @, W) A>) !, 2drop, exit, +code16b HERE @ PSP) A>) @, W) A>) 16b) !, 2drop, exit, +code8b HERE @ PSP) A>) @, W) A>) 8b) !, 2drop, exit, code c! branch, drop code w! branch, drop @@ -152,7 +152,7 @@ create toptrdef ' @ , ' _@, , \ Compiling words create _ 0 , -code (does) pushret, r> A) &) !, W) @, A) &) @!, CELLSZ W+n, branchA, +code (does) pushret, r> W) A>) @, CELLSZ W+n, branchA, : doer code pushret, compile (does) HERE @ _ ! CELLSZ allot ; : does> r> ( exit current definition ) _ @ ! ; : does' ( w -- 'data ) DOESSZ + ; @@ -333,9 +333,9 @@ create _ 0 , EMETA_8B , EMETA_16B , : sconst doer CELLSZ _sfield does> [ W) CELLSZ +) @, ] + @ ; : smethod doer CELLSZ _sfield - does> [ popret, W) CELLSZ +) @, PSP) +, W) @, A) &) !, drop, branchA, + does> [ popret, W) CELLSZ +) @, PSP) +, W) A>) @, drop, branchA, : ssmethod doer CELLSZ _sfield - does> [ popret, W) CELLSZ +) @, PSP) +, W) @, A) &) !, 2drop, branchA, + does> [ popret, W) CELLSZ +) @, PSP) +, W) A>) @, 2drop, branchA, : nabort, ( n -- ) ['] abort swap for dup , next drop ; \ 4b link to struct diff --git a/fs/xcomp/i386/kernel.fs b/fs/xcomp/i386/kernel.fs @@ -9,15 +9,15 @@ \ these cases, the word itself mentions which registers are preserved. \ HAL operand structure (very close to i386 structure) -\ b2:0 regid -\ b5:3 zeroes +\ b2:0 src regid +\ b5:3 dst regid \ b7:6 mod ( displacement in bank if present ) \ b8 0=8b 1=32/16b \ b14:9 zeroes \ b15 immediate? ( value in bank ) \ b16 "&)" flag \ b17 16b? -\ b18 "A>)" flag +\ b18 zero \ b19 "<>)" flag \ b23:20 Number bank index \ b31:24 zeroes @@ -165,6 +165,9 @@ xcode 16b) ( operand -- operand ) xcode 32b) ( operand -- operand ) ax HAL8B i) or, ax HAL16B ^ i) and, ret, +xcode A>) ( operand -- operand ) + ax $18 i) or, ret, \ dst=bx (3<<3) + xcode &) ( operand -- operand ) ax HALDEREF i) or, ret,