Question: Write an assembly language program to add 10 data bytes. Data is stored in memory location starting from 4460H. The result is 8 bits only and in stored in 4480H.
Algorithm
Step 1: Point HL register pair to memory location 4460H
Step 2: Set up a decrement counter, say C from 0AH (for 10 data)
Step 3: Load Accumulator with 00H to clear content
Step 4: Move content of memory location to register B
Step 5: Add B with Accumulator (A) and store to A. (ADD command)
Step 6: Increase memory location by one
Step 7: Decrease C counter by one
Step 8: Until C is not equal to 0 repeat program control from Step 4:
Step 9: Store content of Accumulator to memory location 4480H
Step 10: Terminate the program
Assembly Language Program
Label | Instruction | Comments |
LXI H, 4460H ; | HL register pair points at memory location 4460H | |
MVI C, 0A H ; | Sets up a decrement counter | |
MVI A, 00H ; | Clears Accumulator | |
jump1: | MOV B, M ; | Moves content of memory location to B |
ADD B ; | Adds A and B and stores result at A | |
INX H ; | HL pair points at M+1 memory location | |
DCR C ; | Decreases C counter by one | |
JNZ jump1: ; | Until C is not control jumps to jump1: | |
STA 4480H ; | Stores result at 4480H (when C=0) | |
HLT ; | Terminates the program |
play youtube
play youtube
xvideos
xporn
Phim sex
What Vaccines Do Dogs Need Annually
Wordle Jan 19
What Is Threshold Amount
My Pet Frame
Box Score For World Series
Louisville Women S Basketball Roster
Apple Savings Account Cons
Cso Criminal Search Bc
What Were Kleenex Tissues Originally Used For
Mens All Birds
Is Better Call Saul Over
Waitrose Warwick Way
Usd To Rm
How Much Is A Fitbit
Civil Liabilities Definition
What Is A Fast Internet Download Speedhulk Smash Birthday Cake
Waitrose Warwick Way
Rabies Vector Species
Gonzo Move
What Is The Sherman Act
Pingback: Introduction to Assembly Language with Examples - Code Snippets