Page 1 of 1

BYTE assembler directive

Posted: Sat Jun 18, 2011 5:54 am
by ajordison
Hi,
A CBM prg Studio user (yes, there are some!) has reported the following as a bug:

MEM1 BYTE $00,00,00
MEM2 BYTE #<MEM1, #>MEM1

The first line assembles but the second one doesn't. Is this really a bug though? I can see why you might want the lo/hi byte of the label, e.g.

MEM2 BYTE <MEM1,>MEM1

but not the immediate value. Do any other assemblers accept this?

Cheers.

Posted: Sat Jun 18, 2011 8:51 am
by wimoos
As the saying goes: "works as designed"

"Immediate" is an addressing mode and only makes sense with CPU instructions, not with assembler directives.

Regards,

Wim.

Posted: Sat Jun 18, 2011 9:59 am
by Kweepa
Yes, I think it would be confusing to allow # in byte directives. In that case, what does the version without the # mean? It dilutes the significance of the #.

Posted: Sat Jun 18, 2011 2:08 pm
by ajordison
Thanks guys, I thought it looked wrong. Plus you've saved me from having to change my assembler!

Cheers.