### Translation:
### Write a main program that inputs two non-compressed BCD numbers from the keyboard and stores them in AX. In the future, it will be converted into a binary number. An far-type subroutine should be written. If the character is to be displayed, a near-type subroutine can be implemented, or a source-type subroutine can be implemented. When the main program is executed, the data can be input cyclically and ends when '00' is encountered.
NAME EX_05_19
STACKS SEGMENT
DB 100 DUP(0)
STACKS ENDS
EXTRN CON:FAR,DISP:FAR
CODES SEGMENT
ASSUME CS:CODES,SS:STACKS
MAIN PROC FAR
START:PUSH DS
MOV AX,0
PUSH AX
REV:MOV AX,1
INT 21H
MOV BL,AL
INT 21H
MOV AH,AL
MOV AL,BL
CMP AX,3030H
JE ENDTRAN
CALL NEAR PTR TRAN
CALL FAR PTR CON
MOV AL,0DH
CALL FAR PTR DISP
MOV AL,0AH
CALL FAR PTR DISP
JMP REV
ENDTRAN:RET
MAIN ENDP
TRAN PROC NEAR
AND AX,0F0FH
MOV BL,AL
MOV CL,3
SHL BL,CL
MOV CL,1
SHL AL,CL
ADD AL,BL
ADD AL,AH
RET
TRAN ENDP
CODES ENDS
END START
NAME EX_05_09_2
PUBLIC CON,DISP
CSBG SEGMENT PARA 'CODE'
ASSUME CS:CSBG
CON PROC FAR
PUSH AX
MOV CL,4
SHR AL,CL
ADD AL,30H
ADD AL,30H
CMP AL,39H
JBE CON2
ADD AL,7
CON2:PUSH AX
MOV AL,0DH
CALL FAR PTR DISP; I don't understand MOV AL,0AH
CALL FAR PTR DISP
POP AX
CALL FAR PTR DISP
POP AX
AND AL,0FH
ADD AL,30H
CMP AL,39H
JBE CON1
ADD AL,07H
CON1:CALL DISP
RET
CON ENDP
DISP PROC FAR
MOV DL,AL
MOV AH,2
INT 21H
RET
DISP ENDP
CSBG ENDS
END
There is a problem with the program when running. There are the following doubts:
1) Can you tell me about the code problem. The numbers input from the keyboard are represented by hexadecimal codes. I asked before, what code does it become after conversion through the subroutine TRAN? Is it necessary to use MOV DL,02H, int21H to display in hexadecimal code. To be honest, I don't understand this question at all. Can you tell me in detail how they convert?
2)
I marked a sentence and think that FAR should be changed to NEAR, which is within the segment
Thanks
### Note: The part with ... is the original content that remains as is as per the requirements.
### Write a main program that inputs two non-compressed BCD numbers from the keyboard and stores them in AX. In the future, it will be converted into a binary number. An far-type subroutine should be written. If the character is to be displayed, a near-type subroutine can be implemented, or a source-type subroutine can be implemented. When the main program is executed, the data can be input cyclically and ends when '00' is encountered.
NAME EX_05_19
STACKS SEGMENT
DB 100 DUP(0)
STACKS ENDS
EXTRN CON:FAR,DISP:FAR
CODES SEGMENT
ASSUME CS:CODES,SS:STACKS
MAIN PROC FAR
START:PUSH DS
MOV AX,0
PUSH AX
REV:MOV AX,1
INT 21H
MOV BL,AL
INT 21H
MOV AH,AL
MOV AL,BL
CMP AX,3030H
JE ENDTRAN
CALL NEAR PTR TRAN
CALL FAR PTR CON
MOV AL,0DH
CALL FAR PTR DISP
MOV AL,0AH
CALL FAR PTR DISP
JMP REV
ENDTRAN:RET
MAIN ENDP
TRAN PROC NEAR
AND AX,0F0FH
MOV BL,AL
MOV CL,3
SHL BL,CL
MOV CL,1
SHL AL,CL
ADD AL,BL
ADD AL,AH
RET
TRAN ENDP
CODES ENDS
END START
NAME EX_05_09_2
PUBLIC CON,DISP
CSBG SEGMENT PARA 'CODE'
ASSUME CS:CSBG
CON PROC FAR
PUSH AX
MOV CL,4
SHR AL,CL
ADD AL,30H
ADD AL,30H
CMP AL,39H
JBE CON2
ADD AL,7
CON2:PUSH AX
MOV AL,0DH
CALL FAR PTR DISP; I don't understand MOV AL,0AH
CALL FAR PTR DISP
POP AX
CALL FAR PTR DISP
POP AX
AND AL,0FH
ADD AL,30H
CMP AL,39H
JBE CON1
ADD AL,07H
CON1:CALL DISP
RET
CON ENDP
DISP PROC FAR
MOV DL,AL
MOV AH,2
INT 21H
RET
DISP ENDP
CSBG ENDS
END
There is a problem with the program when running. There are the following doubts:
1) Can you tell me about the code problem. The numbers input from the keyboard are represented by hexadecimal codes. I asked before, what code does it become after conversion through the subroutine TRAN? Is it necessary to use MOV DL,02H, int21H to display in hexadecimal code. To be honest, I don't understand this question at all. Can you tell me in detail how they convert?
2)
I marked a sentence and think that FAR should be changed to NEAR, which is within the segment
Thanks
### Note: The part with ... is the original content that remains as is as per the requirements.
