d79 jmp start prompt: db 0D,0A,'Choose port (COM1=1, COM2=2, COM3=3, COM4=4): $' outstr: db 0D,80 dup 32 db 0D,0A,0D,0A,'Status COM is: ' val: db 4 dup 0,'H',0D,0A,0D,0A,'$' text: db 'Data Ready : N',0D,0A db 'Overrun Error : N',0D,0A db 'Parity Error : N',0D,0A db 'Framing Error : N',0D,0A db 'Break Detected : N',0D,0A db 'Empty transmit holding register : N',0D,0A db 'Empty transmit shift register : N',0D,0A db 'Timeout : N',0D,0A db 80 dup 196 db 'Delta Clear To Send : N',0D,0A db 'Delta Data Set Ready : N',0D,0A db 'Trailing edge ring detector : N',0D,0A db 'Delta receive line signal detect: N',0D,0A db 'Clear To Send : N',0D,0A db 'Data Set Ready : N',0D,0A db 'Ring indicator : N',0D,0A db 'Received line signal detect : N',0D,0A db 0D,0A txtlen equ $-text start: mov ah,09H ;Write string to screen mov dx,prompt int 21H mov ah,00H int 16H and ax,0ff cmp al,031 jge >l1 jmp ending l1: cmp al,034 jle >l2 jmp ending l2: mov dx,ax mov bp,outstr mov b[bp+95],dl sub dx,031 mov ah,03H ;Get status COM4 int 14H push ax mov bp,val mov bl,ah ;Calculate ASCII values call calc mov bl,al call calc mov ah,09H ;Write string to screen mov dx,outstr int 21H pop ax push ax mov bp,text mov si,34 mov dl,2 mov al,1 mov cx,8 mov bl,ah rslp: test bl,al jz >l2 mov b[bp+si],'Y' l2: mul dl add si,37 loop rslp add si,80 pop ax mov bl,al mov al,1 mov cx,8 modlp: test bl,al jz >l2 mov b[bp+si],'Y' l2: mul dl add si,37 loop modlp mov ah,40H ;Write text mov bx,01H ;Stdout mov cx,txtlen mov dx,text int 21H mov bp,text mov si,34 mov cx,8 rsclr: mov b[bp+si],'N' add si,37 loop rsclr add si,80 mov cx,8 modclr: mov b[bp+si],'N' add si,37 loop modclr jmp start ending: mov ax,04c00 ;That's it! int 21H calc: mov dl,bl shr dl,4 ;We want the left character and dl,0F add dl,030 mov b[bp],dl inc bp mov dl,bl and dl,0F ;No shift here add dl,030 mov b[bp],dl inc bp ret . 0