home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / assemblr / library / asm_kit / binihex.asm < prev    next >
Assembly Source File  |  1985-06-21  |  1KB  |  26 lines

  1. prognam segment                         ;start of segmnet
  2. ;
  3.                      assume cs:prognam
  4. ;
  5.                      mov ch,4           ;number of digits
  6. rotate:              mov cl,4           ;set count to 4 bits
  7.                      rol bx,cl          ;left digit to right
  8.                      mov al,bl          ;move to AL
  9.                      and al,0fh         ;mask off left digit
  10.                      add al,30h         ;convert hex to ASCII
  11.                      cmp al,3ah         ;is it > 9?
  12.                      jl  printit        ;jump if digit = 0 to 9
  13.                      add al,7h          ;digit is A to F
  14. printit:
  15.                      mov dl,al          ;put ASCII char in DL
  16.                      mov ah,2           ;Display Output function
  17.                      int 21h            ;call DOS
  18.                      dec ch             ;done 4 digits?
  19.                      jnz rotate         ;not yet
  20. ;
  21.                      int 20h            ;return to DOS or Debug
  22. ;
  23. prognam              ends               ;end of segment
  24. ;
  25.                      end                ;end of program
  26.