stack segment para stack dw 128h dup (0) stack ends data segment notfound db 'NOT FOUND!', 0dh, 0ah, '$' io db 0dh, 0ah, 'IO ADDRESS IS: $' data ends code segment assume cs:code, ss:stack, ds:data start: mov ax, data mov ds, ax mov ah, 0b1h mov al, 2 mov cx, 9050h ; Device ID mov dx, 10b5h ; Vender ID mov si, 0 int 1ah cmp ah, 0 jz got mov dx, offset notfound mov ah, 9 int 21h jmp gout got: mov ax, bx call disp mov dl, 0ah mov ah, 2 int 21h mov dl, 0dh int 21h mov di, 0 loop1: mov ax, 0b109h int 1ah mov ax, cx call disp mov dl, ' ' mov ah, 2 int 21h inc di inc di cmp di, 40h jl loop1 mov dx, offset io mov ah, 9 int 21h mov ax, 0b109h mov di, 1ch ; base reg #3 int 1ah and cx, 0fffeh mov ax, cx call disp gout: mov ah, 4ch int 21h disp proc near push bx push cx mov bx, ax mov cx, 4 lloop1: mov ax, bx call disp2 push cx mov cl, 4 shl bx, cl pop cx loop lloop1 pop cx pop bx ret disp endp disp2 proc near push dx push cx and ah, 0f0h mov cl, 4 shr ah, cl mov dl, ah cmp dl, 9 jle num add dl, 7 num: add dl, 30h mov ah, 02h int 21h pop cx pop dx ret disp2 endp code ends end start