Question

using Ax register convert this high-level language expression to Assembly language code - C=C+4 - C=C-1

using Ax register convert this high-level language expression to Assembly language code

- C=C+4

- C=C-1

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

EXPRESSION: C= C+4

Assembly Code:

  • MOV Ax, C
  • ADD Ax, #4

EXPLANATION:

We are given C=C+4

So to write this high level language code into assmebly code:

Let's first mov the content of variable 'C' to Register 'Ax' by MOV Ax, C

Where Ax is destination and C is source, so content is moved from source to destination register.

And then, add 4 to the content in Register Ax

For that we have ADD instruction.

-----------------------------------------------------------------------------

EXPRESSION: C=C-1

Assembly Code:

  • MOV Ax, C
  • DEC Ax

EXPLANATION:

Here we have expression as: C=C-1

So first mov the content of C to Register 'Ax'

With the help of instruction MOV Ax, C

Now subtract 1 from the content of Ax

With the help of help of DEC instruction, which means to decrement the content of register by 1.

Hence, DEC AX

Add a comment
Know the answer?
Add Answer to:
using Ax register convert this high-level language expression to Assembly language code - C=C+4 - C=C-1
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