Page 4 of 4

Re: Looking for Baum's tiny assembler on Apple-1

Posted: Fri Feb 28, 2020 5:44 am
by cjs
Chromatix wrote:
The [Apple 1] keyboard and display hardware are both interfaced to the CPU bus through a 6820 PIA...
The Apple 1 display is a little weird in that it is essentially a glass TTY; as far as I know it supports only a 6-bit version of ASCII plus carriage-return.
Right; the one control character is CR, which fills spaces to the end of the current line and, if that was the last line on the screen scrolls the screen up a line, filling new the line with spaces. The cursor is then left at the start of the new line.

I have a few more details in the Video section of my Apple 1 documentation, along with a link to a video of a real Apple 1 that confirms the behaviour, and links to a couple of emulators that are consistent with that (and one that is not). As documented there, the character output translation is:

Code: Select all

$00-$1F  Print nothing (excepting $0D)
    $0D  (CR) Moves to the beginning of the next line.
$20-$5F  (space through underbar) prints given char
$60-$7F  (lower-case etc.) prints same as $40-$5F
         ($7F is not treated as a control character)
I have also documented the character ROM details, with links to the data sheet and ROM dumps, and notes on how the dumps differ from the actual ROM contents.

I ended up documenting this carefully because tebl's RC6502-Apple-1-Replica, which uses an Arduino Nano to emulate the keyboard and display over a serial line, doesn't properly emulate the real behaviour.

________________________________
mvk wrote:
Atari 2600 programmers had it easy with their TIA chip. It took care of an entire scan line while their software could do something else.
Well, my understanding is that it's not quite that simple. You have to make sure you're ready to update the TIA registers during the horizontal retrace interval between the end of displaying the current scan line and the start of display of the next, which usually means you're going to trigger the "wait for end of scanline" function at some point before the end and can do nothing during that time. And many games (such as Space Invaders) spent their time during the scan line changing the TIA registers to get more "players" on the screen.

But sure, still easier and more flexible than having to program the CPU to clock the bits out yourself. I look forward to your redesign of the Gigatron to be as advanced as the Atari 2600, albeit more than 40 years late. :-)

Re: Looking for Baum's tiny assembler on Apple-1

Posted: Fri Feb 28, 2020 11:50 pm
by mvk
cjs wrote:
As documented there, the character output translation is:

Code: Select all

$00-$1F  Print nothing (excepting $0D)
    $0D  (CR) Moves to the beginning of the next line.
$20-$5F  (space through underbar) prints given char
$60-$7F  (lower-case etc.) prints same as $40-$5F
         ($7F is not treated as a control character)
I have also documented the character ROM details, with links to the data sheet and ROM dumps, and notes on how the dumps differ from the actual ROM contents.

I ended up documenting this carefully because tebl's RC6502-Apple-1-Replica, which uses an Arduino Nano to emulate the keyboard and display over a serial line, doesn't properly emulate the real behaviour.
I also want to get such details right. I found that this original machine seems to treat a range of chars (presumably 0..$1F) all as CR.

Video: https://youtu.be/4l8i_xOBTPg?t=105
Screenshot 2020-02-29 at 00.47.51.png
It is a bit hard to read, but they're showing a variation of the test program from the Apple-1 User manual (which was broken BTW).

Code: Select all

0000 LDA #0
     TAX
     JSR $FFEF
     INX
     TXA
     JMP $0002

Re: Looking for Baum's tiny assembler on Apple-1

Posted: Sat Feb 29, 2020 6:05 am
by cjs
mvk wrote:
I also want to get such details right. I found that this original machine seems to treat a range of chars (presumably 0..$1F) all as CR.
Fascinating! That's clearly different from the Apple 1 in the video I referenced in my notes: https://youtu.be/wTgyll6IqJY?t=33 .

Fortunately the Apple-1 Operation Manual includes schematics for the board. I won't claim to understand the video circuitry well (or much at all, really :-P) but I do notice that at the right-hand side there is pretty clearly a set of gates that detects a CR ($0D, 0001101) on the character input lines RD1 through RD7. The output of this goes into an OR gate the other input of which is the AND of a couple of flip-flop outputs that I would bet good money is the end-of-line detection.

So I think I'm going to (somewhat tentatively) assume that the Apple 1 in that video you found is broken. The way to confirm this would be to properly confirm the operation described by the schematic and, ideally, confirm that several other real Apple 1s have the "only CR generates a new line" behaviour.

Regarding that test program (which I use myself), what's broken about it? I see that it could certainly JMP $0003 instead of $0002, but that's an optimization that would make no difference in speed anyway, since the limit there is the wait for the video circuitry to be ready for a new character (done in the $FFEF ECHO routine).

Re: Looking for Baum's tiny assembler on Apple-1

Posted: Sat Feb 29, 2020 7:53 am
by mvk
mvk wrote:
they're showing a variation of the test program from the Apple-1 User manual (which was broken BTW).
cjs wrote:
Regarding that test program (which I use myself), what's broken about it?
In the Apple-1 User Manual it jumps back to the clearing of A:
Screenshot 2020-02-29 at 08.51.56.png

Re: Looking for Baum's tiny assembler on Apple-1

Posted: Sat Feb 29, 2020 8:09 am
by Chromatix
Indeed, the penultimate byte should be 42 hex, thereby looping to the JSR.

Re: Looking for Baum's tiny assembler on Apple-1

Posted: Sat Feb 29, 2020 8:40 am
by cjs
mvk wrote:
cjs wrote:
Regarding that test program (which I use myself), what's broken about it?
In the Apple-1 User Manual it jumps back to the clearing of A....
Ah. That must be an older version of the manual. I use this one, which doesn't have that error.

Sheesh, get up to date! It's like you're living in the past or something. :-)

Re: Looking for Baum's tiny assembler on Apple-1

Posted: Sat Feb 29, 2020 9:02 am
by mvk
cjs wrote:
I use this one, which doesn't have that error.
I don't spot any improvement from what I posted.
Screenshot 2020-02-29 at 08.51.56.png

Re: Looking for Baum's tiny assembler on Apple-1

Posted: Sat Feb 29, 2020 9:08 am
by cjs
mvk wrote:
I don't spot any improvement from what I posted.
Ah, we're looking at different programs. The one I was talking about, and the one that is used in both videos linked above, is two pages earlier in the section titled "TEST PROGRAM."
Apple 1 Test Program.png

Re: Looking for Baum's tiny assembler on Apple-1

Posted: Sat Feb 29, 2020 1:53 pm
by mvk
cjs wrote:
Ah, we're looking at different programs. The one I was talking about, and the one that is used in both videos linked above, is two pages earlier in the section titled "TEST PROGRAM."
Ah, I'm learning something new every day. I agree that the 2012 video must be an anomaly. Anyway, the lower case chars in the $60-$7F block are now properly squashed as well:
40R.png
May I soon graduate from this platform and qualify for the Apple ][, or VCS 2600.

Re: Looking for Baum's tiny assembler on Apple-1

Posted: Tue Mar 24, 2020 4:15 pm
by mvk
I added a usage text when starting the mini-assembler with EEER. This makes the program a tiny bit larger than 1K, stretching from $BE5 to $FFF now.

But the good thing is that now there's a second entry point that skips the usage text. This extra help code and text runs from $BE5 to $CA7. The mini-assembler itself from $CA8 to $FFF. Not a single byte got wasted, and we have two really nice entry points: EEER and ... BEER!

Just perfect.
Usage.png

Re: Looking for Baum's tiny assembler on Apple-1

Posted: Tue Mar 24, 2020 11:30 pm
by barrym95838
https://rosettacode.org/wiki/99_Bottles ... 2_Assembly

Code: Select all

0BEE
:A2 63 D0 05 A0 00 20 01 0C A0 21 20 01
:0C CA 10 F3 A2 63 98 48 20 3C 0C 8A F0
:16 A0 AF 38 E9 0A C8 B0 FB 69 3A C0 B0
:F0 06 48 98 20 40 0C 68 A0 29 20 40 0C
:E0 01 D0 01 C8 20 3C 0C 68 C9 20 F0 0B
:48 20 3C 0C 68 A0 20 C9 21 F0 C7 A0 45
:B9 4C 0C C8 48 09 80 29 FF 20 EF FF 68
:10 F1 60 54 41 4B 45 20 4F 4E 45 20 44
:4F 57 4E 20 41 4E 44 20 50 41 53 53 20
:49 54 20 41 52 4F 55 4E 44 2C 8D 4E 4F
:20 4D 4F 52 45 20 42 4F 54 54 4C C5 53
:20 4F 46 20 42 45 45 D2 20 4F 4E 20 54
:48 45 20 57 41 4C CC 2E 8D 47 4F 20 54
:4F 20 54 48 45 20 53 54 4F 52 45 20 41
:4E 44 20 42 55 59 20 53 4F 4D 45 20 4D
:4F 52 45 2C 8D
BEER
[... might not look very tidy in 26 columns though ...]

Re: Looking for Baum's tiny assembler on Apple-1

Posted: Wed May 27, 2020 9:42 pm
by barrym95838
I was shocked and saddened to read this morning of Marcel's untimely passing. Our world just lost a darn good engineer. My condolences to his family and (I'm sure) many friends.

Re: Looking for Baum's tiny assembler on Apple-1

Posted: Thu May 28, 2020 3:25 am
by Dr Jefyll
Marcel van Kervinck, aka mvk, creator of the Gigatron, was a member of this forum its sibling on Anycpu.org. Forum member monsonite posted a thoughtful In Memorium here.

-- Jeff