Macroassembler by Michal Kowalski, syntacs question
- barrym95838
- Posts: 2056
- Joined: 30 Jun 2013
- Location: Sacramento, CA, USA
Re: Macroassembler by Michal Kowalski, syntacs question
I support the notion that a BRK by itself should assemble to a $00 by itself, and a BRK #$EA should assemble to $00 $EA without complaint ... now I just need to write or modify an assembler to support that behavior, because expecting someone else to do it for me at this late date would be vainly optimistic.
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!
Mike B. (about me) (learning how to github)
Mike B. (about me) (learning how to github)
- BigDumbDinosaur
- Posts: 9426
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Macroassembler by Michal Kowalski, syntacs question
Chromatix wrote:
BigDumbDinosaur wrote:
Chromatix wrote:
It would indeed be logical to assemble "BRK #0" as 00 00, and some assemblers accept that syntax, but that's not what was specified here. This difference from standard assembler behaviour could indeed be considered a bug.
The code given was
Code: Select all
BRK NOP NOPCode: Select all
00 00 EA EACode: Select all
00 EA EA EACode: Select all
00 EA EACode: Select all
BRK #0Code: Select all
00 00x86? We ain't got no x86. We don't NEED no stinking x86!
Re: Macroassembler by Michal Kowalski, syntacs question
You can set the BRK opcode behavior here:
This is what macros are for:
barrym95838 wrote:
I support the notion that a BRK by itself should assemble to a $00 by itself, and a BRK #$EA should assemble to $00 $EA without complaint ... now I just need to write or modify an assembler to support that behavior, because expecting someone else to do it for me at this late date would be vainly optimistic.
Code: Select all
; BRK instruction to assemble with or without signature
; no matter what the assembler thinks it should do
myBRK .macro ...
.db 0
.if %0>0
.db %1
.endif
.endm
; usage example
*=$200
myBRK ; native BRK
myBRK $12 ; BRK with signature byte
.end
6502 sources on GitHub: https://github.com/Klaus2m5
- BitWise
- In Memoriam
- Posts: 996
- Joined: 02 Mar 2004
- Location: Berkshire, UK
- Contact:
Re: Macroassembler by Michal Kowalski, syntacs question
Dev65 generates one byte unless an immediate operand is specified.
Code: Select all
00:00C4' 00 : BRK
00:00C5' 0011 : BRK #$11
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs
Re: Macroassembler by Michal Kowalski, syntacs question
Best of both worlds!