~vdupras/duskos

b530faba3d8c2dcd532b302f5a58df7c3f3cd542 — Virgil Dupras a month ago a9fde35
asm/i386: fix broken tests

They weren't adapted yet to HAL's register re-allocation.
1 files changed, 26 insertions(+), 25 deletions(-)

M fs/tests/asm/i386.fs
M fs/tests/asm/i386.fs => fs/tests/asm/i386.fs +26 -25
@@ 179,20 179,20 @@ here dl $1234 m) mov, 4 chk
ARCH S" i386" s= not [if] testend \s [then]

code foo1
  si 4 i) sub,
  si 0 d) ax mov,
  ax 42 i) mov,
  bp 4 i) sub,
  bp 0 d) ax mov,
  ret,

foo1 42 #eq

here $1234 , ( a )
code foo2
  bx over m) mov,
  si 4 i) sub,
  si 0 d) bx mov,
  ax over m) mov,
  m) -1 i) test,
  bl setnz,
  bp 4 i) sub,
  bp 0 d) bx mov,
  al setnz,
  ret,

foo2 $1201 #eq


@@ 201,8 201,8 @@ foo2 $1201 #eq
0 value mylabel
code foo3
  ' foo1 abs>rel call,
  ax ' foo1 i) mov,
  ax call,
  bx ' foo1 i) mov,
  bx call,
  forward call, to mylabel
  ret,



@@ 211,12 211,12 @@ code foo3
\ test shr/shl
code foo4
  mylabel forward!
  si 4 i) sub,
  si 0 d) ax mov,
  ax 42 i) mov,
  ax 3 i) shl,
  cl 2 i) mov,
  ax cl shr,
  bp 4 i) sub,
  bp 0 d) ax mov,
  ret,

foo4 84 #eq


@@ 224,56 224,57 @@ foo3 84 #eq 42 #eq 42 #eq

\ test single operands
code foo5
  si 4 i) sub,
  si 0 d) ax mov,
  ax 42 i) mov,
  bx 3 i) mov,
  bx mul,
  ax ax test,
  bl setnz,
  al bl add,
  bp 4 i) sub,
  bp 0 d) ax mov,
  ret,

foo5 127 #eq

\ push/pop
code foo6
  si 4 i) sub,
  si 0 d) ax mov,
  42 i) push,
  dx pop,
  bp 4 i) sub,
  bp 0 d) dx mov,
  ax pop,
  ret,

foo6 42 #eq

\ MOV immediate to r/m
code foo7
  bp 4 i) sub,
  bp 0 d) 42 i) mov,
  si 4 i) sub,
  si 0 d) 42 i) mov,
  ax si 0 d) xchg,
  ret,

foo7 42 #eq

\ ESP+disp
code foo8
  si 4 i) sub,
  si 0 d) ax mov,
  42 i) push,
  ax sp 0 d) mov,
  sp 4 i) add,
  bp 4 i) sub,
  bp 0 d) ax mov,
  ret,

foo8 42 #eq

\ forward jumps
code foo9 ( n -- n )
  bp 0 d) 42 i) cmp,
  ax 42 i) cmp,
  forward8 jnz,
    bp 0 d) inc,
    ax inc,
  forward!
  bp 0 d) 54 i) cmp,
  ax 54 i) cmp,
  forward jnz,
    bp 0 d) inc,
    ax inc,
  forward!
  ret,



@@ 283,8 284,8 @@ code foo9 ( n -- n )

\ the assembler used to mis-assemble ops with imm > $80 but < $100.
code foo10 ( n -- n )
    bp 0 d) $80 i) add,
    ret,
  ax $80 i) add,
  ret,

1 foo10 $81 #eq
testend