Hi,
I have this program that stores the number of bytes to send, stores the message to send in memory and then bit bangs the SOD port on the 8085 and it's supposed to display this message:
Welcome to the 8085 Monitor
>
But it does this and the program doesn't halt:

The d register contains decimal 31 (message + cr + lf + 1) so i decrement it and zero should be halting condition but it loops forever.
Please assist. Here is the code:
I have this program that stores the number of bytes to send, stores the message to send in memory and then bit bangs the SOD port on the 8085 and it's supposed to display this message:
Welcome to the 8085 Monitor
>
But it does this and the program doesn't halt:

The d register contains decimal 31 (message + cr + lf + 1) so i decrement it and zero should be halting condition but it loops forever.
Please assist. Here is the code:
Welcome Message to 8085 Monitor:
MVI A,1F
STA 1000
MVI A,57
STA 1001
MVI A,65
STA 1002
MVI A,6C
STA 1003
MVI A,63
STA 1004
MVI A,6F
STA 1005
MVI A,6D
STA 1006
MVI A,65
STA 1007
MVI A,20
STA 1008
MVI A,74
STA 1009
MVI A,6F
STA 100A
MVI A,20
STA 100B
MVI A,74
STA 100C
MVI A,68
STA 100D
MVI A,65
STA 100E
MVI A,20
STA 100F
MVI A,38
STA 1010
MVI A,30
STA 1011
MVI A,38
STA 1012
MVI A,35
STA 1013
MVI A,20
STA 1014
MVI A,4D
STA 1015
MVI A,6F
STA 1016
MVI A,6E
STA 1017
MVI A,69
STA 1018
MVI A, 74
STA 1019
MVI A, 6F
STA 101A
MVI A, 72
STA 101B
MVI A, 0A
STA 101C
MVI A, 0D
STA 101D
MVI A, 3E
STA 101E
LXI H, 1000
MOV D,M
LXI H,1001
LXI SP,2000H
PUSH H
START: MOV C,M // Send a test character
COUT: DI
MVI B,0B // Number of output bits
XRA A // Clear carry for start bit
CO1: MVI A,80 // Set the SDE flag
RAR // Shift carry into SOD flag
CMC // and invert carry. Why? (serial is inverted?)
SIM // Output data bit
LXI H,0112 // Load the time delay for one bit width
CO2: DCR L // Wait for bit time
JNZ CO2
DCR H
JNZ CO2
STC // Shift in stop bit(s)
MOV A,C // Get char to send
RAR // LSB into carry
MOV C,A // Store rotated data
DCR B
JNZ CO1 // Send next bit
EI
LXI H,3FFF // Wait a while before sending the character again
CHILL: DCR L
JNZ CHILL
DCR H
JNZ CHILL
POP H
INX H
push h
DCR D
JNZ START
Last edited:
