X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=math.asm;h=3b82bd49ccef3e290bc65a6e324ab17fc576e4a1;hb=bfb48545dd4310c422007dfc1dc3b9eb2897d125;hp=c678d116d253a36486274e8f8fb4536eae550837;hpb=e41af95c9a45e52a18a363d173456870e505db5f;p=rrq%2Frrqforth.git diff --git a/math.asm b/math.asm index c678d11..3b82bd4 100644 --- a/math.asm +++ b/math.asm @@ -42,7 +42,7 @@ p_abs_end: WORD p_divmod,'/MOD',fasm ;; ( x y -- q r ) - ;; divide signed x/y giving quotient q and reminder r + ;; divide signed x/y giving quotient q and remainder r pop rbx pop rax xor rdx,rdx @@ -51,3 +51,13 @@ p_abs_end: push rdx next + WORD p_div,'/',fasm + ;; ( x y -- q ) + ;; divide signed x/y giving quotient q and discard remainder + pop rbx + pop rax + xor rdx,rdx + idiv rbx + push rax + next +