On Thu, 27 Jul 2000, Nicolas Welte wrote: > Is someone willing to time out the differences exactly? I'm quite sure > that there will be no sharp values, but HMOS and NMOS chips should be > different enough to use this as an extra method to distinguish HMOS and > NMOS CPUs. Since it is internal to the chip, it should be much more > reliable than the $DE00 method. Here's a short program to do it. You can run it from BASIC and read the results stored in result, lsb and msb. In a few minutes I will try it out (for the first time) on a plastic C128D, then maybe a breadbox C64. The use of bit 7 to do the testing should mean that it applies to the 8502 as well. If result = $00, the port bit returned to zero, and lsb and msb contain the number of iterations of the test loop it took. If result = $80, lsb and msb both contain zero and the bit never returned to zero within 65536 iterations of the loop. The inner loop takes 12 cycles so the maximum time tested is roughly 0.8 seconds. I have rather a lot of C64s to try this on if it works... (sigh!) Richard -- Richard Atkinson Software Engineer Tenison Technology EDA Ltd http://www.tenisontech.com/ start sei ldx #$00 zero counter LSB ldy #$00 zero counter MSB lda $00 data direction register pha store old value ora #$80 bit 7 = output sta $00 lda $01 data register pha store old value ora #$80 bit 7 = one sta $01 lda $00 and #$7f bit 7 = input sta $00 loop lda $01 and #$80 beq exit exit if bit 7 = 0 inx bne loop iny bne loop exit sta result $00 if bit returned to zero, $80 if not stx lsb sty msb pla retrieve old data register value sta $01 pla retrieve old data direction register value sta $00 cli rts - This message was sent through the cbm-hackers mailing list. To unsubscribe: echo unsubscribe | mail cbm-hackers-request@dot.tcm.hut.fi.
Archive generated by hypermail 2.1.1.