| |
rupy
Registered: Mar 2020 Posts: 45 |
UXN Instruction Set
What would you miss most from the C64 instructions?
http://move.rupy.se/file/uxn.png |
|
... 1 post hidden. Click here to view all posts.... |
| |
rupy
Registered: Mar 2020 Posts: 45 |
https://100r.co/site/uxn.html |
| |
TWW
Registered: Jul 2009 Posts: 549 |
Index registers? |
| |
chatGPZ
Registered: Dec 2001 Posts: 11499 |
Ah one of these virtual phantasy "consoles"...
Index registers indeed. Also relative addressing seems to be always PC relative - sounds painful. And there seems to be an instruction to push a value to the stack - but none to pop it back? weird. |
| |
tlr
Registered: Sep 2003 Posts: 1803 |
it looks like a stack machine though so it's nothing like a 6502. on the surface it looks very Forth like. |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1423 |
Yeah all of the instructions take their operands from the stack - there are no registers per se. |
| |
rupy
Registered: Mar 2020 Posts: 45 |
So UXN is the JVM of "6502"-level (8/16-bit) instruction sets? |
| |
tlr
Registered: Sep 2003 Posts: 1803 |
more like a 70-80's VM instruction set. Not ideal for actual HW. JVM is newskool.
Not a fan of coding for stack machines myself but the Forth crowd might care for it more I guess. |
| |
rupy
Registered: Mar 2020 Posts: 45 |
I meant JVM is stack based only... 90s is new school compared to 70-80 yes.
So a C compiler will manage registers from 0 and up... now I'm curious about that optimization complexity.
Can you tell C compilers to compile without registers to make it stack only!?
Hm: https://stackoverflow.com/questions/28925253/how-to-insist-a-c-.. |
| |
tlr
Registered: Sep 2003 Posts: 1803 |
Quoting rupyCan you tell C compilers to compile without registers to make it stack only!?
Hm: https://stackoverflow.com/questions/28925253/how-to-insist-a-c-..
That post is not related.
If you are interested in the technology behind compiling C for stack based machines have a look at gcc backend for the ZPU.
here is a start: https://github.com/zylin/zpugcc/tree/master/toolchain/gcc/gcc/c.. |
| |
Bansai
Registered: Feb 2023 Posts: 51 |
Quoting rupySo UXN is the JVM of "6502"-level (8/16-bit) instruction sets? Eric Chahi's game "Another World" might provide some useful lessons learned wisdom regarding the design of such machines:
https://fabiensanglard.net/anotherWorld_code_review/
Regarding compilers, the expression handling portion of a basic shift-reduce parser (e.g., an operator precedence grammar) should be able to decompose arithmetic expressions into a stack-based form quite easily. I couldn't see myself programming a stack-based ISA unless--at least initially--I had a rich set of macros at my disposal, mainly so I could avoid push/pop misalignment mistakes. |
Previous - 1 | 2 - Next |