Author Topic: ASM-Interpreter DS  (Read 3866 times)

0 Members and 1 Guest are viewing this topic.


  • Newbie
  • *
  • Posts: 10
ASM-Interpreter DS
« on: July 15, 2013, 08:18:08 PM »
My first application submission for Neocompo!

Nickname: GEMISIS
Project Name: ASM-Interpreter DS
From: U.S.A.
Division: APP
Platform: NDS
Original Enter: Yes
Support Motion: No
In a past NEO Compo this project won in the top 10: No

This is an assembly interpreter written in C for the Nintendo DS.
I created this project entirely from scratch as a way for others to
learn to program in a basic assembly language in a portable manner.
Using the top screen of the Nintendo DS/DSi, you can view the
memory and registers of the interpreter live.  Using the right arrow
key, you can go through your program line by line and watch it update,
or you can press the B button to have it perform your full program
without any pauses. I have included some simple test files with
this program.


A for confirmations, B for canceling.

When running a program, press B to run the program all at once, or use the right button on the DPad to go through command by command.

The keyboard can be used to type in filenames, as well as arguments.  Argv is supported as well!

The download link can be found at
For those interested in the source code, it can viewed at
There is a compiled version there and attached here on this post.  Enjoy!  :)

Here are a list of opcodes that can be used:

add reg1, reg2 - Adds 2 registers and stores the results in AC. Example: add r1, r2
sub reg1, reg2 - Subtracts reg2 from reg1 and stores the results in AC. Example: sub r1, r2
mul reg1, reg2 - Multiplies reg1 and reg2 and stores the results in AC. Example: mul r1, r2
div reg1, reg2 - Divides reg1 by reg2 and stores the results in AC. Example: div r1, r2
mod reg1, reg2 - Performs the modulus function on reg1 with reg2 and stores the results in AC. Example: mod r1, r2
store mem1, reg1 - Stores reg1 in mem1. Example: store m1, r1
load reg1, mem1 - Loads reg1 with mem1. Example: load r1, m1
copy reg1, reg2 - Copies reg1 to reg2. Example: copy r1, r2
jmp label - Jumps to the chosen label. (label needs quotes around it) Example: jmp "labeltitle"
set reg1, val - Sets reg1 with the value val. Example: set r1, 42
jne reg1, label - Jumps to the label if reg1 does not equal AC. (label needs quotes around it) Example: jne r1, "labeltitle"
jeq reg1, label - Jumps to the label if reg1 equals AC. (label needs quotes around it) Example: jeq r1, "labeltitle"
cmp reg1, reg2 - Compares reg1 and reg2 and stores the results in AC. (0 if equal, -1 if reg1 < reg2, and 1 if reg2 > reg1) Example: cmp r1, r2
print reg - Prints the register as an integer value. Example: print r1
printc reg - Prints the register as a character value Example: print r1
getc reg - Gets a character from the keyboard and stores it in the register. Example: getc r1
mov reg1, reg2 - Moves register 2's value to register 1. Example: mov r1, r2
mov reg1, #N - Moves value N to register 1. Example: mov r1, #0xff
labels are defined with a colon at the end (no spaces between). Example: labeltitle:
A # sign can be prefixed to all number values.


Updated July 25th!
-Various bug fixes with things (Keyboard's shift key now works for example!)
-Added a text editor as well!  Now you can create files on the system too! (No editing as of yet though)

Updated August 1st!
-Fixed some more bugs (specifically with scrolling text)
-Added the ability to scrolling through text input (Press up to scroll up and down to scroll down)
-Added a file browser for selecting items!  Press A to select a file/folder and B to cancel!

Updated August 7th!
-Fixed some very nasty bugs with the file browser.  Final tests on hardware are now showing everything resolved!  ~sm-78.gif~.gif

If you have any feature requests, please let me know.  I'm considering adding a drag and drop interface with some simple tutorials for learning basic assembly, so if this interests you, please let me know and I'll do my best to add this on :)
« Last Edit: August 07, 2013, 09:06:30 AM by GEMISIS »
Want to keep up to date on my projects? Follow me on Twitter! @gemisisDev
Want to look at the random open source projects I have? Check them out at my Github!