According to this, the (dp,x) addressing mode should only page wrap "When the e flag is 1 and the DL register is $00 (both conditions must be met)." This behavior is supported by the hardware tests below.
The ProcessorTests (as of commit 96c2ca8) does not follow this logic. Take for example test "01 e 3". D=$d873 (DL=$73), X=$dd, and the dp index (operand) is $19. The address should not be wrapped since DL != 0, resulting in a pointer address of $d969. The test case, however page wraps and places the pointer at $d869. From what I can tell, this affects every instruction which allows the (dp,x) addressing mode.
Hardware test results for DL != 0
Test condition: "01 e xx"
Verdict: (dp,x) does not page wrap (resulting value for test in address $102 is $F5)
Source code:
DREG .equ $70f1 ; From the "01 e 4" test case
;; DREG .equ $7000
stack_save .equ $1000
.as
.org 0
lda #0 ; Set the DBR to a known value
pha
plb
.al
rep #$20 ; Save the stack so we can return to MONTIOR
tsc
sta >stack_save
lda #DREG
pha
pld
lda #$0100 ; Address
sta DREG+$24+$fa ; Assuming no bank wrapping
lda #$0101 ; Address
sta {DREG & $ff00} | {{{DREG & $ff}+$24+$fa} & $ff} ; Assuming bank wrapping
.as
sec ; Emulation mode
xce
.as
.xs
;; ENTER EMULATION MODE
;; TEST: "01 e xx"
lda #$a0
sta $100
lda #$0a
sta $101
ldx #$fa
lda #$55
ora ($24,x)
sta $102
tax ; Save return value
;; EXIT EMULATION MODE
clc ; Back to Native mode
xce
.al
rep #$20
lda >stack_save ; Restore stack
tcs
txa ; Get return value
rtl ; MONITOR prints A on return
(dp,x) emulation mode page wrapping
According to this, the (dp,x) addressing mode should only page wrap "When the e flag is 1 and the DL register is $00 (both conditions must be met)." This behavior is supported by the hardware tests below. The ProcessorTests (as of commit 96c2ca8) does not follow this logic. Take for example test "01 e 3". D=$d873 (DL=$73), X=$dd, and the dp index (operand) is $19. The address should not be wrapped since DL != 0, resulting in a pointer address of $d969. The test case, however page wraps and places the pointer at $d869. From what I can tell, this affects every instruction which allows the (dp,x) addressing mode.
Hardware test results for DL != 0
Test condition: "01 e xx" Verdict:
(dp,x)
does not page wrap (resulting value for test in address $102 is $F5)Source code:
Hardware trace:
Hardware test results for DL == 0
Test condition: "01 e xx" Verdict:
(dp,x)
does page wrap (resulting value for test in address $102 is $5f)Source code: <same as above, except that
DREG
is set to$7000
>Hardware trace: