Fill-in the correct instruction, assembler directive, or commands. Use small letters only. PROMPT 1.Blank 1 MESSAGE ; Define macro with message as parameter 2. Blank 2 AX ; Store AX register MOV AH, 09H ; Display Message LEA DX, MESSAGE INT 21H POP AX ; restore register 3. Blank 3 ;End of MESSAGE .4.Blank 45.Blank 5 ; Determines that the model (DS and CS) size is 128KB . STACK 200 DATA 6. Blank 6 ; start data segment MES1 DB 10, 13, ‘1. HEX TO BCD $’ MES2 DB 10, 13, ’2. BCD TO HEX $’ MES3 7. Blank 7 10, 13,’3. EXIT $’ ; variable declaration MES4 DB 10, 13, ‘ENTER THE CHOICE: $’ MES5 DB 10, 13, ‘ENTER THE CORRECT CHOICE: $’ MES6 DB 10, 13, ‘$’ MES7 DB 10, 13, ‘ENTER THE FOUR DIGIT HEX NUMBER: $’ MES8 DB 10, 13, ‘EQUIVALENT BCD NUMBER IS: $’ MES9 DB 10, 13, ‘ENTER THE BCD NUMBER: $’ MES10 DB 10, 13, ‘EQUIVALENT HEX NUMBER IS: $’ DATA 8. Blank 8 ; end of DS NUMBER DW 9. Blank 9 ; reserves memory for NUMBER .CODE 10. Blank 10 DS:DATA, CS:CODE ; renames segment registers START: MOV AX, @DATA ; Initialize data segment MOV DS, AX PROMPT MES1 ;Display MES1 PROMPT MES2 ;Display MES2 PROMPT MES3 ;Display MES3 PROMPT MES4 ;Display MES4 AGAIN: MOV AH, 1 ; read 11.Blank 11 ; Interrupt to display string PROMPT MES6 ;Display MES6 CMP AL, ‘3’ ; if choice is 3 JZ LAST ; exit 12. Blank 12 AL, ‘1’ ;Determine if the input is 1 JNZ NEXT1 13. Blank 13 HTB ; proceed to HEX to BCD conversion JMP LAST ; exit NEXT1: CMP AL, ‘2’ ; if choice is 2 14. Blank 14 NEXT2 ;Go to NEXT2 if the input is not 2 CALL BTH ; do BCD to HEX conversion JMP 15. Blank 15 ; exit NEXT2: PROMPT MES5 ;Display MES5 JMP AGAIN LAST: MOV AH, 16.Blank 16 ; Return to DOS INT 21H HTB 17. Blank 17 NEAR Start of the procedure PROMPT MES7 CALL R_HEX PROMPT MES8 CALL D_BCD 18.Blank 18 ;return 0 if without error HTB 19. Blank 19 ;end of HTB END 20. Blank 20 ; end of the program answer the blanks
Fill-in the correct instruction, assembler directive, or commands. Use small letters only.
PROMPT 1.Blank 1 MESSAGE |
; Define macro with message as parameter |
|||
|
2. Blank 2 |
AX |
|
; Store AX register |
|
MOV |
AH, |
09H |
; Display Message |
|
LEA |
DX, |
MESSAGE |
|
|
INT 21H |
|
|
|
|
POP |
AX |
|
; restore register |
|
3. Blank 3 |
|
|
;End of MESSAGE |
|
|
|
|
|
.4.Blank 45.Blank 5 |
; Determines that the model (DS and CS) size is 128KB |
|||
. STACK 200 |
|
|||
|
|
|
|
|
DATA 6. Blank 6 |
; start data segment |
|||
|
MES1 |
DB |
10, 13, ‘1. HEX TO BCD $’ |
|
|
MES2 |
DB |
10, 13, ’2. BCD TO HEX $’ |
|
|
MES3 |
7. Blank 7 |
10, 13,’3. EXIT $’ |
; variable declaration |
|
MES4 |
DB |
10, 13, ‘ENTER THE CHOICE: $’ |
|
|
MES5 |
DB |
10, 13, ‘ENTER THE CORRECT CHOICE: $’ |
|
|
MES6 |
DB |
10, 13, ‘$’ |
|
|
MES7 |
DB |
10, 13, ‘ENTER THE FOUR DIGIT HEX NUMBER: $’ |
|
|
MES8 |
DB |
10, 13, ‘EQUIVALENT BCD NUMBER IS: $’ |
|
|
MES9 |
DB |
10, 13, ‘ENTER THE BCD NUMBER: $’ |
|
|
MES10 |
DB |
10, 13, ‘EQUIVALENT HEX NUMBER IS: $’ |
|
|
|
|
|
|
DATA |
8. Blank 8 |
|
|
; end of DS |
|
|
|
|
|
|
NUMBER |
DW |
9. Blank 9 |
; reserves memory for NUMBER |
.CODE |
|
|
|
|
|
10. Blank 10 |
DS:DATA, |
CS:CODE |
; renames segment registers |
START: |
MOV |
AX, |
@DATA |
; Initialize data segment |
|
MOV |
DS, |
AX |
|
|
|
|
|
|
|
PROMPT |
MES1 |
;Display MES1 |
|
|
PROMPT |
MES2 |
;Display MES2 |
|
|
PROMPT |
MES3 |
;Display MES3 |
|
|
PROMPT |
MES4 |
;Display MES4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AGAIN: |
MOV |
AH, |
1 |
; read |
|
11.Blank 11 |
|
|
; Interrupt to display string |
|
|
|
|
|
|
PROMPT |
MES6 |
|
;Display MES6 |
|
|
|
|
|
|
CMP |
AL, |
‘3’ |
; if choice is 3 |
|
JZ |
LAST |
|
; exit |
|
|
|
|
|
|
12. Blank 12 |
AL, |
‘1’ |
;Determine if the input is 1 |
|
JNZ |
NEXT1 |
|
|
|
13. Blank 13 |
HTB |
|
; proceed to HEX to BCD conversion |
|
JMP |
LAST |
|
; exit |
|
|
|
|
|
NEXT1: |
CMP |
AL, |
‘2’ |
; if choice is 2 |
|
14. Blank 14 |
NEXT2 |
|
;Go to NEXT2 if the input is not 2 |
|
CALL |
BTH |
|
; do BCD to HEX conversion |
|
JMP |
15. Blank 15 |
|
; exit |
|
|
|
|
|
NEXT2: |
PROMPT |
MES5 |
|
;Display MES5 |
|
JMP |
AGAIN |
|
|
|
|
|
|
|
LAST: |
MOV |
AH, |
16.Blank 16 |
; Return to DOS |
|
INT 21H |
|
|
|
|
|
|
|
|
HTB |
17. Blank 17 |
NEAR |
|
Start of the procedure |
|
|
|
|
|
|
PROMPT |
MES7 |
|
|
|
CALL |
R_HEX |
|
|
|
PROMPT |
MES8 |
|
|
|
CALL |
D_BCD |
|
|
|
18.Blank 18 |
|
|
;return 0 if without error |
HTB |
19. Blank 19 |
|
|
;end of HTB |
END |
20. Blank 20 |
|
|
; end of the program |
answer the blanks
Step by step
Solved in 2 steps