WLA DX Assembler question

Building your first 6502-based project? We'll help you get started here.
Post Reply
urbanspr1nter
Posts: 2
Joined: 02 Feb 2017
Location: Boise, ID

WLA DX Assembler question

Post by urbanspr1nter »

Hi all, newbie here ... I've been reading through a few tutorials and have been coming across syntax like this:

Code: Select all

ldx #32*\1+\2
The way I have been interpreting this is that we are loading the decimal value

Code: Select all

32
to the X register. But what does

Code: Select all

*\1 + \2
mean? Specifically what does the

Code: Select all

*
and

Code: Select all

\
signify?
Hah, I'm going to attempt to make a SUPER NINTENDO game!
User avatar
BigDumbDinosaur
Posts: 9426
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: WLA DX Assembler question

Post by BigDumbDinosaur »

urbanspr1nter wrote:
Hi all, newbie here ... I've been reading through a few tutorials and have been coming across syntax like this:

Code: Select all

ldx #32*\1+\2
The way I have been interpreting this is that we are loading the decimal value 32 to the X register. But what does *\1 + \2 mean? Specifically what does the * and \ signify?
Firstly, welcome to our 6502 world.

I'd have to know which assembler is being used to answer your question. Usually, * represents the program counter, but could also mean multiplication (it's context-dependent). The use of \ is something I have not seen before in assembly language.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
whartung
Posts: 1004
Joined: 13 Dec 2003

Re: WLA DX Assembler question

Post by whartung »

Looks like it might be macro arguments to me. Can you post more of the code snippet?

Fromt the math it's like it's shift the first argument 5 bits (i.e. 32), then adding in the second.
urbanspr1nter
Posts: 2
Joined: 02 Feb 2017
Location: Boise, ID

Re: WLA DX Assembler question

Post by urbanspr1nter »

BigDumbDinosaur wrote:
urbanspr1nter wrote:
Hi all, newbie here ... I've been reading through a few tutorials and have been coming across syntax like this:

Code: Select all

ldx #32*\1+\2
The way I have been interpreting this is that we are loading the decimal value 32 to the X register. But what does *\1 + \2 mean? Specifically what does the * and \ signify?
Firstly, welcome to our 6502 world.

I'd have to know which assembler is being used to answer your question. Usually, * represents the program counter, but could also mean multiplication (it's context-dependent). The use of \ is something I have not seen before in assembly language.

Thank you. Actually I think whartung might be right.

I looked over some of the wla documentation and apparently they are macro arguments.

\1 and \2 are the first and second parameters respectively. It looks like it is actually doing what whartung also says... It multiplies the first argument by 32, then adds the second parameter.

I'm just looking over some SNES sample code in terms of loading tile info into VRAM and now it makes more sense. :)
Hah, I'm going to attempt to make a SUPER NINTENDO game!
Post Reply