DATA SEGMENT
MSG0 DB 0AH,0DH,' ------- This is a program for getting ASCII ---------',0AH,0DH,'$'
MSG1 DB 0ah,0dh,' ----------Please press a key--------- ',0AH,0DH,' ','$'
MSG2 DB 0AH,0DH,' ------Its ASCII is:--------',0AH,0DH,' ','$'
RES DB 0AH,0DH,' ********B',0AH,0DH,' ','$'
msg3 DB 0AH,0DH,' --------------------------------'
DB 0AH,0DH,' ----- Designed by superboy ----'
DB 0AH,0DH,' ----- All Rights Reserved. ----'
DB 0AH,0DH,' ----- 2012/12/03 ----'
DB 0AH,0DH,' --------------------------------'
DB 0AH,0DH,' '
DB 0AH,0DH,' --------------------------------'
DB 0AH,0DH,' --------------------------------'
DB 0AH,0DH,' || ||'
DB 0AH,0DH,' ||--------GOOD-----BYE--------||'
DB 0AH,0DH,' || ||'
DB 0AH,0DH,' --------------------------------'
DB 0AH,0DH,' --------------------------------',0AH,0DH,'$'
MSG4 DB 0AH,0DH,'***********************SOURECE FILES********************',0AH,0DH
DB ' CODE SEGMENT ',0AH,0DH
DB ' ASSUME DS:DATA,CS:CODE ',0AH,0DH
DB ' BEG:MOV DX,DATA ',0AH,0DH
DB ' MOV DS,DX ',0AH,0DH
DB ' lea dx,msg0 ',0AH,0DH
DB ' mov ah,9 ',0AH,0DH
DB ' int 21h ',0AH,0DH
DB ' LEA DX,MSG1 ',0AH,0DH
DB ' MOV AH,9 ',0AH,0DH
DB ' INT 21H ',0AH,0DH
DB ' MOV AH,1 ',0AH,0DH
DB ' INT 21H ',0AH,0DH
DB ' MOV BL,AL ',0AH,0DH
DB ' XOR CX,CX ',0AH,0DH
DB ' CALL CONVERT ',0AH,0DH
DB ' LEA DX,MSG2 ',0AH,0DH
DB ' MOV AH,9 ',0AH,0DH
DB ' INT 21H ',0AH,0DH
DB ' LEA DX,RES ',0AH,0DH
DB ' MOV AH,9 ',0AH,0DH
DB ' INT 21H ',0AH,0DH
DB ' MOV AH,1 ',0AH,0DH
DB ' INT 21H ',0AH,0DH
DB ' lea dx,msg3 ',0AH,0DH
DB ' mov ah,9 ',0AH,0DH
DB ' int 21h ',0AH,0DH
DB ' MOV AH,4CH ',0AH,0DH
DB ' INT 21H ',0AH,0DH
DB ' CONVERT PROC ',0AH,0DH
DB ' MOV CL,8 ',0AH,0DH
DB ' LEA SI,RES+12 ',0AH,0DH
DB ' KEEP:RCL BL,1 ',0AH,0DH
DB ' JC ONE ',0AH,0DH
DB ' MOV BYTE PTR[SI],'0' ',0AH,0DH
DB ' JMP NEXT ',0AH,0DH
DB ' ONE: MOV BYTE PTR[SI],'1'',0AH,0DH
DB ' NEXT:INC SI ',0AH,0DH
DB ' DEC CL ',0AH,0DH
DB ' JNZ KEEP ',0AH,0DH
DB ' RET ',0AH,0DH
DB ' CONVERT ENDP ',0AH,0DH
DB ' CODE ENDS ',0AH,0DH
DB ' END BEG ',0AH,0DH
DB ' *********************CODE ENDS***********************','$'
DATA ENDS
CODE SEGMENT
ASSUME DS:DATA,CS:CODE
BEG:MOV DX,DATA
MOV DS,DX
lea dx,msg0
mov ah,9
int 21h
LEA DX,MSG1
MOV AH,9
INT 21H
MOV AH,1
INT 21H
MOV BL,AL
XOR CX,CX
CALL CONVERT
LEA DX,MSG2
MOV AH,9
INT 21H
LEA DX,RES
MOV AH,9
INT 21H
MOV AH,1
INT 21H
lea dx,msg3
mov ah,9
int 21h
MOV DX,OFFSET MSG4
MOV AH,9
INT 21H
MOV AH,4CH
INT 21H
CONVERT PROC
MOV CL,8
LEA SI,RES+12
KEEP:RCL BL,1
JC ONE
MOV BYTE PTR[SI],'0'
JMP NEXT
ONE: MOV BYTE PTR[SI],'1'
NEXT:INC SI
DEC CL
JNZ KEEP
RET
CONVERT ENDP
CODE ENDS
END BEG
MSG0 DB 0AH,0DH,' ------- This is a program for getting ASCII ---------',0AH,0DH,'$'
MSG1 DB 0ah,0dh,' ----------Please press a key--------- ',0AH,0DH,' ','$'
MSG2 DB 0AH,0DH,' ------Its ASCII is:--------',0AH,0DH,' ','$'
RES DB 0AH,0DH,' ********B',0AH,0DH,' ','$'
msg3 DB 0AH,0DH,' --------------------------------'
DB 0AH,0DH,' ----- Designed by superboy ----'
DB 0AH,0DH,' ----- All Rights Reserved. ----'
DB 0AH,0DH,' ----- 2012/12/03 ----'
DB 0AH,0DH,' --------------------------------'
DB 0AH,0DH,' '
DB 0AH,0DH,' --------------------------------'
DB 0AH,0DH,' --------------------------------'
DB 0AH,0DH,' || ||'
DB 0AH,0DH,' ||--------GOOD-----BYE--------||'
DB 0AH,0DH,' || ||'
DB 0AH,0DH,' --------------------------------'
DB 0AH,0DH,' --------------------------------',0AH,0DH,'$'
MSG4 DB 0AH,0DH,'***********************SOURECE FILES********************',0AH,0DH
DB ' CODE SEGMENT ',0AH,0DH
DB ' ASSUME DS:DATA,CS:CODE ',0AH,0DH
DB ' BEG:MOV DX,DATA ',0AH,0DH
DB ' MOV DS,DX ',0AH,0DH
DB ' lea dx,msg0 ',0AH,0DH
DB ' mov ah,9 ',0AH,0DH
DB ' int 21h ',0AH,0DH
DB ' LEA DX,MSG1 ',0AH,0DH
DB ' MOV AH,9 ',0AH,0DH
DB ' INT 21H ',0AH,0DH
DB ' MOV AH,1 ',0AH,0DH
DB ' INT 21H ',0AH,0DH
DB ' MOV BL,AL ',0AH,0DH
DB ' XOR CX,CX ',0AH,0DH
DB ' CALL CONVERT ',0AH,0DH
DB ' LEA DX,MSG2 ',0AH,0DH
DB ' MOV AH,9 ',0AH,0DH
DB ' INT 21H ',0AH,0DH
DB ' LEA DX,RES ',0AH,0DH
DB ' MOV AH,9 ',0AH,0DH
DB ' INT 21H ',0AH,0DH
DB ' MOV AH,1 ',0AH,0DH
DB ' INT 21H ',0AH,0DH
DB ' lea dx,msg3 ',0AH,0DH
DB ' mov ah,9 ',0AH,0DH
DB ' int 21h ',0AH,0DH
DB ' MOV AH,4CH ',0AH,0DH
DB ' INT 21H ',0AH,0DH
DB ' CONVERT PROC ',0AH,0DH
DB ' MOV CL,8 ',0AH,0DH
DB ' LEA SI,RES+12 ',0AH,0DH
DB ' KEEP:RCL BL,1 ',0AH,0DH
DB ' JC ONE ',0AH,0DH
DB ' MOV BYTE PTR[SI],'0' ',0AH,0DH
DB ' JMP NEXT ',0AH,0DH
DB ' ONE: MOV BYTE PTR[SI],'1'',0AH,0DH
DB ' NEXT:INC SI ',0AH,0DH
DB ' DEC CL ',0AH,0DH
DB ' JNZ KEEP ',0AH,0DH
DB ' RET ',0AH,0DH
DB ' CONVERT ENDP ',0AH,0DH
DB ' CODE ENDS ',0AH,0DH
DB ' END BEG ',0AH,0DH
DB ' *********************CODE ENDS***********************','$'
DATA ENDS
CODE SEGMENT
ASSUME DS:DATA,CS:CODE
BEG:MOV DX,DATA
MOV DS,DX
lea dx,msg0
mov ah,9
int 21h
LEA DX,MSG1
MOV AH,9
INT 21H
MOV AH,1
INT 21H
MOV BL,AL
XOR CX,CX
CALL CONVERT
LEA DX,MSG2
MOV AH,9
INT 21H
LEA DX,RES
MOV AH,9
INT 21H
MOV AH,1
INT 21H
lea dx,msg3
mov ah,9
int 21h
MOV DX,OFFSET MSG4
MOV AH,9
INT 21H
MOV AH,4CH
INT 21H
CONVERT PROC
MOV CL,8
LEA SI,RES+12
KEEP:RCL BL,1
JC ONE
MOV BYTE PTR[SI],'0'
JMP NEXT
ONE: MOV BYTE PTR[SI],'1'
NEXT:INC SI
DEC CL
JNZ KEEP
RET
CONVERT ENDP
CODE ENDS
END BEG