asm6 by loopy for OSX

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
asm6 by loopy for OSX
by on (#67640)
I recently compiled this for Mac OSX so I could do NESDEV on my laptop. It compiled with no problem with the built in cc compiler in Terminal.

Grab it here if you need it - made my life a lot easier:

http://www.sendspace.com/file/9jpk82

by on (#67672)
Cool, thanks for posting this.

by on (#67673)
I had edited the source code of ASM6 to suppress the many pages and pages of errors you get for one mistake in the code, you want my copy?

by on (#67674)
Dwedit wrote:
I had edited the source code of ASM6 to suppress the many pages and pages of errors you get for one mistake in the code, you want my copy?

Are you seriously that bothered by this? I just fix the first error in the list and go on with my life...

by on (#67676)
Dwedit wrote:
I had edited the source code of ASM6 to suppress the many pages and pages of errors you get for one mistake in the code, you want my copy?

It depends. Does the change involve giving a man head?
Quote:
This filter displays the first count lines or bytes of each of the specified files, or of the standard input if no files are specified. If count is omitted it defaults to 10.

Code:
asm6 game.s game.nes | head

Or does your version actually filter the errors after the first to find only the meaningful ones?

by on (#67677)
tokumaru wrote:
Dwedit wrote:
I had edited the source code of ASM6 to suppress the many pages and pages of errors you get for one mistake in the code, you want my copy?

Are you seriously that bothered by this? I just fix the first error in the list and go on with my life...


That pretty much never was the case when I was using ASM6. The actual error would be buried in a pile of related errors and it wasn't immediately obvious as to which error was the true error. Maybe it was the way I was using it, I don't know.

by on (#67678)
I don't know if it's just coincidence, but in my case the culprit has always been the first error. At least I think it has, because I can't think of a single time I had to look for the "master error"...

by on (#67685)
tokumaru wrote:
I don't know if it's just coincidence, but in my case the culprit has always been the first error. At least I think it has, because I can't think of a single time I had to look for the "master error"...


:)

Now I'm starting to wonder if I was using it "wrong".

Does your style of coding tend to resolve all labels on the first pass? I'm clutching at straws, just wondered if I do too much forward referencing or something like that.

by on (#67686)
My modifications to asm6...
http://www.dwedit.org/files/asm6.c
http://www.dwedit.org/files/asm6.exe

This fixes the bug with negative numbers that generates unnecessary error messages if it makes it to the third pass, then fixes a bug where it generates unnecessary error messages on branch instructions if the branch target is invalid. Those bugs have no impact on code without any errors.

There was another change I was planning to make but never got around to it. The assembler's compliment operator acts as a full 32-bit operation, so instructions like LDA #~NN failed if the equate had most significant bit set, the value was treated as an out-of-range integer and refused to assemble. Anding it with 255 worked as a workaround.

Anyway, the reason ASM6 generates floods of error messages is that ASM6 refuses to emit an instruction that gives an error. Then any label located after the error has its address tested against what it should be, and it displays an error message for any label which does not match, so there's your 1000 error messages right there.

My fixes fix a bug where negative numbers could be misparsed as the - label on a third pass, and forces invalid branches to emit a dummy branch instruction. It still knows there's an error, so it won't silently produce bad code, but now it emits the two bytes so it won't make a flood of Incorrect Address errors.