mirror of
https://github.com/fadden/6502bench.git
synced 2024-07-06 00:28:58 +00:00
My original goal was to add a sign-extended decimal format, but that turned out to be awkward. It works for data items and instructions with immediate operands (e.g. "LDA #-1"), but is either wrong or useless for address operands, since most assemblers treat integers as 32-bit values. (LDA -1 is not LDA $FFFF, it's LDA $FFFFFFFF, which is not useful unless your asm is doing an implicit mod.) There's also a bit of variability in how assemblers treat negative values, so I'm shelving the idea for now. I'm keeping the updated tests, which are now split into 6502 / 65816 parts. Also, updated the formatter to output all decimal values as unsigned. Most assemblers were fine with negative values, but 64tass .dword insists on positive. Rather than make the opcode conditional on the value's range, we now just always output unsigned decimal, which all current assemblers accept.
91 lines
2.0 KiB
ArmAsm
91 lines
2.0 KiB
ArmAsm
;Project file was edited to force ASCII formatting for some operands.
|
|
.cpu "6502"
|
|
.enc sg_hiascii
|
|
.cdef $20,$7e,$a0
|
|
.enc sg_ascii
|
|
.cdef $20,$7e,$20
|
|
* = $1000
|
|
lda $01
|
|
lda $0102
|
|
lda $fe
|
|
lda $feff
|
|
lda 1
|
|
lda 258
|
|
lda 254
|
|
lda 65279
|
|
lda 1
|
|
lda 258
|
|
lda 254
|
|
lda 65279
|
|
lda %00000001
|
|
lda %0000000100000010
|
|
lda %11111110
|
|
lda %1111111011111111
|
|
jmp skipdata
|
|
|
|
.byte $01
|
|
.word $0201
|
|
.long $030201
|
|
.dword $04030201
|
|
.byte 1
|
|
.word 513
|
|
.long 197121
|
|
.dword 67305985
|
|
.byte 1
|
|
.word 513
|
|
.long 197121
|
|
.dword 67305985
|
|
.byte %00000001
|
|
.word %0000001000000001
|
|
.long %000000110000001000000001
|
|
.dword %00000100000000110000001000000001
|
|
.byte 255
|
|
.word 65279
|
|
.long 16645887
|
|
.dword 4244504319
|
|
|
|
skipdata lda #'h'
|
|
lda 'h'
|
|
lda @w'h'
|
|
lda #$1f
|
|
lda #' '
|
|
lda #'"'
|
|
lda #$27
|
|
lda #'~'
|
|
lda #$7f
|
|
lda #$80
|
|
lda #$9f
|
|
lda #' ' | $80
|
|
lda #'"' | $80
|
|
lda #$a7
|
|
lda #'~' | $80
|
|
lda #$ff
|
|
jmp L10A4
|
|
|
|
more_ascii .byte 'h'
|
|
.byte $80
|
|
.word $6868
|
|
.byte $80
|
|
.word skipdata
|
|
.long skipdata
|
|
.byte $10,$5d
|
|
.byte <more_ascii
|
|
.byte >more_ascii
|
|
.word more_ascii
|
|
.long more_ascii
|
|
.dword more_ascii
|
|
.byte $10,$81
|
|
.byte '['
|
|
.byte '{'
|
|
.byte '|'
|
|
.byte '}'
|
|
.byte ','
|
|
.byte '[' | $80
|
|
.byte '{' | $80
|
|
.byte '|' | $80
|
|
.byte '}' | $80
|
|
.byte ',' | $80
|
|
|
|
L10A4 rts
|
|
|