diff options
author | kdx <kikoodx@paranoici.org> | 2023-04-14 13:38:30 +0200 |
---|---|---|
committer | kdx <kikoodx@paranoici.org> | 2023-04-14 13:41:40 +0200 |
commit | 25e74dfd1f67eaac9ed608d351da992695969c2b (patch) | |
tree | 5c81d6c8601dfca524e47aee36e8bd372b1ba241 | |
parent | 2ba2fa23a5a12f48c222899c71731e83942bd55c (diff) | |
download | orga-25e74dfd1f67eaac9ed608d351da992695969c2b.tar.gz |
helper run script and clamp sample
-rwxr-xr-x | run.sh | 3 | ||||
-rw-r--r-- | samples/clamp.orgaasm | 26 |
2 files changed, 29 insertions, 0 deletions
@@ -0,0 +1,3 @@ +#!/bin/sh +./orgaasm "$1" rom.rom || exit 1 +./orgaemu rom.rom diff --git a/samples/clamp.orgaasm b/samples/clamp.orgaasm new file mode 100644 index 0000000..ecd2824 --- /dev/null +++ b/samples/clamp.orgaasm @@ -0,0 +1,26 @@ + #000f #00f0 #0042 DBG + /clamp DBG POP + #000f #00f0 #0f00 DBG + /clamp DBG POP + #000f #00f0 #0001 DBG + /clamp DBG POP + RET + +@clamp ( min max a -- b ) + /min /max RET + +@min ( a b -- a < b ? a : b ) + OVR OVR LTH + JNZ ,min/morethan + SWP +@min/morethan + POP + RET + +@max ( a b -- a > b ? a : b ) + OVR OVR GTH + JNZ ,max/lessthan + SWP +@max/lessthan + POP + RET |