~rabbits/uxn

Passing the exit code from/halt

Details
Message ID
<CAKis=aHU-JgqDD+NJ929v=yTRoWJHBYZk4s=ST-wQ7b9JC-j8Q@mail.gmail.com>
DKIM signature
pass
Download raw message
Hello everyone!

Here's a little something that has been asked a few times but never
made it to the codebase until now(thanks d6 for the patch) -- handling
the 0x7f portion of the System/halt port as exit code.

http://wiki.xxiivv.com/site/varvara.html#system

Exit codes communicate whether a program has completed successfully or
not, it's useful for things like assemblers where you might not want
to continue the execution of a build script if the assembly has
failed.

https://shapeshed.com/unix-exit-codes/

If your system supports it, you can make your program return an exit
code, the change doesn't add any extra lines, simply returns
u.dev[0x0f] & 0x7f:

https://git.sr.ht/~rabbits/uxn11/commit/8cf9d55c1c0a053afa4e8ccdabf0896aedadce6f

This means that `#800f DEO` will mean that the program completed successfully.

Enjoy :)
Reply to thread Export thread (mbox)