add min/max

This commit is contained in:
~d6 2023-04-10 13:00:32 -04:00
parent 751e1cbb73
commit 3b561a76c6
1 changed files with 6 additions and 0 deletions

View File

@ -174,6 +174,12 @@
@x16-gt ( x* y* -> x<y^ ) x16-cmp #01 EQU JMP2r @x16-gt ( x* y* -> x<y^ ) x16-cmp #01 EQU JMP2r
@x16-gteq ( x* y* -> x<y^ ) x16-cmp [ #ff NEQ ] JMP2r @x16-gteq ( x* y* -> x<y^ ) x16-cmp [ #ff NEQ ] JMP2r
@x16-min ( x* y* -> min[x, y]* )
OVR2 OVR2 x16-lt JMP SWP2 POP2 JMP2r
@x16-max ( x* y* -> max[x, y]* )
OVR2 OVR2 x16-gt JMP SWP2 POP2 JMP2r
@x16-is-whole ( x* -> bool^ ) @x16-is-whole ( x* -> bool^ )
NIP #00 EQU JMP2r NIP #00 EQU JMP2r