gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS homebrew announcements > subleqDS 0.2

#149800 - asiekierka - Fri Jan 25, 2008 2:24 pm

subleqDS


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. (in relative mode it's still -1, but it shouldn't be a problem)

Limitations:
- 512kb of memory (thus, up to 512kb 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.

Changes:
Quote:
0.2:
- removed test code
- fixed a bug or two

0.1:
- first release
- do not use it, or do not even download it


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

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
I WARN YOU, THE SOURCE CODE IS A MESS!
subleqDS 0.2
Source code


Last edited by asiekierka on Sun Jan 27, 2008 12:41 pm; edited 5 times in total

#149834 - Cid2Mizard - Fri Jan 25, 2008 9:22 pm

I don't understand this utility, "subleq" Unknown to the battalion :)
_________________
www.nintendomax.com 100% Hack 0% Warez

#149855 - JLsoft - Sat Jan 26, 2008 12:54 am

http://en.wikipedia.org/wiki/one_instruction_set_computer

#149922 - asiekierka - Sun Jan 27, 2008 12:20 pm

DO NOT USE VERSION 0.1! IT HAS MY TEST CODE LEFT, SO YOU'LL NOT BE ABLE TO RUN YOUR OWN SUBLEQ PROGRAMS! also, i'm changing the file format, so just do not use it please. I will release a new, fixed version soon.

EDIT: 0.2 released, though you need to modify your programs a bit, information in the source code.