Question about initial KBD CR check in monitor

5 posts / 0 new
Last post
anarkavre's picture
Offline
Last seen: 9 years 3 weeks ago
Joined: Oct 18 2005 - 11:28
Posts: 59
Question about initial KBD CR check in monitor

What is bit 8 of KDB CR set to the first time the monitor reaches NEXTCHAR? Is it still set to 1 from where KDB CR was set to A7 and if so what does it read from KBD? According to the Apple 1 manual bit 8 is cleared when you read from KBD, but this is the first time you are reading from KBD. The monitor also calls ECHO to output what it reads from KBD and increments the text index. I would appreciate any clarification on this.

Offline
Last seen: 1 month 2 days ago
Joined: Jun 5 2008 - 07:26
Posts: 475
Re: Question about initial KBD CR check in monitor

Register config is simple
DDRB set to 0x7f for terminal output (the high bit is used for input)
CRA and CRB both set to 0xa7

The MSB (bit Dirol of keyboard input should reflect what is on the keyboard socket, pin 15. The operations manual recommends that this pin be connected to +5V, so it should normally be read as a 1.

Regards,
Mike Willegal

anarkavre's picture
Offline
Last seen: 9 years 3 weeks ago
Joined: Oct 18 2005 - 11:28
Posts: 59
Re: Question about initial KBD CR check in monitor

Thank you Mike for your reply. I understand that, but my question is what is bit 8 of KBD CR when it reaches NEXTCHAR? It is set to 1 when A7 is stored into KBD CR, so is it still 1 or does it get set to 0 at some point before it reaches NEXTCHAR? I'm just confused because in Tom Owad's book he says that bit is not used, but it is clearly a flag set when a key is available to be read from KBD. I hope I made my question more clear.

Offline
Last seen: 1 month 2 days ago
Joined: Jun 5 2008 - 07:26
Posts: 475
Re: Question about initial KBD CR check in monitor

I think you are talking about the MSB of address d011. This is the keyboard stobe indication. Keyboard strobe sets this bit in the register and reading the register clears it. I think it probably comes up as not set, unless there is some kind of transition on the strobe input about the time the PIA is initialized.

Regards,
Mike Willegal

Offline
Last seen: 1 month 2 days ago
Joined: Jun 5 2008 - 07:26
Posts: 475
Re: Question about initial KBD CR check in monitor

I think you are talking about the most significant bit of address d011. This is the keyboard stobe indication, which is set by a low going pulse on the keyboard strobe input, once the PIA is configured. Reading the register clears it. All register bits are reset to zero during a reset event. I think it probably comes up as not set, unless there is some kind of transition on the strobe input around the time the PIA is initialized.

Regards,
Mike Willegal

Log in or register to post comments