X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;ds=sidebyside;f=math.asm;h=6248da98ab9bdf7b872337ac195d33974f6a670e;hb=6bc4412f0b30989d7e4a4621a0124ada694d448c;hp=3b82bd49ccef3e290bc65a6e324ab17fc576e4a1;hpb=6d4bf76e83379163ae7e027807f79f6cb14a9799;p=rrq%2Frrqforth.git diff --git a/math.asm b/math.asm index 3b82bd4..6248da9 100644 --- a/math.asm +++ b/math.asm @@ -32,6 +32,26 @@ p_abs_end: next + WORD p_max, 'MAX',fasm + ;; ( a b -- c ) + ;; c is the least a and b + pop rax + cmp rax,qword [rsp] + jle p_max_end + mov qword [rsp],rax +p_max_end: + next + + WORD p_min, 'MIN',fasm + ;; ( a b -- c ) + ;; c is the least a and b + pop rax + cmp rax,qword [rsp] + jge p_min_end + mov qword [rsp],rax +p_min_end: + next + WORD p_negate, 'NEGATE',fasm ;; ( n1 -- n2 ) ;; Negate n1, giving its arithmetic inverse n2.