GP32 Assembler Instructions


Joined
Jan 16, 2004
Messages
297
Location
hell
Website
diab0l.pdroms.de
i would like to hack around with some assembler, but i don't know what all the instuctions mean :<
so, i guess someone has made a list what which instruction does,
ie
Code:
...
mov r0, r1 - moves r0 to r1
mul r0,r1,r2 - multiply r1 and r2 and store in r0 (dunno wether this is right :P)
...
but i couldn't find such a list, so *help* ^^
 
You might want to check out the following if you're interested in learning ARM assembler:

ADS Assembler Guide (3rd one down)

ARM Assembly Language Programming (good guide to assembler)

ARM Instruction Set quick reference (very useful)

The ARM website may have other docs that could be useful as well:

http://www.arm.com/documentation/

There is also a 13MB ARM architecture pdf that is very useful, but I can't find where it is on ARM's website atm - [edit] http://www.arm.com/documentation/books.html seems it's a book but is available as a pdf.
 
Im also interested in assembler so thanks for the links :)

Also, mithris, are you still working on your rally thingie? I thought it was pretty good. B)
 
I was wanting to learn ARM assembler as well. :D For some reason, it appeals to me more than C..... I'm not sure why, maybe it's the structure organization or something.....
 
jmetal88 posted on Sep 19 2004 at 03:43 PM said:
I was wanting to learn ARM assembler as well. :D For some reason, it appeals to me more than C..... I'm not sure why, maybe it's the structure organization or something.....

Well, making a whole program in asm is a very hard task !

Including asm into a c project is also tricky, there are some rules to respect. I can help with that if someone's in trouble.
 
Last edited by a moderator:
ksmiler: Not working directly on it, been working on the 3D engine lately, so in the end it will benefit the rally thingie..

---
mithris
 
About testing for a keypress:

I found this statement on a GP32 devving website:

A=GPB14[pin19], B=GPB13[pin18], Start=EINT6/GPE6[pin125], Select=EINT7/GPE7[pin126], L=GPB12[pin17], R=GPB15[pin20], Up=GPB11[pin16], Down=GPB9[pin14], Left=GPB8[pin13], Right=GPB10[pin15]
When read, the values will be 0 when pressed & 1 when released.

Does that mean if I wanted to test for a press of the "A" button I would type something like:

Code:
TEQ  GPB14, #0
{instruction} EQ  {stuff here}

into my code?

I'm probably way off, and admit that I don't really know exactly what I'm talking about, but that's why I'm asking. I'm not really even sure I got the "0" right, since the PDFs mention something about 8-bit rotation, which I can't really be sure about until I know more about it. I have worked with assembly code before, but it was ION assembly for the TI-83 plus, and it just used a command called "getkey" to take input, so I don't really have any experience in this area of assembly language. So yeah, I'll appriciate any help you can offer.
 
The way to do it in C.
#define rPBDAT (*(volatile unsigned *)0x1560000c)

if ( 0 == ( rPBDAT & (1 << 14 ) ) ) {
// Do whatever.
}

in assembler, you would do smth like

Code:
asm volatile(" mov r0, =0x1560000c \n"
" ldr r1, [r0] \n"
" tst r1, #(1 << 14) \n"
" beq ButtonNotPressed \n"
" @ Do whatever \n"
"ButtonNotPressed%=: \n":::"r0", "r1");

The instruction "mov r0, =0x1560000c" does not really exist, instead it will be translated into something like "ldr r0, [pc, <xx>]" that is because the instruction size is fixed to 32bit, and because of that you can't load immediates that does not fit into a shifter operand
Ofcourse you could ORR together several shifter operand to get the number you want.
You should look that up in the ARM ARM.
 
Hi, I'm writing 100% assembly GP32 programs, but I can't initialize LCD video buffer. I've heard that there's swi calls for it. However, don't know the way to code them.

There's another features that must be initialized? Remember that it's 100% pure assembly. An assembly programming forum should be created. Thank you.
 
Back
Top