Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > UXN Instruction Set
2023-07-24 14:33
rupy

Registered: Mar 2020
Posts: 27
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....
 
2023-07-24 15:45
rupy

Registered: Mar 2020
Posts: 27
https://100r.co/site/uxn.html
2023-07-24 16:00
TWW

Registered: Jul 2009
Posts: 541
Index registers?
2023-07-24 17:27
chatGPZ

Registered: Dec 2001
Posts: 11127
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.
2023-07-24 20:22
tlr

Registered: Sep 2003
Posts: 1717
it looks like a stack machine though so it's nothing like a 6502. on the surface it looks very Forth like.
2023-07-25 06:27
ChristopherJam

Registered: Aug 2004
Posts: 1380
Yeah all of the instructions take their operands from the stack - there are no registers per se.
2023-07-25 10:25
rupy

Registered: Mar 2020
Posts: 27
So UXN is the JVM of "6502"-level (8/16-bit) instruction sets?
2023-07-25 11:13
tlr

Registered: Sep 2003
Posts: 1717
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.
2023-07-25 13:22
rupy

Registered: Mar 2020
Posts: 27
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-..
2023-07-25 21:31
tlr

Registered: Sep 2003
Posts: 1717
Quoting rupy
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-..

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..
2023-07-26 00:39
Bansai

Registered: Feb 2023
Posts: 34
Quoting rupy
So 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
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Jetboy/Elysium
iceout/Avatar/HF
JEZ
CA$H/TRiAD
Freestyle/Illusion
MightyAxle
cobbpg
Durandal
Herrera64
aeeben
Guests online: 124
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (9.5)
8 Quadrants  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Fullscreen Graphicians
1 Carrion  (9.8)
2 Joe  (9.8)
3 Duce  (9.8)
4 Mirage  (9.7)
5 Facet  (9.7)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.053 sec.