Question
A. Write and execute the program as follows and note the results: address Instruction Comment 100 MOV CX,001A ;WE WILL USE CX AS A COUNTER,
A. Write and execute the program as follows and note the results:
address Instruction Comment
100 MOV CX,001A ;WE WILL USE CX AS A COUNTER, 1A=26 DECIMAL
MOV DL,40 ;PREPARE HEX CHARACTER FOR WRITING TO SCREEN.
xxxx INC DL ;VALUE NOW IS 41H OR THE LETTER A IN ASCII.
MOV AH,02 ;SERVICE FOR WRITING TO SCREEN IS 02 AND INT 21 INT 21 ;WRITE CHARACTER FROM DL REG. TO THE SCREEN.
DEC CX ;SEE IF IT IS 26 TIMES, IF NOT,
JNZ xxxx ;GO BACK AND ADD 1 TO CL TO GET NEXT LETTER.
INT 3 ;HALT IF 26 TIMES (ALL 26 ALPHABETS WRITTEN).
Set the IP to 100 and execute the program by entering G.
B. Change the program to write the numbers 0 thru 9 to the screen.
Can someone help me with part B. I have already done part A.? I am using dosbox to execute the program but I can't get it right the program I wrote is below.
MOV CX,000A ;WE WILL USE CX AS A COUNTER, 000A=10 DECIMAL
MOV DL,22 ;PREPARE HEX CHARACTER FOR WRITING TO SCREEN.
0100 INC DL ;VALUE NOW IS 23H OR THE NUMBER 0 IN ASCII.
MOV AH,02 ;SERVICE FOR WRITING TO SCREEN IS 02 AND INT 21
INT 21 ;WRITE CHARACTER FROM DL REG. TO THE SCREEN.
DEC CX ;SEE IF IT IS 10 TIMES, IF NOT,
JNZ 0100 ;GO BACK AND ADD 1 TO CL TO GET NEXT NUMBER.
INT 3 ;HALT IF 10 TIMES (ALL 10 NUMBER WRITTEN).
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