Nerdy Nights week 3 to 8 for Asm6
Moderator: Moderators
-
- Posts: 120
- Joined: Sat Apr 12, 2014 12:11 pm
- Location: Gothenburg, Sweden
Nerdy Nights week 3 to 8 for Asm6
About to learn the basics of NES assembler coding? Reading the Nerdy Nights and studying how it all works?
Here is something I took the liberty of making to get away from NESASM3. With permission ofcourse.
Asm 6 will work just as fine, with some minor changes in syntax, and an easier layout.
*I know there are other assemblers out there. Some people still like NESASM3. This is just for helping out a little.
Here is something I took the liberty of making to get away from NESASM3. With permission ofcourse.
Asm 6 will work just as fine, with some minor changes in syntax, and an easier layout.
*I know there are other assemblers out there. Some people still like NESASM3. This is just for helping out a little.
- Attachments
-
- Nerdy NightsASM6.zip
- (64.21 KiB) Downloaded 479 times
I´ve got %01100011 problems but the BITs aint one.
Re: Nerdy Nights week 3 to 8 for Asm6
I think that the main reason for this is that beginner tutorials like Nerdy Nights use NESASM, and after having used that for learning, people don't really have any motivation to switch to anything else. Fact is that NESASM does have a few shortcomings (yes, you can still make decent programs/games with it despite them, but you can't deny that the shortcomings do exist), and now, with your work, people have the option of getting started with a more versatile assembler. Thanks for that.mikaelmoizt wrote:Some people still like NESASM3
Not that ASM6 is perfect, I know it has its own set of shortcomings, but it doesn't impose as much bullshit, doesn't have such a buggy history, is versatile enough to facilitate things like bankswitching and can easily be used to code for other 6502 machines.
Re: Nerdy Nights week 3 to 8 for Asm6
Good job (a fellow Swede to boot)!
But later I learned I need to use NESASM if I'm going to use MCK...
Yes I didn't feel like suddenly switch to another assembler when I had learned to use NESASM, but since I heard of the bugs and stuff I decided it was going to be a good experience, so I did it in the end and never regretted it.tokumaru wrote:I think that the main reason for this is that beginner tutorials like Nerdy Nights use NESASM, and after having used that for learning, people don't really have any motivation to switch to anything else.mikaelmoizt wrote:Some people still like NESASM3
But later I learned I need to use NESASM if I'm going to use MCK...
Re: Nerdy Nights week 3 to 8 for Asm6
Thanks for this. I was going to stick with nesasm3 despite it's different use of []. But I don't think I could put up with adding > to all my zero page variables: too hard to read, type, and without doing that I waste bytes and speed.
I'll look to asm6 or ca65. Whatever is easiest to set up after frequent abscences to it.
I'll look to asm6 or ca65. Whatever is easiest to set up after frequent abscences to it.
-
- Posts: 592
- Joined: Thu Aug 28, 2008 1:17 am
- Contact:
Re: Nerdy Nights week 3 to 8 for Asm6
It's honestly only a minor annoyance because you're not used to it. I personally think it makes things more clear, specially if the address is a label: LDA <local1. It makes it faster for scanning and reading through the source code. It also has the advantage of giving you full control, where as ASM6 forces all addresses of $0000-00ff to ZP. There are cases where you might not want ZP addressing. One could say just use a macro instruction instead (using .db xx xx), but asm6 is lacking in the macro department.tsu wrote:Thanks for this. I was going to stick with nesasm3 despite it's different use of []. But I don't think I could put up with adding > to all my zero page variables: too hard to read, type, and without doing that I waste bytes and speed.
I'll look to asm6 or ca65. Whatever is easiest to set up after frequent abscences to it.
If I were to pick asm6 over nesasm, it be for its other options (data defines and related stuff). Not something as minor as this.
__________________________
http://pcedev.wordpress.com
http://pcedev.wordpress.com
Re: Nerdy Nights week 3 to 8 for Asm6
I'm an ASM6 guy, but I have to admit that the ZP thing is pretty minor, and this is the one thing where NESASM gives you more control than ASM6. Indirection with [] wouldn't bother me as much if there wasn't a well defined standard in use for years in 6502 assembly, which is ().tomaitheous wrote:Not something as minor as this.
The reason I find
EDIT: D'oh! Thanks tepples.
Last edited by tokumaru on Mon Dec 22, 2014 5:15 am, edited 1 time in total.
Re: Nerdy Nights week 3 to 8 for Asm6
Typo?tokumaru wrote:The reason I find ASM6 bad
Most later ASIC mappers also have 8192-byte banks, such as MMC2, MMC3, FME-7, MMC5, and later VRCs. When I saw the 8192-byte bank "feature" of NESASM, I didn't think of the TurboGrafx-16 which is where NESASM's predecessor began; I thought of the MMC3.is because it's a rehashed tool for another platform (meaning that things that are completely irrelevant to the NES were carried over, such as banks starting every 8KB)
In the language of programming language standards, old versions of NESASM failed to "emit a diagnostic" for certain easily detectable incorrect programs. Going forward, might it help to make sure to specify a version number whenever referring to NESASM, in order to rule out problems associated with these defective old versions?and because of its buggy history. [...] Many of these problems were reported fixed in newer versions
Re: Nerdy Nights week 3 to 8 for Asm6
I agree with these things, and is one of the reasons I prefer NESASM (and I like to use macros too). (Also, I have fixed and improved various things in NESASM, so it is better than how it originally worked.)tomaitheous wrote:I personally think it makes things more clear, specially if the address is a label: LDA <local1. It makes it faster for scanning and reading through the source code. It also has the advantage of giving you full control, where as ASM6 forces all addresses of $0000-00ff to ZP. There are cases where you might not want ZP addressing. One could say just use a macro instruction instead (using .db xx xx), but asm6 is lacking in the macro department.
Of course you use the assemblers you like; therefore, it can help that if you do like ASM6 then this Nerdy Nights for ASM6 can help anyone who does.
Well, it is also possible to modify MCK to use whatever assembler you want; it probably isn't way too difficult to do this.Pokun wrote:But later I learned I need to use NESASM if I'm going to use MCK...
(Free Hero Mesh - FOSS puzzle game engine)
-
- Posts: 592
- Joined: Thu Aug 28, 2008 1:17 am
- Contact:
Re: Nerdy Nights week 3 to 8 for Asm6
It's been a long time, but IIRC both NESASM and PCEAS were based on Hudsons assembler for both systems, which is also why it distributed as a pair. I have no idea of the source was taken from that, but a PCE dev kit with NES/PCE assembler stuff (and source IIRC) was floating around in private circles, when this was released. Not sure if that has anything to do with the 8k bank thing or not. Anyway, I'm pretty sure that's where the [] usage came from, and other syntax stuffs.
That aside, if NESASM was as popular as people say, then why didn't the NES community simply fix the issues? Why create a whole new macro assembler? I'm not the most experienced with C/C++, but I was easily able to make changes to nesasm/pceas. The source was easy to follow and understand. This boggles my mind, because there are so many brilliant people in the NES community. Was the source that bad, that starting over was easier?
That aside, if NESASM was as popular as people say, then why didn't the NES community simply fix the issues? Why create a whole new macro assembler? I'm not the most experienced with C/C++, but I was easily able to make changes to nesasm/pceas. The source was easy to follow and understand. This boggles my mind, because there are so many brilliant people in the NES community. Was the source that bad, that starting over was easier?
__________________________
http://pcedev.wordpress.com
http://pcedev.wordpress.com
Re: Nerdy Nights week 3 to 8 for Asm6
Something based on Hudson Soft code may draw takedowns from Konami, the current owner of Hudson Soft. And the architecture of NESASM differs so much from that of an assembler designed for use with a linker that starting ca65 fresh was as easy as if not easier than starting from NESASM. Besides, Ullrich von Bassewitz, the original author of ca65 and ld65, may not have even known about NESASM.
Re: Nerdy Nights week 3 to 8 for Asm6
[quote="tomaitheous"It's honestly only a minor annoyance because you're not used to it. I personally think it makes things more clear, specially if the address is a label: LDA <local1. It makes it faster for scanning and reading through the source code. [/quote]
I was thinking that too. I just didn't want to wear out my pinkies and slow my coding down typing >. I haven't even really tried it yet, but I also saw it the other way arround. I'm pretty sure it would confuse new coders already trying to put $ and #$ in the right place, and that that's why it wasn't mentioned in the nerdy nights. But I think that also means there's some bloated homebrews out there. But that doesn't matter.
As for macros, I haven't seen nesasm3 macros on these forums but have seen other assemblers' macros.
Thanks for the disscusion anyways guys. I'll give nesasm3 another shot probably, and maybe make a vi bind to insert > quickly. But I'll also check out the other assemblers again.
edit. Ironic I forgot an ] on the quote.
I was thinking that too. I just didn't want to wear out my pinkies and slow my coding down typing >. I haven't even really tried it yet, but I also saw it the other way arround. I'm pretty sure it would confuse new coders already trying to put $ and #$ in the right place, and that that's why it wasn't mentioned in the nerdy nights. But I think that also means there's some bloated homebrews out there. But that doesn't matter.
As for macros, I haven't seen nesasm3 macros on these forums but have seen other assemblers' macros.
Thanks for the disscusion anyways guys. I'll give nesasm3 another shot probably, and maybe make a vi bind to insert > quickly. But I'll also check out the other assemblers again.
edit. Ironic I forgot an ] on the quote.
Re: Nerdy Nights week 3 to 8 for Asm6
Me too, but the problem is that this "feature" is forced on you regardless of the mapper you're using, and most homebrewers don't use these mappers.tepples wrote:Most later ASIC mappers also have 8192-byte banks, such as MMC2, MMC3, FME-7, MMC5, and later VRCs. When I saw the 8192-byte bank "feature" of NESASM, I didn't think of the TurboGrafx-16 which is where NESASM's predecessor began; I thought of the MMC3.
Re: Nerdy Nights week 3 to 8 for Asm6
In asm6, can I use db instead of .sdb when enumerating my variables? I wanted to because it's one less letter to type. Asm6' readme for enum has:
foo: db 0
bar: db 0
Can someone explain this to me? Wouldn't bar overwrite foo? And what happens if i give foo 2. My test results in memory viewer aren't shoing me what i hoped they would do, so I figure I don't understand this command.
Edit:
Found my answer in asm6' readme. Dsb 4 is less typing than Db 0,0,0,0 to take four. I was trying to do db 4.
The value to db is probably for asigning values at a more advanced point in the program than just variable assigning at the start.
Also, the readme sais enum supresses assembler. That doesn't mean it will overlook any bad or missing lables etc.? Just making double sure.
P.S. What type of keyswitches does the famicom keyboard use: rubber dome / membrane? Or buckling springs/ etc. ?
foo: db 0
bar: db 0
Can someone explain this to me? Wouldn't bar overwrite foo? And what happens if i give foo 2. My test results in memory viewer aren't shoing me what i hoped they would do, so I figure I don't understand this command.
Edit:
Found my answer in asm6' readme. Dsb 4 is less typing than Db 0,0,0,0 to take four. I was trying to do db 4.
The value to db is probably for asigning values at a more advanced point in the program than just variable assigning at the start.
Also, the readme sais enum supresses assembler. That doesn't mean it will overlook any bad or missing lables etc.? Just making double sure.
P.S. What type of keyswitches does the famicom keyboard use: rubber dome / membrane? Or buckling springs/ etc. ?
Re: Nerdy Nights week 3 to 8 for Asm6
The db directive just inserts one byte into the ROM-file at the current location and fills it with whatever constant value you pass as an argument and then moves to the next byte. For example you can make the ines header with a bunch of db, or you can add constant data, like strings.
About the keyboard, I have never opened my keyboard but check here: http://page.freett.com/familybasic/fami ... stroy.html. Resolution is a bit low though.
It would be weird if it did. But if any labels are not resolved by the end of a pass, it will go another pass until all are resolved.tsu wrote:That doesn't mean it will overlook any bad or missing lables etc.? Just making double sure.
About the keyboard, I have never opened my keyboard but check here: http://page.freett.com/familybasic/fami ... stroy.html. Resolution is a bit low though.
Re: Nerdy Nights week 3 to 8 for Asm6
DB can be used to make a varible too? It seemed to work, but I hope I'm using it right. I want to used it for 1 byte variables:
foo dsb 4 ; for my four byte variable
bar db 0 ; or even just db if a default fill value let's me omit it:
foofoo db ; one byte variable
foo dsb 4 ; for my four byte variable
bar db 0 ; or even just db if a default fill value let's me omit it:
foofoo db ; one byte variable