Question

2. Write two subroutines one for (X+Y) and next one is for (X Y) and implement this equation (X+Y)(X*Y) in your program body with those returns received from subroutinesUsing Assembly Language Easy68k only

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

res EQU 0

X EQU 10

Y EQU 5

sub1:

ADD.W D1, D2 // X+Y

RTS

sub2:

MUL.W D1,D2 // X*Y

RTS

main:

MOVEA.L #X, D1

MOVEA.L #y, D2

BSR sub1

MOVE.L D2, A1 // store X+Y in A1

MOVEA.L #X, D1

MOVEA.L #y, D2

BSR sub2

MOVE.L D2, A2 // store X*Y in A2

DIV.W A1, A2 // X+Y / X*Y

MOVE.L A2,res

STOP #$2000

Add a comment
Know the answer?
Add Answer to:
Using Assembly Language Easy68k only 2. Write two subroutines one for (X+Y) and next one is...
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