Menu

#1413 Monitor shows incorrect values for several registers

v3.5
closed-fixed
gpz
None
Monitor
2021-05-01
2021-01-09
Sparta
No

Vice 3.5 r39522 (GTK3 3.24.24, GLib 2.66.4) 64-bit version (but I think this applies to all other versions of the latest nightly build and the "official" version of 3.5 as well), Windows 10. No peripheries attached.

Start VICE, open monitor. Type m 00 01:

(C:$e5d4) m 00 01

C:0000 00 00 ..
(C:$0002)

Shouldn't the values be $2F and $37?

Start VICE, open monitor. Type m dd00 dd02:

(C:$0002) m dd00 dd02

C:dd00 d7 ff 3f ..?
(C:$dd03)

Shouldn't it be $97 (Clock In=0)? Thanks!

Discussion

  • Roberto Muscedere

    To view $00/$01, use the "R" or register command.

      ADDR A  X  Y  SP 00 01 NV-BDIZC LIN CYC  STOPWATCH
    .;e5d1 00 00 0a f3 2f 37 00100010 053 001    6037981
                       ^^ ^^
    

    As for the other registers, not all bits are readable. To see what is happening exactly inside them, use the IO command:

    (C:$0090) m dd00 dd02
    >C:dd00  d7 ff 3f                                             ..?
    (C:$dd03) io dd00
    CIA2:
    >C:dd00  d7 ff 3f 00  ff ff ff ff  00 00 00 01  00 00 08 08   ..?.............
    
    ICR: 00 CTRLA: 08 CTRLB: 08
    
    ICR write: 00 Timer A IRQ: off Timer B IRQ: off TOD IRQ: off Serial IRQ: off Cassette IRQ: off
    
    Port A:  d7 DDR: 3f
    Port B:  ff DDR: 00
    Timer A: ffff (latched ffff)
    Timer B: ffff (latched ffff)
    TOD Time:  01:00:00.0 (am)
    TOD Alarm: 00:00:00.0 (am)
    
    Synchronous Serial I/O Data Buffer: 00
    
     
  • gpz

    gpz - 2021-01-09

    To view $00/$01, use the "R" or register command.

    to elaborate - the "m" command shows RAM

     
  • Sparta

    Sparta - 2021-01-09

    Thank you for the quick response. So is this a new feature of the "m" command in terms of $00/$01?

    Re: $dd00. The Clock In bit (bit 6 of $dd00) is readable.

    ?PEEK(56576)
    151

    vs.

    ALT+H and then io dd00 or m dd00 dd00

    Thanks again!

     
  • Strobe

    Strobe - 2021-01-11

    to elaborate a little more, the "m" command shows what the current bank is set to and the default bank is ram. So if you do "bank io" the "m" command will then show you the contents of the IO chips at dd00 instead. Note that the CPU $00/$01 port isn't considered IO for reasons someone else can explain :)

     
  • Sparta

    Sparta - 2021-01-11

    Thank you for your response.

    I'd say the default bank is not RAM, because by default (i.e. right after startup), the "m a000 a0ff" command will show BASIC ROM and not the underlying RAM. I think the default bank is cpu(?).

    All I know is whatever the current bank is set to, the "m" command no longer shows the correct values of $00/$01. Pre-3.5 VICE versions showed the correct values with "bank cpu".

    (C:$e5cf) bank rom
    (C:$e5cf) m 00 01
    >C:0000  **00 00**                                                ..
    (C:$0002) bank io
    (C:$0002) m 00 01
    >C:0000  **00 00**                                                ..
    (C:$0002) bank ram
    (C:$0002) m 00 01
    >C:0000  **00 00**                                                ..
    (C:$0002) bank cpu
    (C:$0002) m 00 01
    >C:0000  00 00 
    (C:$0002) r
      ADDR A  X  Y  SP 00 01 NV-BDIZC LIN CYC  STOPWATCH
    .;e5cf 00 00 0a f3 2f 37 00100010 000 002    2555282
    (C:$0002) 
    

    Re: $dd00. The built-in monitor does NOT correctly display the value of the Clock In bit (bit 6).

    Start VICE, type ALT-H, then type:

    (C:$e5d4) a 4000
    .4000  sei
    .4001  lda $dd00
    .4004  jmp $4001
    .4007  
    (C:$4007) g 4000
    (C:$4001) z
    .C:4001  AD 00 DD    LDA $DD00      - **A:97** X:00 Y:0A SP:f3 N.-..I..    5675422
    (C:$4001) io dd00
    CIA2:
    >C:dd00  **d7** ff 3f 00  ff ff ff ff  00 00 00 01  00 00 08 08   ..?.............
    
    ICR: 00 CTRLA: 08 CTRLB: 08
    
    ICR write: 00 Timer A IRQ: off Timer B IRQ: off TOD IRQ: off Serial IRQ: off Cassette IRQ: off
    
    Port A:  **d7** DDR: 3f
    Port B:  ff DDR: 00
    Timer A: ffff (latched ffff)
    Timer B: ffff (latched ffff)
    TOD Time:  01:00:00.0 (am)
    TOD Alarm: 00:00:00.0 (am)
    
    Synchronous Serial I/O Data Buffer: 00
    (C:$dd10) 
    

    Stepping into the code, A=$97 which is the correct value of $dd00, but the "io" command (and "m" as well) still INCORRECTLY shows $d7.

    Thanks again! :)

     

    Last edit: Sparta 2021-01-11
  • gpz

    gpz - 2021-01-11

    The default bank is CPU :)

    I should look at this CIA thing

     
    • Sparta

      Sparta - 2021-01-11

      Aah, thanks, I just realized the default bank, and added it to the above post:

      (C:$0002) bank cpu
      (C:$0002) m 00 01
      >C:0000  00 00 
      
       
    • Strobe

      Strobe - 2021-01-13

      The default bank is CPU :)

      Yes and no :)

      When you start vice the bank is set to cpu (not default), but if you literally set the bank to default with bank default it sets it to ram instead.

      IMO when you start vice the bank should be set to default which should be cpu as that is what most people would expect. At the moment it is not set to default, but it is set to cpu.

      Confusing as..

       
  • Fabrizio Gennari

    Reverting revisions 37497 and 37498 fixes this... however, a comment added in 37497 says

    can NOT use the generic mem_read stuff, because that DOES have side effects, such as (re)triggering checkpoints in the monitor!
    

    I don't know how to reproduce such side effects. Does anyone remember what side effects those were?

     
  • gpz

    gpz - 2021-03-07

    it says right in the comment - set a checkpoint (watch- or breakpoint on load/store) to the respective address

     
  • gpz

    gpz - 2021-04-28

    The issue regarding 0/1 should be fixed in 39963/4. CIA peek issue moved to #1467.

     
  • gpz

    gpz - 2021-05-01

    CIA should also be fixed in r39970 - please test and report back in https://sourceforge.net/p/vice-emu/bugs/1467/

     

Log in to post a comment.

MongoDB Logo MongoDB