# HG changeset patch # User telesto # Date 1682257398 -7200 # Sun Apr 23 15:43:18 2023 +0200 # Node ID ddf9da4d036c7104acc7efb28d301f61334e7855 # Parent 00c2c965de4136092fe682eafa103f7455162258 swap arguments to movi, so it works like mov, diff --git a/asm.fox b/asm.fox --- a/asm.fox +++ b/asm.fox @@ -265,8 +265,8 @@ : shrd, swap ac0f /r ib ; \ todo: if n is imm32, then "MOV r/m64, imm32" - ( n r32/r64 -- ) -: movi, dup b8 +ro regsize cp (,) ; + ( r32/r64 n -- ) +: movi, over b8 +ro swap regsize cp (,) ; ( r1 -- ) diff --git a/mandelbrot-asm.fox b/mandelbrot-asm.fox --- a/mandelbrot-asm.fox +++ b/mandelbrot-asm.fox @@ -94,8 +94,8 @@ : plot x0! y0! \ start with z = x0 + iy0 # x x0 mov, y y0 mov, - ff ecx movi, \ counter=0xff - 4 scale boundary movi, # + ecx ff movi, \ counter + boundary 4 scale movi, # begin # x^2 x mov, x^2 sq diff --git a/mandelbrot-mt.fox b/mandelbrot-mt.fox --- a/mandelbrot-mt.fox +++ b/mandelbrot-mt.fox @@ -65,7 +65,7 @@ ( n -- addr ) : color # max-iter cmpeaxi, # 0if - # black dup eax movi, here 4 - relo,v # ;; + # black eax over movi, here 4 - relo,v # ;; then # f andeaxi, \ todo: displacement "colors" needs sign-extended, not zero-extended relocate @@ -140,7 +140,7 @@ x0! y0! \ start with z = x0 + iy0 0 \ make room for rax used below # x x0 mov, y y0 mov, - max-iter ecx movi, \ counter + ecx max-iter movi, \ counter # begin # rax x mov, sq x^2 rax mov, rax y mov, sq y^2 rax mov, @@ -225,7 +225,7 @@ : setup () setdelta adjustx adjusty alloc-space \ boundary for calculation, is fixed - # 4 scale boundary movi, # ; + # boundary 4 scale movi, # ; ( xt #threads -- ) : spawn-all begin over spawn 1- until drop drop ;