       title d-hexw.asm
code  segment  'CODE' public
       assume cs:code
       extrn display : far
       extrn kbin    : far
       extrn hex     : far
       extrn crlf    : far 
main   proc  far
       push  ds
       mov   ax,0
       push  ax

 
      mov  dl,'?'
      call display
      call kbin
      mov  ah,al
      mov  si,ax
      mov  dl,'='
      call display
      mov  dx,si
      call hexw
      call crlf
      jmp  main
main  endp
;--------------------
hexw  proc
      mov  di,dx
      mov  dl,dh
      call hex
      mov  dx,di
      call hex
      mov  dl,' '
      call display
      ret
hexw  endp
;============
code ends
     end main