bss section in asmx

Talk about development tools here

Moderator: BigEvilCorporation

Post Reply
Pascal
Very interested
Posts: 200
Joined: Wed Nov 29, 2006 11:29 am
Location: Belgium
Contact:

bss section in asmx

Post by Pascal » Fri Jun 11, 2010 8:28 am

Hello all,

i'm trying to convert my projects from snasm68k to asmx. Everything go smoothly, my only grip is regarding section (seg op). At the beginning of my code i have:

CPU 68000
seg Vars
org $ff0000 ; ram
seg M68kcode
org $0 ; rom

but when i assemble , the Vars section is assembled as a regular rom section. So it pad my rom to $ff0000 and my rom is more than 16mo :s:s

How can i define a bss section in asmx ???

i define my variables like this:

seg Vars
Game_Vars_Start

Game_State ds.b 1

Game_Vars_End

thanks in advance

edit: i compile using the following command:

"asmx cart.asx -b -e"

WayneK
Newbie
Posts: 7
Joined: Tue Apr 17, 2007 8:58 pm

Post by WayneK » Tue Jun 15, 2010 10:37 pm

In AS (http://john.ccac.rwth-aachen.de:8000/as/index.html) assembler which I use, the segments only seem to work correctly if you put them in order, eg:

section code
org $0
<code>
endsection

section vars
org $ff0000
myvar ds.w 1
myvar2 ds.b 1

etc... this assembles the code section in ROM and doesn't generate code/rom for the vars - it might be possible to avoid asmx creating a rom section for your vars by only reserving space (as if it were a BSS section on another platform), and not defining empty vars (like: myvar dc.w 0) ?

Graz
Very interested
Posts: 81
Joined: Thu Aug 23, 2007 12:36 am
Location: Orlando, FL

Post by Graz » Wed Jun 16, 2010 12:19 am

I've been using GNU binutils (as), built from scratch. It works very well for me. I use custom linker scripts to get the sections in the right place, can use gcc for pre-processed source and the assembler support AT&T and Motorola syntax. I've had no problems with .rodata, .bss or even initialized .data sections (although I need custom startup code to initialize .data). I even have sections for things like code that needs to go in RAM, code thats specifically for the master SH2 or slave SH2, or a special bss for master or slave SH2 on-chip ram (using the split cache). objcopy, objdump and the other binutils utilities are really useful, too. Also, using the same toolset for SH2 development (32X) and 68K is a bonus - it really simplifies Makefiles. binutils also works for Z80, although there's a few bugs.

Post Reply