-
2진수 입력 2진수 출력Programming 2009. 4. 30. 21:02
.MODEL SMALL
.STACK 100H
.CODE
MAIN PROC
MOV AH,1
INPUT_WHILE: ;2진 입력
INT 21H
CMP AL,0DH
JE END_INPUT_WHILE
AND AL,0FH
SHL BL,1
OR BL,AL
JMP INPUT_WHILE
END_INPUT_WHILE:
MOV AH,2
MOV DL,0DH
INT 21H
MOV DL,0AH
INT 21H
MOV CX,8H
PRINT_WHILE:
ROL BL,1
JC PT_1
MOV DL,30H
JMP PRINT
PT_1:
MOV DL,31H
PRINT: ;2진출력
INT 21H
CMP CL,0
DEC CX
JE END_PRINT_WHILE
JMP PRINT_WHILE
END_PRINT_WHILE:
MOV AH,4CH
INT 21H
MAIN ENDP
END MAIN
728x90반응형