Login
Back to forumReply to this topicGo to last reply

Posted By

Blacky Stardust
on 2013-01-05
11:46:57
 $00-$01 behavior help needed for accurate emulation

I'm the project leader of the VICE project.

Recently we've been looking into how the unused bits of onboard-I/O ports of the various cpu's used in cbm machines behave.

Our findings for the 6510, 8500 and 8502 are:

- the unused direction registers operate like normal, and actually set the direction of the line.
- when the direction is set to output the unused bits can be set and reset asif they really exist.
- when the direction is set to input the unused bits can actually be set and reset.
- when an unused bit gets set when the direction is set to input the bit will remain set for a certain amount of time and then drop off to 0.

Since this even happens on the 8502 (which we didn't expect), we suspect that the same is true for the 7501 and 8501 as used on the c16/plus4.

To test if this happens the following code can be used:

sei
ldx $00
ldy $01
lda #$00
sta $00 ; set data to input
lda #$ff
sta $01 ; set unused bit(s) to 1
lda $01
@L1:
cmp $01
beq @L1 ; bit will eventually drop off and execution will go past this point
stx $00
sty $01
cli
rts

Could some-1 please try this code on a real c16/plus4 and report back if the code just kept looping or if it got to the rts ??

Thanks in advance for any help.

Signed, Marco van den Heuvel.

Posted By

Spektro
on 2013-01-06
06:31:22
 Re: $00-$01 behavior help needed for accurate emulation

Hi, it loops on Plus/4.

Posted By

Gaia
on 2013-01-06
07:05:31
 Re: $00-$01 behavior help needed for accurate emulation

Hoi Marco! Leuk dat je hier bent wink

I tried your routine and it just kept looping (actually I think I have tested something like this way back already for YAPE). So that makes "our" 7501/8501 an exception I guess?

Posted By

Blacky Stardust
on 2013-01-06
14:20:45
 Re: $00-$01 behavior help needed for accurate emulation

Hoi Attila,

Wat een toeval om iemand 'tegen te komen' die nederlands 'praat' wink

Thank you both for testing this, and yes, it seems the 7501/8501 is the exception where unused bits drop-off is concerned. Now the question is, can the unused bit in $00 be set/reset, can the unused bit in $01 be set/reset in output mode, and can the unused bit in $01 be set/reset in input mode.

To find that out another test is required:

sei
ldx $00
ldy $01
lda #$20
sta $00
lda $00
sta $0c00
lda #$00
sta $00
lda $00
sta $0c01
lda #$20
sta $00
sta $01
lda $01
sta $0c02
lda #$00
sta $01
lda $01
sta $0c03
lda #$00
sta $00
lda #$20
sta $01
lda $01
sta $0c04
lda #$00
sta $01
lda $01
sta $0c05
stx $00
sty $01
cli
rts

The values in $0c00-$0c05 are the ones that show what $00/$01 can do.

Thanks in advance.

Signed, Marco van den Heuvel.

Posted By

Gaia
on 2013-01-06
18:21:02
 Re: $00-$01 behavior help needed for accurate emulation

@@OOOO ($00's and $0F's)

just as expected wink

Posted By

Patrick
on 2013-01-06
18:36:56
 Re: $00-$01 behavior help needed for accurate emulation

marco, ik praat ook nederlands. alleen weet ik niks van ML.
succes ermee..

Posted By

Spektro
on 2013-01-07
04:01:48
 Re: $00-$01 behavior help needed for accurate emulation

Got the same as Gaia: @@OOOO

By the way, in the previous test Plus/4 exited the loop when I connected or disconnected my tape drive while the program was running.

Posted By

Blacky Stardust
on 2013-01-07
15:16:27
 Re: $00-$01 behavior help needed for accurate emulation

Thank you all for helping me clear this issue up.

The result seems to be that on the 7501/8501 the unused direction bit cannot be set at all and is always 0, and the same for the unused data bit.

Now I/we know once and for all and I can check if the emulation is correct.

Signed, Marco van den Heuvel.



Back to topReply to this topic


Copyright © Plus/4 World Team, 2001-2024