This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

Examples: Hello World, moving sprite with D-PAD... in ASM6

Examples: Hello World, moving sprite with D-PAD... in ASM6
by on (#93930)
I'm curious about the lack of tutorials or example source code for ASM6. Most tuts are for NESASM and, from what i heard on the forums, this is not a good assembler.

Do you guys have any good links for someone starting out with NES assembly and ASM6?

ps.: Working on Linux, so, be nice with me! :)

by on (#93931)
NESASM is good, it just old.

Code itself will be the same for any assembler, the difference is mostly in the internal assembler directives. It is generally not a big deal to adapt a source between different assemblers, between NESASM and Asm6, at least (CA65 would give some trouble, though).

by on (#93933)
I'm following Nerdy Nights tutorial. Can i use ASM6? What are the main differences and adjustments i have to make?

by on (#93935)
You can start with NESASM. When you get some basics, you can move to another assembler. You can even continue with NESASM for quite long time, I made two games with it without much troubles. I guess it will start to be problematic with a large scale project.

Some differences are:

- NESASM's local labels are starting with . (dot) while Asm6 local labels starting with @. So .label turns into @label.
- NESASM has LOW and HIGH words to get LSB and MSB of a 16-bit value; Asm6 uses < and > symbols instead. So, lda #LOW(n) turns into lda #<n
- NESASM uses [ ] brackets for relative addressing while Asm6 uses ( ) brackets. So lda [TEMP],y turns into lda (TEMP),y
- Asm6 does not use . before .db, .dw, .byte, .word keywords. Just remove the dot.

There are some other differences, but as you can see, it is not too difficult.

by on (#93939)
- Asm6 does not use . before .db, .dw, .byte, .word keywords. Just remove the dot

I use the dots all the time with asm6 without problems.

by on (#93953)
They are optional. I prefer to use them for consistency and clarity. ASM6 also does not require a colon after labels. ASM6 allows this sort of thing:
;zero page
enum $00
    somevar         dsb 1
    anothervar      dsb 1
    athirdvar       dsb 1
    stillyetanother dsb 1

Any other assembler would complain unless it looked like this:
;zero page
.enum $00
    somevar:         .dsb 1
    anothervar:      .dsb 1
    athirdvar:       .dsb 1
    stillyetanother: .dsb 1

by on (#93968)
ASM6 is petty flexible with the assembler directives... periods, spaces and colons are optional, and it accepts lots of variants of some keywords (e.g. DB, BYTE, DCB and DC.B all do the same thing), which makes it easier to port code from other assemblers.

The difference between NESASM and ASM6 are pretty much the differences between NESASM and ALL other assemblers. NESASM seems to break several established 6502 coding standards for no apparent reason.

Anyway, you can easily follow the NESASM tutorials but use ASM6 instead, just pay attention to the differences that have been mentioned. As a reference for the overall structure of the file, you can use these templates.

If something that was supposed to work in NESASM doesn't in ASM6, just ask us about it and we'll tell you what's wrong.

by on (#94011)
Thanks a lot guys, really. :)