News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

[SM][ASM]Random ASM questions

Started by A_red_monk_called_Key, March 02, 2013, 02:41:29 AM

Previous topic - Next topic

A_red_monk_called_Key

i'm writing a massive ASM and i want to do this

!NONE, !END = $0000

to save space, but it doesn't work. is there any way to put multiple terms on the same line?

Black Falcon

Quote from: xkas help html
Defines:
xkas uses a pretty powerful define system, which does quite a bit more than a typical define. To start, they are prefixed with !
Syntax to declare a define is as follows, both are identical:
!x = *
!y equ *
You must have a space on both side of the separator, e.g. ' = ', or ' equ '. !x=* will not work. A define can be anything, a label, another define, a math formula, it can include the formatting for the opcode or not, etc. Here are some examples:
!x = $00
lda !x ;lda $00
lda #!x ;lda #$00
!x equ [$00],y
lda !x ;lda [$00],y
!y = $12
!x = !y$34
lda !x ;lda $1234
!phr = "pha : phx : phy"
!phr()
You can end defines with () if you like, it helps to clarify that the define is used as a function, instead of as an argument. But is completely optional. Also, if you need to use spaces within your define, then you must use quotes around the right hand side of the operand, as shown above with !phr.

Guessing from this t'd work if you write
!NONE = $0000
!END = !NONE

So you just need to change !NONE to also change !END.
Also sometimes I'm also using pieces of pre-written code as labels to save space (for instance the obligatory push/pull stuff). VERY useful to keep your file organized!

A_red_monk_called_Key