General ASM6 Questions
Moderator: Moderators
got it to compile with VC studio.
I wanted to implement the {} syntax allowing multilines, but unfortunately I see that the program operates fundamentally on a line by line basis.. i was able to hack in something in the processfile function so that processline was passed multiple lines but it doesn''t work right at all of course.. the best error i got was "extra characters on line"
i think the best i can hope for now is to see if i can do something with a preprocessor
I wanted to implement the {} syntax allowing multilines, but unfortunately I see that the program operates fundamentally on a line by line basis.. i was able to hack in something in the processfile function so that processline was passed multiple lines but it doesn''t work right at all of course.. the best error i got was "extra characters on line"
i think the best i can hope for now is to see if i can do something with a preprocessor
what is the difference between these two ways of defining variables?
and
it seems like LDA xyz would work the same either way
Code: Select all
xyz = $00
Code: Select all
enum $000
xyz .byte 0
ende
lol ok
so there's no difference at all?
this should work the same way in either case then?
this should work the same way in either case then?
Code: Select all
LDA #>xyz
LDA #<xyz
The second way is just more flexible. It might not make much of a difference if you have few variables, but what if you have dozens of them after xyz and you decide to make xyz a 16-bit variable instead of 8-bit? If you declared the variables the first way, you'll have to manually modify each one in order to make room for the extra byte of xyz. If you did it the second way, you could just change that ".byte 0" to ".byte 0, 0", ".dsb 2", or anything else that reserves 2 bytes, and all the other variables would automatically move 1 byte forward.frantik wrote:what is the difference between these two ways of defining variables?
The second way is THE way to go if you plan on moving your variables around. I do that a lot, because as my programs grow I always feel the need to rearrange the variables in ways that make more sense (grouping similar variables and things like that).
yeah i can see why you would use each one, I just wasn't 100% sure if there was a technical difference. I mostly was asking because I want to set up certain variables in a header file to always be in the same location regardless of the program and it seemed like using = might be better than enum for a handful of variables
is it possible to add a second macro type which allows labels defined inside of macro to be visible?Labels defined inside macros are local (visible only to that macro).
kind of like an advanced multiline EQU?
Code: Select all
replace function @functionName, @x
@functionName:
@x = 1
endreplace
function foo, bar
lda bar
rts
Code: Select all
foo:
bar = 1
lda bar
rts
I just found a bug in ASM6 that's bothering me a lot. If the labels start with the letter "a", I can't use them with instructions such as ASL and LSR (the error is "Extra characters on line").
It's probably because of the alternate syntax where you specify the accumulator as an operand even though it's implied, so the rest of the label's name is seen as "extra characters". This was driving me nuts, because I simply couldn't tell what was wrong with this specific variable.
Loopy, do you think you can fix this? For now I put "0+" before the label, but that's ugly as shit. And even though I could change the variable's name, it sucks that there's a letter we simply can't use as the first character.
It's probably because of the alternate syntax where you specify the accumulator as an operand even though it's implied, so the rest of the label's name is seen as "extra characters". This was driving me nuts, because I simply couldn't tell what was wrong with this specific variable.
Loopy, do you think you can fix this? For now I put "0+" before the label, but that's ugly as shit. And even though I could change the variable's name, it sucks that there's a letter we simply can't use as the first character.
- Hamtaro126
- Posts: 783
- Joined: Thu Jan 19, 2006 5:08 pm
The C(++) source is included in ASM6.ZIP, So anyone can fix it!tokumaru wrote:I just found a bug in ASM6 that's bothering me a lot. If the labels start with the letter "a", I can't use them with instructions such as ASL and LSR (the error is "Extra characters on line").
It's probably because of the alternate syntax where you specify the accumulator as an operand even though it's implied, so the rest of the label's name is seen as "extra characters". This was driving me nuts, because I simply couldn't tell what was wrong with this specific variable.
Loopy, do you think you can fix this? For now I put "0+" before the label, but that's ugly as shit. And even though I could change the variable's name, it sucks that there's a letter we simply can't use as the first character.
If you already know C(++), then you already know how to fix bugs/glitches in ASM6,
AKA SmilyMZX/AtariHacker.
- Hamtaro126
- Posts: 783
- Joined: Thu Jan 19, 2006 5:08 pm
And for a additional command, I would like to see:
like x816 and WLADX. Can you add it in the next version?
Code: Select all
.ASCIITBL
;Letters
"0"..."9" = $00
"A"..."Z" = $0A
;Times symbol
"x" = $29
;Space
$32 = $24
;Copyright
"c" = $df
.end
.org $8000
;Text (Data)
Hello:
.asc "HELLO WORLD"
AKA SmilyMZX/AtariHacker.