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: 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....
 
2023-07-24 15:45
rupy

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

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

Registered: Dec 2001
Posts: 11507
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: 1807
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: 1423
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: 45
So UXN is the JVM of "6502"-level (8/16-bit) instruction sets?
2023-07-25 11:13
tlr

Registered: Sep 2003
Posts: 1807
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: 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-..
2023-07-25 21:31
tlr

Registered: Sep 2003
Posts: 1807
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: 54
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
Guests online: 251
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.6)
4 Codeboys & Endians  (9.6)
5 Edge of Disgrace  (9.6)
6 Coma Light 13  (9.6)
7 Signal Carnival  (9.6)
8 What Is The Matrix 2  (9.6)
9 Uncensored  (9.6)
10 Comaland 100%  (9.6)
Top onefile Demos
1 Nine  (9.7)
2 Scan and Spin  (9.7)
3 Layers  (9.6)
4 Two 4 One  (9.6)
5 Cubic Dream  (9.6)
6 Party Elk 2  (9.6)
7 Copper Booze  (9.5)
8 Onscreen 5k  (9.5)
9 Libertongo  (9.5)
10 Dawnfall V1.1  (9.5)
Top Groups
1 Artline Designs  (9.4)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Performers  (9.3)
5 Censor Design  (9.3)
Top Diskmag Editors
1 Magic  (10)
2 Jazzcat  (9.5)
3 hedning  (9.2)
4 Elwix  (9.1)
5 Peter  (9.0)

Home - Disclaimer
Copyright © No Name 2001-2025
Page generated in: 0.088 sec.