Resource icon

ASM-Interpreter DS 1.0

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.

Controls:

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 https://github.com/gemisis/ASM-Interpreter/raw/master/ASM-Interpreter-DS/ASM-Interpreter%20DS.rar
For those interested in the source code, it can viewed at https://github.com/gemisis/ASM-Interpreter
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.
General chit-chat
Help Users
  • BigOnYa @ BigOnYa:
    And sometimes Z
  • SylverReZ @ SylverReZ:
    @K3Nv2, MAGA supporters be wearing tin foil hats lol.
    +1
  • Xdqwerty @ Xdqwerty:
    @SylverReZ, whats maga?
  • BigOnYa @ BigOnYa:
    It stands for Maniacs Against General Acceptance
    +1
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, people rejecting general consensus about stuff?
    +1
  • BigOnYa @ BigOnYa:
    Yup, nuh its really just Trump followers
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, im not american so i dont care about trump
    +1
  • Xdqwerty @ Xdqwerty:
    or us elections
  • BigOnYa @ BigOnYa:
    Me niether, us north Koreans don't care
  • Xdqwerty @ Xdqwerty:
    good night
  • BakerMan @ BakerMan:
    i don't care either, even if i'm american
  • BakerMan @ BakerMan:
    truth be told, i agree with psi, i dislike both candidates, but i'd probably vote trump simply because the economy was better during his presidency
    +1
  • AngryCinnabon @ AngryCinnabon:
    Just be careful, if trump ends up winning and using project 2025 America might really change...for the worse.
  • AngryCinnabon @ AngryCinnabon:
    I'm not american and even that sends shivers down my spine.
  • AngryCinnabon @ AngryCinnabon:
    anything that offers trump an opportunity to become an actual dictator
    is bad in my book, i could care less if it wasn't for that...
  • K3Nv2 @ K3Nv2:
    Canada: America's Russia
  • NinStar @ NinStar:
    people are so dramatic that I can't even tell if they are being serious
  • Psionic Roshambo @ Psionic Roshambo:
    Why so serious!
  • Psionic Roshambo @ Psionic Roshambo:
    @BakerMan, yeah that's about the only reason I would vote for Trump over Biden.
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    In my opinion on all other factors they are pretty much the same.
    +1
  • Veho @ Veho:
    Economy was better under Trump, according to Fox News.
    +1
  • Veho @ Veho:
    I don't give a fuck about what happens to America but I would like it if your shit didn't spill out on the rest of the world, thank you.
    +1
  • AncientBoi @ AncientBoi:
    A Far Right news service company
  • AncientBoi @ AncientBoi:
    I give a fuck about what happens to America but I would like it if our shit didn't spill out on the rest of the world, thank you.
    AncientBoi @ AncientBoi: I give a fuck about what happens to America but I would like it if our shit didn't spill out on...