Fabrizio Stellato
Fabrizio Stellato

Reputation: 1891

Assembly: Append content to label

I'm actually developing with asm one on Amiga (68k processor).

I'm stuck with this issue: how to append values to a label?
For example:

Copperlist:
    DC.w $11
    DC.w $ 12
    Rts
... ; Some code
 Bar:
    DC.w $13

Now I want to to append bar content to Copperlist in order to achieve $11,$12,$13 on Copperlist label address...

Is it possible?

Upvotes: 0

Views: 189

Answers (2)

vogomatix
vogomatix

Reputation: 5041

I'm not sure why you have some program code between the Copperlist and Bar labels. If you want them contiguous in memory, then declare them next to each other, and have your code before or after the data. The RTS and other code in your example seem out of place and even unneeded.

e.g.

Start:
... your code

CopperList: DC.W $11, $12
Bar:        DC.W $13

Upvotes: 1

tofro
tofro

Reputation: 6063

If you want to have two data areas adjacent to each other, you need to put them into your code like so.

  1. Remove the rts at the end of CopperList - it seems unnecessary.
  2. Move the some code between CopperList and Bar to somewhere else, it should run there just as well.

As CopperList doesn't seem to contain code, but rather data, I don't quite understand why you put a rts to the end - Your CPU should never run through this.

Upvotes: 0

Related Questions