structures in assembly code
Sun Dec 28 04:45:00 GMT 2003

Im trying to port code from on old BSO 68K assembler to the gcc assembler.  I have run into a problem converting the structures.  In BSO you can make as many  structures as you want by starting with a BSO directive of OFFSET len, and by ending it with SECTION.

    OFFSET 0
item_start   equ *
item1        DS.B 20
item2        DS.W 1
item3        DS.L 2
item_end equ *
item_length equ item_end-item_start

item1 would equate to 0, and item2 would equate to 20 and item3 would equate to 22.  So in a real section you could define a data structure and then easily referance the items in the structure
        SECTION .bss
item DS.B item_length

        SECTION .text
   LEA item,A0
   MOVE.W #5,item2(A0)

I have looked at the gas manual and have found .offset and .struct, but I still cant figure out how (if its even possible) to create this type of structure without the assembler or linker complainning. Any help would be greatly appreciated.


New! Unlimited Access from the Netscape Internet Service.
Beta test the new Netscape Internet Service for only $1.00 per month until 3/1/04.
Sign up today at
Act now to get a personalized email address!

Netscape. Just the Net You Need.

More information about the Gcc-help mailing list