Does an original Apple-1 print an H with LDA #$48\nJSR $FFEF?

7 posts / 0 new
Last post
Online
Last seen: 58 min 43 sec ago
Joined: Dec 21 2024 - 04:24
Posts: 4
Does an original Apple-1 print an H with LDA #$48\nJSR $FFEF?

Wozmon sends all characters to $D012 with the bit7 high.

 

Modern replicas and emulators print an 'H' when sending #$48 or #$C8.

 

I want to know if sending #$48 to $D012 in an original Apple-1 also prints 'H'.

 

If you have an original Apple-1, could you run this little program?

0000  A9 48                      LDA #$48

0002  20 EF FF                   JSR $FFEF

0005  A9 C8                      LDA #$C8

0007  20 EF FF                   JSR $FFEF

000A  4C 00 FF                   JMP $FF00

 

How many 'H's does it print?

Online
Last seen: 1 hour 26 min ago
Joined: Sep 21 2017 - 11:10
Posts: 41
My A1 responded...

On mine I get;

 

0000: A9H_\

 

Online
Last seen: 58 min 43 sec ago
Joined: Dec 21 2024 - 04:24
Posts: 4
PROMetheus wrote:On mine I
PROMetheus wrote:

On mine I get;

 

0000: A9H_\

 

Thanks!

Only one 'H' got printed, which means that sending $48 ('H', %01001000) doesn't print an 'H'.

So, it is mandatory to send bit-7 on: $01001000 OR %10000000 = %11001000 ($C8). Sending $C8 prints an 'H'.

 

But, now I have another question, why does it print an '_' before the '\'?

Online
Last seen: 1 hour 1 min ago
Joined: May 4 2021 - 06:35
Posts: 183
H_ and HH

Hi,

I believe there's a problem in your program: the official entry point of WOZMON is not $FF00, but $FF1F (GETLINE).

 

In fact, there's a suspicious '_' in the output, which seems completely unrelated.

If you JMP to $FF00, you cause a re-initialization of the PIA and, somehow, this operation break up the printing of the last character that has been sent to it.

(TBH: it's not completely clear to me how this can happen because re-initialization should occur AFTER the printout - probably related to the DA/RDA lines).

 

Anyway, if you modify your code to:

0000  A9 48                      LDA #$48

0002  20 EF FF                   JSR $FFEF

0005  A9 C8                      LDA #$C8

0007  20 EF FF                   JSR $FFEF

000A  4C 1F FF                   JMP $FF1F

 

it will print two 'H's, as it should. (see picture below, taken from a 1:1 Replica).

 

Instead of returning to WOZMON, you can also try to JMP to $000A at the end of the program, to set an infinite loop:

 

000A  4C 0A 00                   JMP $000A

 

and you'll get the two 'H's, too.

 

BR,

Claudio - P-LAB

 

Online
Last seen: 1 hour 26 min ago
Joined: Sep 21 2017 - 11:10
Posts: 41
The underline

Wozmon outputs that when you transfer control to $FF00. 

 

Claudio is right of course. Use the $FF1F re-entry point and it shows "HH". It is interesting that the emulator and the real hardware has different results on the $FF00 re-entry point though.

Online
Last seen: 58 min 43 sec ago
Joined: Dec 21 2024 - 04:24
Posts: 4
Thanks a lot! I understand it

Thanks a lot! I understand it better now. :)

Online
Last seen: 58 min 43 sec ago
Joined: Dec 21 2024 - 04:24
Posts: 4
This is why '_' is printed

From wozmon

 

RESET: CLD ; Clear decimal arithmetic mode.

       CLI ; Disable interrupts.

       LDY #$7F ; Mask for DSP data direction register.

       STY DSP ; Set it up

 

$7F is the ASCII DEL character, and the apple-1 shows an '_'. That explains why with JMP $FF00, when the board is already initialized, it shows an '_'.

Log in or register to post comments