CSEG        SEGMENT
            ASSUME CS:CSEG,DS:DSEG

DISP_LINE   PROC NEAR
            MOV  AX,DSEG
            MOV  DS,AX
            MOV  BX,0
            MOV  CX,16
HEX_LOOP:
            MOV  DL,LINE[BX]
            PUSH CX
            MOV  CL,4
            SHR  DL,CL
            POP  CX
            CALL WRITE_DIGIT
            MOV  DL,LINE[BX]
            AND  DL,0Fh
            CALL WRITE_DIGIT
            MOV  AH,02h
            MOV  DL,' '
            INT  21h
            INC  BX
            LOOP HEX_LOOP
            MOV  AX,4C00h
            INT  21h
DISP_LINE   ENDP

WRITE_DIGIT PROC NEAR
            ADD  DL,30h
            CMP  DL,3Ah
            JB   DIGIT_OK
            ADD  DL,07h
DIGIT_OK:
            MOV  AH,02h
            INT  21h
            RET
WRITE_DIGIT ENDP

CSEG        ENDS

DSEG        SEGMENT
LINE        DB   30h, 31h, 32h, 33h, 34h, 35h, 36h, 37h
            DB   38h, 39h, 3Ah, 3Bh, 3Ch, 3Dh, 3Eh, 3Fh
DSEG        ENDS

SSEG        SEGMENT STACK
            DW   256 DUP (?)
SSEG        ENDS

            END  DISP_LINE