2018-09-28 17:05:11 +00:00
|
|
|
; Copyright 2018 faddenSoft. All Rights Reserved.
|
|
|
|
; See the LICENSE.txt file for distribution terms (Apache 2.0).
|
|
|
|
;
|
Split 2002x-operand-formats test
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.
2020-06-09 00:47:26 +00:00
|
|
|
; Extended tests for 65816.
|
|
|
|
;
|
2018-09-28 17:05:11 +00:00
|
|
|
; Assembler: Merlin 32
|
|
|
|
|
|
|
|
org $1000
|
|
|
|
|
Split 2002x-operand-formats test
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.
2020-06-09 00:47:26 +00:00
|
|
|
; 65816 with long regs
|
2018-09-28 17:05:11 +00:00
|
|
|
clc
|
|
|
|
xce
|
|
|
|
rep #$30
|
|
|
|
mx %00
|
|
|
|
|
Split 2002x-operand-formats test
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.
2020-06-09 00:47:26 +00:00
|
|
|
; hex/dec/sdec/bin
|
|
|
|
lda #$1234
|
|
|
|
lda #$1234
|
|
|
|
lda #$1234
|
|
|
|
lda #$1234
|
|
|
|
|
|
|
|
lda #$fffe
|
|
|
|
lda #$fffe
|
|
|
|
lda #$fffe
|
|
|
|
lda #$fffe
|
|
|
|
|
|
|
|
ldal $fffefd
|
|
|
|
ldal $fffefd
|
|
|
|
ldal $fffefd
|
|
|
|
ldal $fffefd
|
|
|
|
|
|
|
|
; ASCII
|
|
|
|
lda #$0068 ;'h'
|
|
|
|
lda #$00c8 ;"h"
|
2018-09-28 17:05:11 +00:00
|
|
|
lda #$6868
|
|
|
|
|
Split 2002x-operand-formats test
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.
2020-06-09 00:47:26 +00:00
|
|
|
ldal $000068 ;'h'
|
|
|
|
ldal $0000c8 ;"h"
|
2018-09-28 17:05:11 +00:00
|
|
|
|
Split 2002x-operand-formats test
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.
2020-06-09 00:47:26 +00:00
|
|
|
rts
|