comment+ This has a procedure OUTHEX which prints the hex value of register BH. It is basically Q9 of midterm. The main procedure is used to test OUTHEX. + title TEST OUTHEX .model small .stack 100h .data ; PUT ANY VALUE YOU LIKE FOR VAR. E.g., var=91 (= 5Bh) var db 91 .code MAIN proc ; init mov ax,@data mov ds,ax ; mov bh,var ; set up the argument for OUTHEX call OUTHEX ; dos exit mov ah,4ch int 21h MAIN endp OUTHEX proc ; input: bh contains byte ; output: print hex value of byte push ax push bx push cx push dx ; mov dl,bh mov cl,4 shr dl,cl ; look at the low order 4 bits mov cx,2 ; loop twice AGAIN: cmp dl,10 ja BIG add dl,30h jmp PRINT BIG: add dl,41h PRINT: mov ah,2 int 21h ; mov dl,bh and dl,0Fh ; clear the high order 4 bits loop AGAIN ; pop dx pop cx pop bx pop ax ret OUTHEX endp end main