Question
Write Debug log. When running your program enable your debug log. This way each step is recorded and can be verified. 8086 assemble language NL
Write Debug log. When running your program enable your debug log. This way each step is recorded and can be verified. 8086 assemble language
NL MACRO MOV DL,10 MOV AH,2 INT 21H MOV DL,13 MOV AH,2 INT 21H ENDM INPUT MACRO MOV AH,1 INT 21H ENDM PRINT MACRO P LEA DX,P MOV AH,9 INT 21H ENDM
.MODEL SMALL .STACK 100H .DATA MSG1 DB ' .....WELCOME TO YOUR FIRST QUIZ.....$' MSG2 DB 'Rules : $' MSG3 DB '*. For Every Correct answer you will get 1 point.$' MSG4 DB '*. For Every Wrong answer 1 Point will cut from your total point.$' MSG5 DB 'Press Enter to start the quiz : $' MSG6 DB 'Right Answer....$' MSG7 DB 'Wrong Answer....$' MSG8 DB 'You have successfully completed your quiz.$' MSG9 DB 'Your Total obtained point is : $' MSG10 DB 'Press 1 to Re-attempt quiz or 0 to Exit.$' MSG11 DB ' ***Thank you.! ***$' Q1 DB '1. 2+3=?$' QA1 DB ' a) 5 b) 6 c) 7$' Q2 DB '2. 5+6=?$' QA2 DB ' a) 10 b) 11 c) 12$' Q3 DB '3. 15-12=?$' QA3 DB ' a) 5 b) 1 c) 3$' Q4 DB '4. 3*6=?$' QA4 DB ' a) 10 b) 18 c) 12$' Q5 DB '5. 6/3=?$' QA5 DB ' a) 2 b) 1 c) 12$' Q6 DB '6. 8-8=?$' QA6 DB ' a) -1 b) -2 c) 0$' Q7 DB '7. 3*12=?$' QA7 DB ' a) 33 b) 36 c) 38$' Q8 DB '8. 9*9=?$' QA8 DB ' a) 72 b) 91 c) 81$' Q9 DB '9. 11+13=?$' QA9 DB ' a) 24 b) 26 c) 19$' Q10 DB '10. 56/8=?$' QA10 DB ' a) 7 b) 9 c) 6$' point db 10 .CODE MAIN PROC MOV AX,@DATA MOV DS,AX PRINT MSG1 NL PRINT MSG2 NL PRINT MSG3 NL PRINT MSG4 START: NL PRINT MSG5 INPUT CMP AL, 13 JE QSN1 JNE START QSN1: NL PRINT Q1 NL PRINT QA1 NL INPUT CMP AL, 'a' JE QSN2 JNE QSNW2 ;jump not equal QSN2: NL PRINT MSG6 NL PRINT Q2 NL PRINT QA2 NL INPUT CMP AL, 'b' JE QSN3 JNE QSNW3 QSNW2: NL PRINT MSG7 DEC point NL PRINT Q2 NL PRINT QA2 NL INPUT CMP AL, 'b' JE QSN3 JNE QSNW3 QSN3: NL PRINT MSG6 NL PRINT Q3 NL PRINT QA3 NL INPUT CMP AL, 'c' JE QSN4 JNE QSNW4 QSNW3: NL PRINT MSG7 DEC point NL PRINT Q3 NL PRINT QA3 NL INPUT CMP AL, 'c' JE QSN4 JNE QSNW4 QSN4: NL PRINT MSG6 NL PRINT Q4 NL PRINT QA4 NL INPUT CMP AL, 'b' JE QSN5 JNE QSNW5 QSNW4: NL PRINT MSG7 DEC point NL PRINT Q4 NL PRINT QA4 NL INPUT CMP AL, 'b' JE QSN5 JNE QSNW5 QSN5: NL PRINT MSG6 NL PRINT Q5 NL PRINT QA5 NL INPUT CMP AL, 'a' JE QSN6 JNE QSNW6 QSNW5: NL PRINT MSG7 DEC point NL PRINT Q5 NL PRINT QA5 NL INPUT CMP AL, 'a' JE QSN6 JNE QSNW6 QSN6: NL PRINT MSG6 NL PRINT Q6 NL PRINT QA6 NL INPUT CMP AL, 'c' JE QSN7 JNE QSNW7 QSNW6: NL PRINT MSG7 DEC point NL PRINT Q6 NL PRINT QA6 NL INPUT CMP AL, 'c' JE QSN7 JNE QSNW7 QSN7: NL PRINT MSG6 NL PRINT Q7 NL PRINT QA7 NL INPUT CMP AL, 'b' JE QSN8 JNE QSNW8 QSNW7: NL PRINT MSG7 DEC point NL PRINT Q7 NL PRINT QA7 NL INPUT CMP AL, 'b' JE QSN8 JNE QSNW8 QSN8: NL PRINT MSG6 NL PRINT Q8 NL PRINT QA8 NL INPUT CMP AL, 'c' JE QSN9 JNE QSNW9 QSNW8: NL PRINT MSG7 DEC point NL PRINT Q8 NL PRINT QA8 NL INPUT CMP AL, 'c' JE QSN9 JNE QSNW9 QSN9: NL PRINT MSG6 NL PRINT Q9 NL PRINT QA9 NL INPUT CMP AL, 'a' JE QSN10 JNE QSNW10 QSNW9: NL PRINT MSG7 DEC point NL PRINT Q9 NL PRINT QA9 NL INPUT CMP AL, 'a' JE QSN10 JNE QSNW10 QSN10: NL PRINT MSG6 NL PRINT Q10 NL PRINT QA10 NL INPUT CMP AL, 'a' JE EXIT JNE EXITW QSNW10: NL PRINT MSG7 DEC point NL PRINT Q10 NL PRINT QA10 NL INPUT CMP AL, 'a' JE EXIT JNE EXITW EXIT: NL PRINT MSG6 NL NL PRINT MSG8 NL PRINT MSG9 mov bl,point ADD BL,48 CMP BL,58 JGE TEN ;jump greater than equalto MOV AH, 2 MOV DL, BL INT 21H JMP EXIT1 TEN: MOV AH,2 MOV DL,"1" INT 21H MOV DL,"0" INT 21H JMP EXIT1 EXITW: NL PRINT MSG7 DEC point NL NL PRINT MSG8 NL PRINT MSG9 mov bl,point ADD BL,48 MOV AH,2 MOV DL, BL INT 21H JMP EXIT1
EXIT1: NL NL PRINT MSG10 NL mov point,10 INPUT CMP AL,'1' JE START NL NL PRINT MSG11 MOV AH, 4CH INT 21H MAIN ENDP END MAIN
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started