PDA

View Full Version : subleqDS



wraggster
January 25th, 2008, 22:06
News/release from asiekierka (http://forum.gbadev.org/viewtopic.php?t=14913&sid=62bfa59dd7733ff42df5d8c141a4d258)


Subleq DS is a mod of original subleq.
Subleq consists of just one command "subtract and branch(jump) if negative or zero)
Each subleq command consists of 3 words: a, b and c.
a, b and c are memory addresses.

If b - a is negative or zero, jump to c. Otherwise, go to the next command.
The code IS in the memory, so Subleq DS is self-modyfing.
Special memory addresses are addresses that don't execute subleq; instead, they execute
a command they're made to do. The addresses are put to b.

Command positions:
-1 - outputs a.

Limitations:
- 64kb of memory (thus, up to 64kb of code)
- Speed (fix the source code if you want it faster)

Well, if you think this is slow, I'd like to tell you that it uses 15 vblanks,
because only then you can see the results pretty fast.
If you still think it's slow, check the source.

How to use
1) DLDI patch subleqDS.nds
2) Put it on your flashcart device.
3) Put "test.slq" (a subleq file) in the root of your flashcart device.

Controls:
B - switch between silent mode (only output is shown on the screen) and
debug mode (everything is shown).

FAQ:
Q: Can you implement an (put any real CPU here)?
A: No. I want to do fun things.

Q: Why is it so slow?
A: Go and check the source code.

Q: Can you add (some feature)?
A: Go and implement it yourself, you have source.

Q: This sucks!
A: Do any better from scratch and I'll agree.

Download and Give Feedback Via Comments