This was all hand assembled to the listing may not be properly formatted
Code: Select all
0000 ORG 0
0000 3E 03 MVI A, 03H ;Rest 2SIO port
0002 D3 10 OUT 10H
0004 3E 15 MVI A, 15H ;Set 2SIO port to 8n1
0006 D3 10 OUT 10H
0008 21 FE 00 LXI H, MSG ;Load message address
000B DB 10 CHECK: IN 10H ;Check 2SIO output ready
000D E6 02 ANI 02H
000F CA 0B 00 JZ CHECK
0012 7E MOV A, M ;Load character
0013 FE 00 CPI 00H ;Check if null found
0015 CA 1E 00 JZ END
0018 D3 11 OUT 11H ;Ouput character
001A 23 INX H ;Move to next character
001B C3 0B 00 JMP CHECK
001E 76 END: HLT
00FE 48 65 6C 6C MSG: Hell
0102 6F 2C 20 77 o, W
0106 6F 72 6C 64 orld
010A 21 0D 0A 00 !\r\n\0
Now my question is about this loop.
Code: Select all
CHECK: IN 10H
ANI 02H
JZ CHECK
My questions are
1. Is there a better way to check if output is ready? (I figure this has been done enough that people have likely found the best way to do it)
2. Are there any guidelines on when the output ready check is needed?