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.

ASM > MAP directive equivalent in GCC?

#16468 - Chong Li - Tue Feb 17, 2004 2:41 pm

Hello.

I am attempting to port loopy and FluBBa's wonderful PocketNES over to GCC/AS. With the help of regular expression find/replace, I've been able to convert a large number of SDT directives to ones understandable by AS. The one that contiunes to elude me is the MAP directive.

A snippet of code from PocketNES99Src/equates.h:
Code:
 MAP 0,nes_zpage
nes_ram # 0x800
nes_sram # 0x2000
chr_decode # 0x400
oam_buffer1 # 0x200
oam_buffer2 # 0x200
oam_buffer3 # 0x200
yscale_extra # 0x50   @(240-160) extra 80 is for scrolling unscaled sprites
yscale_lookup # 0x100   @sprite Y LUT


*Note: nes_zpage is an alias for r11, specified earlier in the file.

How do I create these symbols to point to offsets of the register nes_zpage? Or does AS have a directive equivalent to MAP that I am not aware of?

Thanks,
Chong Li

#16471 - torne - Tue Feb 17, 2004 4:53 pm

I don't know exactly what MAP does, but from the example code posted it looks awfully like .struct. Read the docs for that? If not, then sorry.

#16474 - poslundc - Tue Feb 17, 2004 5:25 pm

I am unaware of a GAS equivalent to that particular directive (.struct is the closest I know of), but there is a GAS ARM reference available from http://re-eject.gbadev.org/ that might help you find something, or at least help eliminate the possiblity that something exists if you can't find what you're looking for.

Dan.

#16477 - torne - Tue Feb 17, 2004 5:52 pm

'info as' is better information. =)

#16485 - poslundc - Tue Feb 17, 2004 8:40 pm

Really? For me it just brings up a 141-line man page that lists a bunch of command-line switches. :)

Dan.

#16496 - torne - Tue Feb 17, 2004 11:28 pm

poslundc: then you don't have the info docs for binutils installed. Binutils has seriously detailed and extensive info (like most GNU apps)

#16499 - Paul Shirley - Wed Feb 18, 2004 12:48 am

removed

Last edited by Paul Shirley on Sun Mar 28, 2004 9:12 pm; edited 1 time in total

#16572 - Chong Li - Thu Feb 19, 2004 9:54 pm

Thanks for the input guys. It seems the MAP directive just creates a bunch of symbols pointing to memory starting at the address you give it and incrementing after each symbol you pass it. So I just added up all the increments to get some absolute offsets (isn't that an oxymoron).
_________________
Chong Li