BYTE assembler directive

You need an actual VIC.

Moderator: Moderators

Post Reply
ajordison
Vic 20 Enthusiast
Posts: 179
Joined: Fri Mar 19, 2010 4:31 pm
Website: http://www.ajordison.co.uk/
Location: Hartlepool, UK
Occupation: Software Engineer

BYTE assembler directive

Post 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.
wimoos
Vic 20 Afficionado
Posts: 345
Joined: Tue Apr 14, 2009 8:15 am
Website: http://wimbasic.webs.com
Location: Netherlands
Occupation: farmer

Post 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.
VICE; selfwritten 65asmgen; tasm; maintainer of WimBasic
User avatar
Kweepa
Vic 20 Scientist
Posts: 1314
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Post 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 #.
ajordison
Vic 20 Enthusiast
Posts: 179
Joined: Fri Mar 19, 2010 4:31 pm
Website: http://www.ajordison.co.uk/
Location: Hartlepool, UK
Occupation: Software Engineer

Post by ajordison »

Thanks guys, I thought it looked wrong. Plus you've saved me from having to change my assembler!

Cheers.
Post Reply