• Welcome to SCdev.org. Please log in.

Welcome to the new SCdev forums!

is there a 16 bit assembler compiler for GBA(/DS)-?

Started by mgarrine, August 31, 2006, 02:38:15 PM

Previous topic - Next topic

mgarrine

i wonder if there  is a gba/ds compiler  (with IDE or not) to turn 16 bit assembler code into a working rom...

(i know Devkit power and ham...etc..) but haven't find a small compiler for gba (or ds) ...

thanks

edit:: sorry forgot goldroad- from Rob Ware- gabdev.org


so i ask can i complie with it sikple code like this :

Quoteorg 100h
mov ah,9
mov dx,message
int 21h
mov ax,4C00h
int 21h
message:
db 'mgarrine$'

???

o:)
[size=14]´   º Í!¸ LÍ!mgarrine$[/size]

omaemad

Ehh that looks like x86 assembler not ARM assembly!

Number two is that the gba has no native print supourrt so your string wont be printed, on pc's i think that code uses some built in stuff in the BIOS to output simple text
man fears time but time fears the pyramid"

Payk

^^Right...and at least NDS is 32-bit...so a 16bit assembler is useless (i think)

bitblt

Quote from: "mgarrine"
so i ask can i complie with it sikple code like this :

org 100h
mov ah,9
mov dx,message
int 21h
mov ax,4C00h
int 21h
message:
db 'mgarrine$'

Yes, but you will need much more code than that just to initialize the DS.  It's not as simple as writing an assembly program for DOS. There are no "int 21h" or other DOS/BIOS service calls.

Both HAM and the DevkitPro tool chains come with an ARM/THUMB assembler. You can add *.s files to your projects if you like. If you want to work with 16 bit THUMB code you will need to make sure ARM/THUMB interworking is enabled.

Check out this chapter in "Programming The Nintendo Game Boy Advance by Jonathan S. Harbour".

Chapter 11 : ARM7 Assembly Language Primer
http://www.jharbour.com/gameboy/GBA_11.pdf

And the entire book . . .
http://www.jharbour.com/gameboy/default.aspx

(BTW I will assume you realize the above code is not ARM or THUMB, it's x86)

mgarrine

ok...thanks for your explanation..and for your link.. i should have that book somewhere downloaded some time ago.. but i have to brush up it...


however i was so stupid to not quickly figure out arm9 need of a console...

(just when i saw the intro.asm of goldroad...)

i have been programming for the gba with dragon basic for a while so after i stopped i have not more upgraded my knowledge about ds (devkit) programming doing olny a few visaul basic progs for work matters...


yes, i need to read the book, thank yo bitblt, its always a pleasure to read your useful and saving posts/reply  :wink:

@ omaemad:: Hi !!!  Hope you' re fine and your studiyng career is going well   :D
[size=14]´   º Í!¸ LÍ!mgarrine$[/size]

Payk

Hmhh asm is way cool to know how to use it.
But GNU compilers are that good that you may not gain much by using asm.
So reallyoften used things would be cool to hv it n asm.
But in most cases c++ is a great friend!

bitblt

Quote from: "Payk"Hmhh asm is way cool to know how to use it.
But GNU compilers are that good that you may not gain much by using asm.
So reallyoften used things would be cool to hv it n asm.
But in most cases c++ is a great friend!

I totally agree with you Payk, C++ is a great friend.  There is very little reason to develop an entire application is assembly, unless code space is an issue.  In many cases a C/C++ compiler will generate faster more efficient code.  Assembly is best used sparingly for nested loops and other time critical code sections.

omaemad

yeah, now on the ds the only asm used is used to use the swi opcodes
man fears time but time fears the pyramid"

bitblt

Quote from: "omaemad"yeah, now on the ds the only asm used is used to use the swi opcodes

True, you can't do swi with C/C++.

You also can't write a 32 bit RNG using only five instructions . . .


   @ enter with seed in r5 (32 bits),
   @ r8 (1 bit in r8 lsb), uses r7
   tst    r8,r8,lsr#1         @ top bit into carry
   movs   r7,r5,rrx           @ 33 bit rotate right
   adc    r8,r8,r8            @ carry into lsb of r8
   eor    r7,r7,r5,lsl#12     @ (involved!)
   eor    r5,r7,r7,lsr#20     @ (similarly involved!)
   @ new seed in r5, r8 as before