Question: Write the C55x assembly code the following C snippet code. Assume the 8-bit values a, b, c, and d are stored in locations 0x100, 0x101,

Write the C55x assembly code the following C snippet code. Assume the 8-bit values a, b, c, and d are stored in locations 0x100, 0x101, 0x102, and 0x103 respectively in the memory. Store the result x in location 0x104.

for (i=0; i

x = x + (a * b);

Here is an example to go by (not sure if I did it all completely right), but I need the same type of assembly code for the code above (the for loop):

Write the C55x assembly code the following C

MOV 0x100, ARO MoV oxIol, AR MOV oxi02, AR2 MOV oxi04, ARH Mov *ARO, ACO MoV *ARI, ACI imove address a in AR0 move address of b in ARI /move address cin , move address d x in ARH imove contents of ox100 to accumulator ACO i move contents 0x101 to accwmulator Ad imove contents of oxl02 to occumulodor Acz inoe ARO to (31-11) bits a AC i nove ARI to (31-11) bits of AC2 i multiply Ad ard AC-AU=(a* a) i move AR2 to (31-11) bits of AC3 AR2 accumu MOV *ARO,(A) MOV#ARI, HI(AC2) MPY ACI, ACI Mov *AR2, HI(AC3) SUB AcI, AC2 MPY ACl, AC ADD AC3, Ac i m i store Ad in oxl04 to to C/ A2A 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!