Menu

#4075 uCsim incorrect STA ZP,X for HuC6280

open
nobody
None
Simulator
5
4 days ago
2026-09-10
No

STA ZP,X
stores the value at 0x0000,X instead of 0x2000,X
According to

Stop at 0x002229: (109) stepped 2 ticks
A= $00   0   +0 .  X= $01   1   +1 .  Y= $0e  14  +14 .  
P= 00000100
   NVTBDIZC
S= 0x21ff 22 cf 32 f6 f0 6c 71 3e ".2..lq>
0x2229    95 00                STA    $0000,X            ; [$0001]=$00
F 0x002229
0> 

Stop at 0x00222b: (109) stepped 4 ticks
A= $00   0   +0 .  X= $01   1   +1 .  Y= $0e  14  +14 .  
P= 00000100
   NVTBDIZC
S= 0x21ff 22 cf 32 f6 f0 6c 71 3e ".2..lq>
0x222b    e8                   INX
F 0x00222b

0> dump /x 0x2000 0x2008
0x2000 70 2c 87 6e 1f 88 cf 0a p,.n....

according to:
http://www.shu.sheldows.com/shu/download/pcedocs/pce_memory.html

The Instructions for accessing the zero-page or the stack will always work on segment F8.

regardless of the MPR1 setting

Discussion

  • Daniel Drotos

    Daniel Drotos - 2026-09-13

    [r16871] Place of ZP is configurable with ZPh variable, on 6280 it's 0x2000 by default. Manual of the 6280 doesn't say that MPR1 is not used for ZP... This revision still uses mapping, but at 0x2000.

     

    Related

    Commit: [r16871]


Log in to post a comment.