Mzsmunna
10/16/2019 - 8:43 AM

BINARY TO BINARY OUTPUT WITH 0


.MODEL SMALL
.STACK 100H
.CODE
MAIN PROC
    XOR BX,BX
    MOV AH,1
    INT 21H
    
    WHILE:
    CMP AL,0DH
    JE EXIT
    AND AL,0FH
    SHL BX,1
    OR BL,AL
    INT 21H
    JMP WHILE
    
    
    EXIT:
    MOV CL,16
    MOV AH,2
    MOV DL,0DH
    INT 21H
    MOV DL,0AH
    INT 21H
    EXIT1:
    SHL BX,1
    DEC CL
    JC L1
    MOV AH,2
    MOV DL,'0'
    INT 21H
    JMP L2
    L1:
    MOV AH,2
    MOV AH,2
    MOV DL,'1'
    INT 21H
    L2:
    CMP CL,0
    JG EXIT1  
    MAIN ENDP
END MAIN