Live data from Hacker News

A MOS6502 assembler impleme​nted as a Rust macro

play.rust-lang.org

11–20 of 59 posts

Re: A MOS6502 assembler impleme​nted as a Rust macro

#11
post #7

It doesn't support explicit accumulator addressing mode (ASL A, LSR A, ROL A, ROR A), but otherwise quite neat. (from a quick look at it) (also, 0x syntax is quite unusual, but I assume $ couldn't have been implemented for some reason)

You mean as syntax? Because the opcodes seem to be there.

Re: A MOS6502 assembler impleme​nted as a Rust macro

#16
post #7

It doesn't support explicit accumulator addressing mode (ASL A, LSR A, ROL A, ROR A), but otherwise quite neat. (from a quick look at it) (also, 0x syntax is quite unusual, but I assume $ couldn't have been implemented for some reason)

Isn't A the only register those ops can use anyways? Although it's been a while, 25 years...

Re: A MOS6502 assembler impleme​nted as a Rust macro

#17
post #7

It doesn't support explicit accumulator addressing mode (ASL A, LSR A, ROL A, ROR A), but otherwise quite neat. (from a quick look at it) (also, 0x syntax is quite unusual, but I assume $ couldn't have been implemented for some reason)

This seems to be somewhat common - I've used a few assemblers that make you write ASL A as just ASL (and so on).

Benefit (?): you can now have a label called "A".

Re: A MOS6502 assembler impleme​nted as a Rust macro

#20
post #7

It doesn't support explicit accumulator addressing mode (ASL A, LSR A, ROL A, ROR A), but otherwise quite neat. (from a quick look at it) (also, 0x syntax is quite unusual, but I assume $ couldn't have been implemented for some reason)

The accumulator is the only register those work with. It was very common to not specify it.at all. I actually never have in all the 6502 assembly code I've ever written. Wasn't required.
Post reply on HN