duskos

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

commit d067dbfcac2c3ed8bf88e23ffd5b452e82a44132
parent 014942e251ad4b732daf8319eee102e2a3140005
Author: Virgil Dupras <hsoft@hardcoded.net>
Date:   Sun,  2 Jul 2023 11:51:03 -0400

hal i386: fix +n, with 16b) and 8B)

Still no luck with my ar/ungz failure...

Diffstat:
Mfs/tests/hal.fs | 16+++++++++++++++-
Mfs/xcomp/i386/kernel.fs | 6++++--
2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/fs/tests/hal.fs b/fs/tests/hal.fs @@ -252,9 +252,9 @@ code test27 ( a b c d -- a+d ) 20 54 12 22 test27 42 #eq +\ [@+] with A>) and m) create foo 42 , 54 , create ptr foo , -\ [@+] with A>) and m) code test28 ( -- n ) ptr m) A>) [@+], dup, A) &) @, @@ -262,4 +262,18 @@ code test28 ( -- n ) test28 42 #eq test28 54 #eq + +\ +n, with 16b) and 8b) +code test29 ( -- 42 $30213 ) + dup, 0 i) @, dup, \ PSP+0=0 + 42 i) @, \ W is not supposed to be affected + $30000 PSP) +n, + 1 PSP) +n, + $200 PSP) 16b) +n, + 1 PSP) 16b) +n, + $10 PSP) 8b) +n, + 1 PSP) 8b) +n, + exit, + +test29 42 #eq $30213 #eq testend diff --git a/fs/xcomp/i386/kernel.fs b/fs/xcomp/i386/kernel.fs @@ -347,14 +347,16 @@ xcode !, ( operand -- ) xcode @!, ( operand -- ) \ operand ax xchg, ax $8600 i) or, lblregularwr absjmp, -\ TODO: this is broken with 16b) and 8b) xcode +n, ( n operand -- ) \ operand n i) add, 0 al reg!, si 0 d) 1 i) cmp, forward8 jnz, xnip, ax $fe00 i) or, lblregularwr absjmp, forward! si 0 d) -1 i) cmp, forward8 jnz, xnip, ax $fe08 i) or, lblregularwr absjmp, forward! - ax $8000 i) or, lblregularwr abscall, ( n -- ) + ax $8000 i) or, ax push, lblregularwr abscall, ( n -- ) + dx pop, + dx HAL8B i) test, forward8 jnz, al cwrite, xdrop, ret, forward! + dx HAL16B i) test, forward8 jz, ax wwrite, xdrop, ret, forward! ax dwrite, xdrop, ret, \ Before writing the operand MUL/DIV operation, we check if the operand is