Question

A list of numbers (in hexa) is stored in the memory location range of (0000 –...

A list of numbers (in hexa) is stored in the memory location range of (0000 – 00FF), we need to subtract $04 from each number of the list. Solve this problem using assembly language, use the Indexed addressing in writing of your program. Store the result of subtracting each number in the same memory location.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

mov si,00                             ;;Giving the initial memory location to 0

mov bl,04h                          ;;bl = 4 constant value to subtract

mov cx,00FFh    ;;cx is counter register cx = FF

back:

    mov al,[si]       ;;Moving element in the memory block to al

    sub al,bl           ;;al = ab-4

    mov [si], al;;Storing the result back in memory location

   

    inc si                  ;;incrementing the memory location

    loop back         ;;looping back to start of the loop

hlt                                                           ;;End of the program.

Add a comment
Know the answer?
Add Answer to:
A list of numbers (in hexa) is stored in the memory location range of (0000 –...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT