Return-Path: <mattislind@gmail.com>
Delivered-To: craig@sbc-85.com
Received: from gator4254.hostgator.com
	by gator4254.hostgator.com with LMTP
	id eD6pJ8I0K2RgRwgAcizydQ
	(envelope-from <mattislind@gmail.com>)
	for <craig@sbc-85.com>; Mon, 03 Apr 2023 15:19:14 -0500
Return-path: <mattislind@gmail.com>
Envelope-to: craig@sbc-85.com
Delivery-date: Mon, 03 Apr 2023 15:19:14 -0500
Received: from mail-pj1-f45.google.com ([209.85.216.45]:43856)
	by gator4254.hostgator.com with esmtps  (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
	(Exim 4.95)
	(envelope-from <mattislind@gmail.com>)
	id 1pjQe2-002NHL-2p
	for craig@sbc-85.com;
	Mon, 03 Apr 2023 15:19:14 -0500
Received: by mail-pj1-f45.google.com with SMTP id lr16-20020a17090b4b9000b0023f187954acso31764823pjb.2
        for <craig@sbc-85.com>; Mon, 03 Apr 2023 13:19:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20210112; t=1680553143; x=1683145143;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=HzTR0UxCsgoXnJkocvoNoOTMl236p0hMfjAFqjh1FjQ=;
        b=Ze7oqF6DpMKI7w9XyL9nMtqXxlYbS+hBi3NCCD0RgS34OuyA9b++fdw3qUNemsVBD5
         djCwV6d2FO9b80O633XM9iX6iEfI+7rPTCWsluXTBGmnSKrrBR7YX1wFtayDK++setA4
         V5rWbuxhIWgWGzbKeD6sY51QhhuFYUrJA4s193gdZXtJrXvBf1SurC1h2SpRmGSZ/XiT
         EYmlruacCYn2VgSkS9qL88RFhG2uGbB8UkNkJdQSdw3iygDFT+SV/TXOlPb2uz4iwsPD
         IS/lu57Akju4N4m7DxqRrS9MWF8UXNyievnw6W89A9Bkr0CGqBW+uwJwJy9GqSV+YwjM
         HM3g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20210112; t=1680553143; x=1683145143;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=HzTR0UxCsgoXnJkocvoNoOTMl236p0hMfjAFqjh1FjQ=;
        b=CmJUCbbk+yvD7sOqEi6aNF4GpNR+27AKIW110BbA14iqK5g383t81zqYUmmUm4edaQ
         3jyEEFquQYP8MpTbe0JcIlvmn5YYJQIquv4bX5nhNS2gFbEgvpq+9g5T/n+ZeTQFCdDA
         t85DfFnyyG74W4j8SWw7GvUrehN14m2vT5dqrg1V9n2Y5EzsirugRLnB/kTLqqkSGc5A
         5IT/kV1BDoEBefeZWHh61ey5jIRgcBRS3FfFxuxkVL+cdohkKfrlzp25iWGkfe8S7kTp
         yEj6e+gdVjvyrT6SMkLZCuPfGZNVkuPsTcA7OvCoW48f+tqwoto01j7Rm4u3BFkyo1Eq
         Nz7g==
X-Gm-Message-State: AAQBX9cCBYNFoguqTpp7RPfT+6SOjDVgEOywaJh1qKIFPWmO0DSMnioe
	3CjAfqBObpDe7Ug3/YlW6RK/jj2r+cKBlTItIHsDW/3Yx54=
X-Google-Smtp-Source: AKy350aOxzvP8wbIab08VeLt8LvY5C4o89PQK+PyAfHsUQw30XziAqhgbDnVa05SbUYQuBqPzMI7XlTmp+/NwOSlLk4=
X-Received: by 2002:a17:902:c111:b0:1a0:5057:1b77 with SMTP id
 17-20020a170902c11100b001a050571b77mr91474pli.10.1680553142547; Mon, 03 Apr
 2023 13:19:02 -0700 (PDT)
MIME-Version: 1.0
References: <CABr82SLAMOUwp+3KkiGbuLLAmzjVVkCZiXc_L358cuRzb=SXJg@mail.gmail.com>
 <002301d96665$7d4627a0$77d276e0$@sbc-85.com>
In-Reply-To: <002301d96665$7d4627a0$77d276e0$@sbc-85.com>
From: Mattis Lind <mattislind@gmail.com>
Date: Mon, 3 Apr 2023 22:18:51 +0200
Message-ID: <CABr82S+1+sugHBL-LAeJK6CaA_0to=c8GShP7xPGtxxGBy6TdA@mail.gmail.com>
Subject: Re: Intellec 8/80 reading paper tapes?
To: craig@sbc-85.com
Cc: Sid Jones <jonesthechip@logicmagic.co.uk>, Jon Hales <jonhales@gmail.com>
Content-Type: multipart/alternative; boundary="0000000000001677ce05f874453d"
X-Spam-Status: No, score=-0.2
X-Spam-Score: -1
X-Spam-Bar: /
X-Spam-Flag: NO

--0000000000001677ce05f874453d
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hello Craig!

This is the actual monitor that came with my system. Disassembled by Bill
Beech. The full disassembly can be found here:

https://www.retrotechnology.com/restore/mon80_v4.asm

I double checked the instruction opcodes while single stepping through and
it matches just fine so I think the disassembly is faithful to the
original.

Actually BS/HT are not characters since it goes into the control register
at IO address 1. I have no idea why bit 3 is set since there is nothing on
the IO board that is using that particular bit. 01h should have been
sufficient.

Writing a 0 to bit 0 in the control register will reset the reader run
signal and writing a 1 to bit 0 of the control register will set the reader
run signal.
I fully agree that there should have been an IN TTYS just before the ANI.
Then I would have understood everything. Now there is none.

The Data Available signal in the status register is actually the inverted
sense since the Intel 8234 has inverting outputs meaning that bit 0 of the
status register has 0 if there is data available and 1 if there is no data
available.

My only explanation is that in fact the status register is read into the A
register by the OUT instruction, then anded with 01h and subsequently acted
upon when the JZ is executed. Since we in fact have data in the UART
register the DA status bit will read 0 and the jump will be taken.

But it should not be possible if the OUT only do OUT and nothing else, or?

Perhaps someone can do an experiment on some other hardware to see what is
going on?

/Mattis


Den m=C3=A5n 3 apr. 2023 kl 21:50 skrev <craig@sbc-85.com>:

> Hi Mattis,
>
>
>
> I must have fallen asleep in class and just woke up when the teacher
> called me=E2=80=A6. where did this code come from?
>
>
>
> I have not taken a careful look, really just looked at your comments and
> confusion set in right when I got to RI0 where you point out that moving
> the BS character into A and then ANI with 0x01 makes absolutely no sense.
> How much confidence do we have in this code? is there an original list fi=
le
> for this code?   If this is code that was read from a ROM and not actuall=
y
> tested, is it a misread or bit rot?
>
>
>
> to answer your question, the OUT instruction leaves register A unchanged
> and affects no flags.
>
>
>
> looking at the code, everything in the RI: and RI0: makes sense at first
> blush.  if I had to accuse something, I would say there is a missing IN
> TTYS instruction before the ANI 01H.  is that possible?
>
>
>
> regards
>
> craig
>
>
>
>
>
>
>
> *From:* Mattis Lind <mattislind@gmail.com>
> *Sent:* Monday, April 3, 2023 11:05 AM
> *To:* SBC-85 <craig@sbc-85.com>; Sid Jones <jonesthechip@logicmagic.co.uk=
>;
> Jon Hales <jonhales@gmail.com>
> *Subject:* Intellec 8/80 reading paper tapes?
>
>
>
> Hello!
>
>
>
> It has been a while. I got side tracked with another project. A guy
> donated a SWTPC 6809 machine with a terminal and floppy drives. Nice litt=
le
> system, but not working yet and very dusty when I received it so it
> required some attention.
>
>
>
> After I got the Intellec 8 running I designed a small current-loop
> interface for it and thought a paper tape simulator would be a good idea.
> An STM32 controller with a small SD card would allow me to have a bunch o=
f
> images to select from. As soon as the Intellec 8 asserts the reader run
> signal a menu would be printed on the terminal connected to the paper tap=
e
> emulator showing what files there are on the SD card so you could select
> one for downloading into the Intellec 8.
>
>
>
> Until here everything works fine. But when the reading process starts,  i=
t
> stops after 20 characters. I did a try to single step through the code
> while receiving characters and then it worked much better. I wasn't able =
to
> finish the entire file, but it got well past 20 characters of input until=
 I
> got too tired of pressing the STEP switch repeatedly.
>
>
>
> So what could cause this? This all sounds like some kind of timing
> problem. But I wanted to be sure before re-designing the software.
>
>
>
> I now single stepped through the code while keeping track of it in the
> assembly listing I had of the monitor running.
>
>
>
> This is the section which is pulsing the Reader Run and reading one byte:
>
>
>
> RI:   PUSH H        ;3EB7-E5          <-- ENTRY
>       LXI H,IOBYTE  ;3EB8-21 03 00
>       MOV A,M       ;3EBB-7E
>       ANI 00CH      ;3EBC-E6 0C
>       JNZ RI3       ;3EBE-C2 E4 3E
>       MVI A,HT      ;3EC1-3E 09
>       OUT TTYS      ;3EC3-D3 01      <-- CLEAR READER RUN
>
> RI0:  MVI A,BS      ;3EC5-3E 08
>       OUT TTYS      ;3EC7-D3 01      <-- SET READER RUN
>       MVI H,0FFH    ;3EC9-26 FF
>       ANI 001H      ;3ECB-E6 01      <-- AND A with 01h But isn't A just
> 08h?
>       JZ RI2        ;3ECD-CA DE 3E   <-- Jump on 0. Always take this?
>       CALL DELAY    ;3ED0-CD 37 3D   <-- When do we get here?
>       CALL DELAY    ;3ED3-CD 37 3D
>       DCR H         ;3ED6-25
>       JNZ RI0       ;3ED7-C2 C5 3E   <-- It makes no sense looping if we
> aren't reading some condition!
>
> RI1:  XRA A         ;3EDA-AF
>       STC           ;3EDB-37
>       POP H         ;3EDC-E1
>       RET           ;3EDD-C9
>
> RI2:  IN TTYD       ;3EDE-DB 00      <-- Get here then and read data
>       CMA           ;3EE0-2F
>       ORA A         ;3EE1-B7
>       POP H         ;3EE2-E1
>       RET           ;3EE3-C9         <-- Return to caller.
>
>
>
> The routine above is called from this small routine:
>
>
>
> RIX:  CALL RI       ;3F12-CD B7 3E
>       JC   LER      ;3F15-DA 67 3C  <-- If carry we bail out to 3C67h
>       ANI  07FH     ;3F18-E6 7F
>
>       RET           ;3F1A-C9
>
>
>
>
>
> The code at 3C67 simply prints a '*' and jumps to the START of the monito=
r
> which prints a CRLF and a '.' then it is the command interpreter again.
>
>
>
> The IO board has two addresses. 0 and 1
>
>
>
> 0 is the data buffer
>
> 1 is the control / status register.
>
>
>
> Status register has bits allocated as follows:
>
>
>
> 0   DA - DataAvailable
>
> 1   OR - OverRun
>
> 2   TBMT - TransmitterBuffereMpTy
>
> 3   FE   - FramingError
>
> 4   PE   - ParityError
>
>
>
> Control register has one single bit used:
>
>
>
> 0   Reader Run
>
>
>
> I am not an 8080 assembly specialist. I think I can read it decently but
> the code above puzzles me a bit and I think it has to do with why it
> doesn't work.
>
>
>
> So I ask you 8080 experts out there if you could give some help
> understanding what is happening!
>
>
>
> BTW. The full disassembly is here:
> https://www.retrotechnology.com/restore/mon80_v4.asm
>
> I sent the ROMs and Bill Beech ran it through his disassembler.
>
>
>
> There is a delay routine that loops 256 times through two delay routines
> to give some delay but since we are single stepping we never get into tha=
t
> one I guess. But how can the A register have anything other than 08h in i=
t
> after the OUT  instruction?
>
>
>
> Unless of course the OUT instruction does an implicit input into the A
> register after the OUT??
>
> Then it would read the DA flag and it makes much more sense.
>
>
>
> But I have not seen any 8080 manual stating that the OUT instruction also
> does an IN implicitly.
>
>
>
> What am I missing? How should I interpret the assembly code?
>
>
>
> If it indeed turns out that the STM32 is slow at times, it is indeed
> looping through quite some code when polling the reader run bit and also
> reads stuff off the SD-card, then I will probably enable hardware handsha=
ke
> on the UART and hopefully it will solve it. But understanding if this is
> the root cause or not would be helpful.
>
>
>
> Any input would be very helpful!
>
>
>
> Thanks!
>
>
>
> /Mattis
>
>
>
>
>

--0000000000001677ce05f874453d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hello Craig!<div><br></div><div>This is the actual=C2=A0mo=
nitor that came with my system. Disassembled=C2=A0by Bill Beech. The full d=
isassembly=C2=A0can be found here:</div><div><br></div><div><a href=3D"http=
s://www.retrotechnology.com/restore/mon80_v4.asm" target=3D"_blank">https:/=
/www.retrotechnology.com/restore/mon80_v4.asm</a><br></div><div><br></div><=
div>I double checked the instruction opcodes while single stepping through =
and it matches just fine so I think the disassembly is faithful to the orig=
inal.=C2=A0</div><div><br></div><div>Actually BS/HT are not characters sinc=
e it goes into the control register at IO address 1. I have=C2=A0no idea wh=
y bit 3 is set since there is nothing on the IO board that is using that pa=
rticular=C2=A0bit. 01h should have been sufficient.</div><div><br></div><di=
v>Writing a 0 to bit 0 in the control register=C2=A0will reset the reader r=
un signal and writing a 1 to bit 0 of the control register will set the rea=
der run signal.=C2=A0</div><div>I fully agree that there should have been a=
n IN TTYS just before the ANI. Then I would have understood everything. Now=
 there is none.</div><div><br></div><div>The Data Available signal in the s=
tatus register is actually=C2=A0the inverted sense since the Intel 8234 has=
 inverting outputs meaning that bit 0 of the status register has 0 if there=
 is data available and 1 if there is no data available.=C2=A0</div><div><br=
></div><div>My only explanation is that in fact the status register is read=
 into the A register by the OUT instruction, then anded=C2=A0with 01h and s=
ubsequently acted upon when the JZ is executed. Since we in fact have data =
in the UART register the DA status bit will read 0 and the jump will be tak=
en.</div><div><br></div><div>But it should not be possible if the OUT only =
do OUT and nothing else, or?</div><div><br></div><div>Perhaps someone can d=
o an experiment on some other hardware to see what is going on?</div><div><=
br></div><div>/Mattis</div><div><br></div></div><br><div class=3D"gmail_quo=
te"><div dir=3D"ltr" class=3D"gmail_attr">Den m=C3=A5n 3 apr. 2023 kl 21:50=
 skrev &lt;<a href=3D"mailto:craig@sbc-85.com">craig@sbc-85.com</a>&gt;:<br=
></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;=
border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=3D"msg-=
2745349849672770526"><div lang=3D"EN-US" style=3D"overflow-wrap: break-word=
;"><div class=3D"m_-2745349849672770526WordSection1"><p class=3D"MsoNormal"=
>Hi Mattis,<u></u><u></u></p><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p=
><p class=3D"MsoNormal">I must have fallen asleep in class and just woke up=
 when the teacher called me=E2=80=A6. where did this code come from?<u></u>=
<u></u></p><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p><p class=3D"MsoNo=
rmal">I have not taken a careful look, really just looked at your comments =
and confusion set in right when I got to RI0 where you point out that movin=
g the BS character into A and then ANI with 0x01 makes absolutely no sense.=
=C2=A0 How much confidence do we have in this code? is there an original li=
st file for this code? =C2=A0=C2=A0If this is code that was read from a ROM=
 and not actually tested, is it a misread or bit rot?<u></u><u></u></p><p c=
lass=3D"MsoNormal"><u></u>=C2=A0<u></u></p><p class=3D"MsoNormal">to answer=
 your question, the OUT instruction leaves register A unchanged and affects=
 no flags. <u></u><u></u></p><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p=
><p class=3D"MsoNormal">looking at the code, everything in the RI: and RI0:=
 makes sense at first blush.=C2=A0 if I had to accuse something, I would sa=
y there is a missing IN TTYS instruction before the ANI 01H.=C2=A0 is that =
possible?<u></u><u></u></p><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p><=
p class=3D"MsoNormal">regards<u></u><u></u></p><p class=3D"MsoNormal">craig=
<u></u><u></u></p><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p><p class=
=3D"MsoNormal"><u></u>=C2=A0<u></u></p><p class=3D"MsoNormal"><u></u>=C2=A0=
<u></u></p><div style=3D"border-right:none;border-bottom:none;border-left:n=
one;border-top:1pt solid rgb(225,225,225);padding:3pt 0in 0in"><p class=3D"=
MsoNormal"><b>From:</b> Mattis Lind &lt;<a href=3D"mailto:mattislind@gmail.=
com" target=3D"_blank">mattislind@gmail.com</a>&gt; <br><b>Sent:</b> Monday=
, April 3, 2023 11:05 AM<br><b>To:</b> SBC-85 &lt;<a href=3D"mailto:craig@s=
bc-85.com" target=3D"_blank">craig@sbc-85.com</a>&gt;; Sid Jones &lt;<a hre=
f=3D"mailto:jonesthechip@logicmagic.co.uk" target=3D"_blank">jonesthechip@l=
ogicmagic.co.uk</a>&gt;; Jon Hales &lt;<a href=3D"mailto:jonhales@gmail.com=
" target=3D"_blank">jonhales@gmail.com</a>&gt;<br><b>Subject:</b> Intellec =
8/80 reading paper tapes?<u></u><u></u></p></div><p class=3D"MsoNormal"><u>=
</u>=C2=A0<u></u></p><div><p class=3D"MsoNormal">Hello!<u></u><u></u></p><d=
iv><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div><div><p class=3D"Ms=
oNormal">It has been a while. I got side tracked with another project. A gu=
y donated a SWTPC 6809 machine with a terminal and floppy drives. Nice litt=
le system, but not working yet and very dusty when I received it so it requ=
ired some attention.<u></u><u></u></p></div><div><p class=3D"MsoNormal"><u>=
</u>=C2=A0<u></u></p></div><div><p class=3D"MsoNormal">After I got the Inte=
llec=C2=A08 running I designed a small current-loop interface for it and th=
ought a paper tape simulator would be a good idea. An STM32 controller with=
 a small SD card would allow me to have a bunch=C2=A0of images to select fr=
om. As soon as the Intellec=C2=A08 asserts the reader run signal a menu wou=
ld be printed on the terminal connected to the paper tape emulator showing =
what files there are on the SD card so you could select one for downloading=
 into the Intellec=C2=A08.<u></u><u></u></p></div><div><p class=3D"MsoNorma=
l"><u></u>=C2=A0<u></u></p></div><div><p class=3D"MsoNormal">Until here eve=
rything works fine. But when the reading process starts,=C2=A0 it stops aft=
er 20 characters. I did a try to single step through the code while receivi=
ng characters and then it=C2=A0worked much better. I wasn&#39;t able to fin=
ish the entire file, but it got well past 20 characters of input until I go=
t too tired of pressing the STEP switch repeatedly.<u></u><u></u></p></div>=
<div><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div><div><p class=3D"=
MsoNormal">So what could cause this? This all sounds like some kind of timi=
ng problem. But I wanted to be sure before re-designing the software.<u></u=
><u></u></p></div><div><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div=
><div><p class=3D"MsoNormal">I now single stepped through the code while ke=
eping track of it in the assembly listing I had of the monitor running.<u><=
/u><u></u></p></div><div><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></d=
iv><div><p class=3D"MsoNormal">This is the section which is pulsing the Rea=
der Run and reading one byte:<u></u><u></u></p></div><div><p class=3D"MsoNo=
rmal"><u></u>=C2=A0<u></u></p></div><div><p class=3D"MsoNormal"><span style=
=3D"font-family:&quot;Courier New&quot;">RI:=C2=A0 =C2=A0PUSH H=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 ;3EB7-E5=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &lt;-- ENTRY<b=
r>=C2=A0 =C2=A0 =C2=A0 LXI H,IOBYTE=C2=A0 ;3EB8-21 03 00<br>=C2=A0 =C2=A0 =
=C2=A0 MOV A,M=C2=A0 =C2=A0 =C2=A0 =C2=A0;3EBB-7E<br>=C2=A0 =C2=A0 =C2=A0 A=
NI 00CH=C2=A0 =C2=A0 =C2=A0 ;3EBC-E6 0C<br>=C2=A0 =C2=A0 =C2=A0 JNZ RI3=C2=
=A0 =C2=A0 =C2=A0 =C2=A0;3EBE-C2 E4 3E<br>=C2=A0 =C2=A0 =C2=A0 MVI A,HT=C2=
=A0 =C2=A0 =C2=A0 ;3EC1-3E 09<br>=C2=A0 =C2=A0 =C2=A0 OUT TTYS=C2=A0 =C2=A0=
 =C2=A0 ;3EC3-D3 01=C2=A0 =C2=A0 =C2=A0 &lt;-- CLEAR READER RUN<br><br>RI0:=
=C2=A0 MVI A,BS=C2=A0 =C2=A0 =C2=A0 ;3EC5-3E 08<br>=C2=A0 =C2=A0 =C2=A0 OUT=
 TTYS=C2=A0 =C2=A0 =C2=A0 ;3EC7-D3 01=C2=A0 =C2=A0 =C2=A0 &lt;-- SET READER=
 RUN<br>=C2=A0 =C2=A0 =C2=A0 MVI H,0FFH=C2=A0 =C2=A0 ;3EC9-26 FF<br>=C2=A0 =
=C2=A0 =C2=A0 ANI 001H=C2=A0 =C2=A0 =C2=A0 ;3ECB-E6 01=C2=A0 =C2=A0 =C2=A0 =
&lt;-- AND A with 01h But isn&#39;t A just 08h?<br>=C2=A0 =C2=A0 =C2=A0 JZ =
RI2=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;3ECD-CA DE 3E=C2=A0 =C2=A0&lt;-- Jump on 0.=
 Always take this?<br>=C2=A0 =C2=A0 =C2=A0 CALL DELAY=C2=A0 =C2=A0 ;3ED0-CD=
 37 3D=C2=A0 =C2=A0&lt;-- When do we get here?<br>=C2=A0 =C2=A0 =C2=A0 CALL=
 DELAY=C2=A0 =C2=A0 ;3ED3-CD 37 3D<br>=C2=A0 =C2=A0 =C2=A0 DCR H=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0;3ED6-25<br>=C2=A0 =C2=A0 =C2=A0 JNZ RI0=C2=A0 =C2=
=A0 =C2=A0 =C2=A0;3ED7-C2 C5 3E=C2=A0 =C2=A0&lt;-- It makes no sense loopin=
g if we aren&#39;t reading some condition!<br><br>RI1:=C2=A0 XRA A=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0;3EDA-AF<br>=C2=A0 =C2=A0 =C2=A0 STC=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;3EDB-37<br>=C2=A0 =C2=A0 =C2=A0 POP H=C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0;3EDC-E1<br>=C2=A0 =C2=A0 =C2=A0 RET=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;3EDD-C9<br><br>RI2:=C2=A0 IN TTYD=C2=A0 =C2=
=A0 =C2=A0 =C2=A0;3EDE-DB 00=C2=A0 =C2=A0 =C2=A0 &lt;-- Get here then and r=
ead data<br>=C2=A0 =C2=A0 =C2=A0 CMA=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0;3EE0-2F<br>=C2=A0 =C2=A0 =C2=A0 ORA A=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
;3EE1-B7<br>=C2=A0 =C2=A0 =C2=A0 POP H=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;3E=
E2-E1<br>=C2=A0 =C2=A0 =C2=A0 RET=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;=
3EE3-C9=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;-- Return to caller.</span><u>=
</u><u></u></p></div><div><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></=
div><div><p class=3D"MsoNormal">The routine=C2=A0above is called from this =
small routine:<u></u><u></u></p></div><div><p class=3D"MsoNormal"><u></u>=
=C2=A0<u></u></p></div><p class=3D"MsoNormal"><span style=3D"font-family:&q=
uot;Courier New&quot;">RIX:=C2=A0 CALL RI=C2=A0 =C2=A0 =C2=A0 =C2=A0;3F12-C=
D B7 3E<br>=C2=A0 =C2=A0 =C2=A0 JC=C2=A0 =C2=A0LER=C2=A0 =C2=A0 =C2=A0 ;3F1=
5-DA 67 3C=C2=A0 &lt;-- If carry we bail out to 3C67h<br>=C2=A0 =C2=A0 =C2=
=A0 ANI=C2=A0 07FH=C2=A0 =C2=A0 =C2=A0;3F18-E6 7F</span><u></u><u></u></p><=
div><p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quo=
t;">=C2=A0 =C2=A0 =C2=A0 RET=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;3F1A-=
C9=C2=A0</span><u></u><u></u></p></div><div><p class=3D"MsoNormal"><u></u>=
=C2=A0<u></u></p></div><div><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>=
</div><div><p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier =
New&quot;">The code at 3C67 simply prints a &#39;*&#39; and jumps to the ST=
ART of the monitor which prints a CRLF and a &#39;.&#39; then it is the com=
mand interpreter again.</span><u></u><u></u></p></div><div><p class=3D"MsoN=
ormal"><u></u>=C2=A0<u></u></p></div><div><p class=3D"MsoNormal"><span styl=
e=3D"font-family:&quot;Courier New&quot;">The IO board has two addresses. 0=
 and 1</span><u></u><u></u></p></div><div><p class=3D"MsoNormal"><u></u>=C2=
=A0<u></u></p></div><div><p class=3D"MsoNormal"><span style=3D"font-family:=
&quot;Courier New&quot;">0 is the data buffer=C2=A0</span><u></u><u></u></p=
></div><div><p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier=
 New&quot;">1 is the control / status register.</span><u></u><u></u></p></d=
iv><div><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div><div><p class=
=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;">Status r=
egister has bits allocated as follows:</span><u></u><u></u></p></div><div><=
p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div><div><p class=3D"MsoNor=
mal"><span style=3D"font-family:&quot;Courier New&quot;">0=C2=A0 =C2=A0DA -=
 DataAvailable=C2=A0</span><u></u><u></u></p></div><div><p class=3D"MsoNorm=
al"><span style=3D"font-family:&quot;Courier New&quot;">1=C2=A0 =C2=A0OR - =
OverRun</span><u></u><u></u></p></div><div><p class=3D"MsoNormal"><span sty=
le=3D"font-family:&quot;Courier New&quot;">2=C2=A0 =C2=A0TBMT - Transmitter=
BuffereMpTy</span><u></u><u></u></p></div><div><p class=3D"MsoNormal"><span=
 style=3D"font-family:&quot;Courier New&quot;">3=C2=A0 =C2=A0FE=C2=A0 =C2=
=A0- FramingError</span><u></u><u></u></p></div><div><p class=3D"MsoNormal"=
><span style=3D"font-family:&quot;Courier New&quot;">4=C2=A0 =C2=A0PE=C2=A0=
 =C2=A0- ParityError</span><u></u><u></u></p></div><div><p class=3D"MsoNorm=
al"><u></u>=C2=A0<u></u></p></div><div><p class=3D"MsoNormal"><span style=
=3D"font-family:&quot;Courier New&quot;">Control register has one single bi=
t used:</span><u></u><u></u></p></div><div><p class=3D"MsoNormal"><u></u>=
=C2=A0<u></u></p></div><div><p class=3D"MsoNormal"><span style=3D"font-fami=
ly:&quot;Courier New&quot;">0=C2=A0 =C2=A0Reader Run</span><u></u><u></u></=
p></div><div><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div><div><p c=
lass=3D"MsoNormal"><span style=3D"font-family:Arial,sans-serif">I am not an=
 8080 assembly specialist. I think I can read it decently but the code abov=
e puzzles me a bit and I think it has to do with why it doesn&#39;t work.</=
span><u></u><u></u></p></div><div><p class=3D"MsoNormal"><u></u>=C2=A0<u></=
u></p></div><div><p class=3D"MsoNormal"><span style=3D"font-family:Arial,sa=
ns-serif">So I ask you 8080 experts out there if you could give some help u=
nderstanding what is happening!</span><u></u><u></u></p></div><div><p class=
=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div><div><p class=3D"MsoNormal"><s=
pan style=3D"font-family:Arial,sans-serif">BTW. The full disassembly=C2=A0i=
s here:=C2=A0</span><a href=3D"https://www.retrotechnology.com/restore/mon8=
0_v4.asm" target=3D"_blank">https://www.retrotechnology.com/restore/mon80_v=
4.asm</a><u></u><u></u></p></div><div><p class=3D"MsoNormal">I sent the ROM=
s and Bill Beech ran it through his disassembler.<u></u><u></u></p></div><d=
iv><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div><div><p class=3D"Ms=
oNormal">There is a delay routine that loops 256 times through two delay ro=
utines to give some delay but since we are single stepping=C2=A0we never ge=
t into that one I guess. But how can the A register have anything other tha=
n 08h in it after the OUT=C2=A0 instruction?<u></u><u></u></p></div><div><p=
 class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div><div><p class=3D"MsoNorm=
al">Unless of course the OUT instruction does an implicit input into the A =
register after the OUT??<u></u><u></u></p></div><div><p class=3D"MsoNormal"=
>Then it would read the DA flag and it makes much more sense.<u></u><u></u>=
</p></div><div><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div><div><p=
 class=3D"MsoNormal">But I have not seen any 8080 manual stating that the O=
UT instruction also does an IN implicitly.=C2=A0<u></u><u></u></p></div><di=
v><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div><div><p class=3D"Mso=
Normal">What am I missing? How should I interpret the assembly code?<u></u>=
<u></u></p></div><div><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div>=
<div><p class=3D"MsoNormal">If it indeed turns out that the STM32 is slow a=
t times, it is indeed looping through quite some code when polling the read=
er run bit and also reads stuff off the SD-card, then I will probably enabl=
e hardware handshake on the UART and hopefully it will solve it. But unders=
tanding if this is the root cause or not would be helpful.<u></u><u></u></p=
></div><div><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div><div><p cl=
ass=3D"MsoNormal">Any input would be very helpful!<u></u><u></u></p></div><=
div><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div><div><p class=3D"M=
soNormal">Thanks!<u></u><u></u></p></div><div><p class=3D"MsoNormal"><u></u=
>=C2=A0<u></u></p></div><div><p class=3D"MsoNormal">/Mattis<u></u><u></u></=
p></div><div><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div><div><p c=
lass=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div></div></div></div></div></=
blockquote></div>

--0000000000001677ce05f874453d--
