ADDRESS(DEC) ADDRESS(HEX) ADDRESS (BIN) DATA(HEX) DATA (OCT) Comment 0 00 00000000 31 061 Initialize stack pointer to 1200h 1 01 00000001 00 000 Notes: starting at zero, I simply put a DI opcode, followed by a jump to 1000h 2 02 00000010 12 022 3 03 00000011 CD 315 init card (jmp to 1014h) 4 04 00000100 14 024 5 05 00000101 10 020 6 06 00000110 CD 315 GET A CHAR (1029h) 7 07 00000111 29 051 8 08 00001000 10 020 9 09 00001001 CD 315 SEND IT OUT (1033h) 10 0A 00001010 33 063 11 0B 00001011 10 020 12 0C 00001100 c3 303 loop back to 1006h 13 0D 00001101 06 006 14 0E 00001110 10 020 15 0F 00001111 00 000 NOP 16 10 00010000 00 000 NOP 17 11 00010001 00 000 NOP 18 12 00010010 00 000 NOP 19 13 00010011 00 000 NOP 20 14 00010100 f5 365 PUSH - INITIALIZE CARD 21 15 00010101 3e 076 (store 09 in accum) - send RESET command to board 22 16 00010110 09 011 23 17 00010111 d3 323 send it to port 2 24 18 00011000 02 002 25 19 00011001 d3 323 send it to port 52 26 1A 00011010 52 122 27 1B 00011011 3E 076 store 00 in accum (set interrupt mask - no interrupts!) 28 1C 00011100 00 000 29 1D 00011101 D3 323 send it to port 3 30 1E 00011110 03 003 31 1F 00011111 D3 323 send it to port 53 32 20 00100000 53 123 33 21 00100001 3E 076 store c0 to accum (baud rate 9600, 1 stop bit) 34 22 00100010 C0 300 35 23 00100011 D3 323 send it to port 0 36 24 00100100 00 000 37 25 00100101 D3 323 send it to port 50 38 26 00100110 50 120 39 27 00100111 f1 361 POP - retrieve state 40 28 00101000 C9 311 Return 41 29 00101001 DB 333 BEGIN CHAR READ read status flag @ port 0 42 2A 00101010 00 000 43 2B 00101011 E6 346 AND it with 40h 44 2C 00101100 40 100 45 2D 00101101 CA 312 jump if zero to 1029h 46 2E 00101110 29 051 47 2F 00101111 10 020 48 30 00110000 DB 333 read the data from port 1 49 31 00110001 01 001 50 32 00110010 C9 311 return - end character input 51 33 00110011 F5 365 PUSH - BEGIN CHAR OUTPUT 52 34 00110100 DB 333 read status from port 0 53 35 00110101 00 000 54 36 00110110 E6 346 AND it with 80h 55 37 00110111 80 200 56 38 00111000 CA 312 jump if zero to 1034h 57 39 00111001 34 064 58 3A 00111010 10 020 59 3B 00111011 F1 361 POP - get the data back from stack 60 3C 00111100 D3 323 send it to port 1 61 3D 00111101 01 001 62 3E 00111110 C9 311 Return - end char output ORG 1000H LXI SP,1200H CALL 1014H CALL 1029H CALL 1033H JUMP 1006H DB 00,00,00,00,00 PUSH PSW MVI A,09H ;reset to UART OUT 02H OUT 52H MVI A,00H OUT 03H ;reset interupt mask OUT 53H MVI A,0C0H ;baud 9600, 1 stop OUT 00H OUT 50H POP PSW RET IN 00H ;read status ANI 40H JZ 1029H IN 01H ;read char RET PUSH PSW IN 00H ;read status ANI 80H JZ 1034 POP PSW OUT 01 ;write char RET 1000 ORG 1000H 1000 31 00 12 LXI SP,1200H 1003 cd 14 10 CALL 1014H 1006 cd 29 10 CALL 1029H 1009 cd 33 10 CALL 1033H 100c c3 06 10 JMP 1006H 100f 00 00 00 00 DB 00,00,00,00,00 1013 00 1014 f5 PUSH PSW 1015 3e 09 MVI A,09H ;reset to UART 1017 d3 02 OUT 02H 1019 d3 52 OUT 52H 101b 3e 00 MVI A,00H 101d d3 03 OUT 03H ;reset interupt mask 101f d3 53 OUT 53H 1021 3e c0 MVI A,0C0H ;baud 9600, 1 stop 1023 d3 00 OUT 00H 1025 d3 50 OUT 50H 1027 f1 POP PSW 1028 c9 RET 1029 db 00 IN 00H ;read status 102b e6 40 ANI 40H 102d ca 29 10 JZ 1029H 1030 db 01 IN 01H ;read char 1032 c9 RET 1033 f5 PUSH PSW 1034 db 00 IN 00H ;read status 1036 e6 80 ANI 80H 1038 ca 0a 04 JZ 1034 103b f1 POP PSW 103c d3 01 OUT 01 ;write char 103e c9 RET 103f END