Jump to content

Help needed in Programming.....

- - - - -

  • Please log in to reply
1 reply to this topic

#1
adi_6294

adi_6294

    Newbie

  • Members
  • Pip
  • 1 posts
VI. Write a program that will add two words located in 2 contiguous memory
addresses. Remember that a word is 2 bytes and that a single memory allocation
unit can hold a byte. The memory address of the first word is given by A1. Remember
that you cannot add directly 2 values in memory, you must use registers. The result will
be then saved in the memory address given by A2 in a longword format. Don’t forget to
take care of the sign!!


VIII. Supposing that the registers are set as follow:

D0 $04D8FFFF A0 $00001000
D1 $65C50010 A1 $00000010
D2 $ABCDEF01 A2 $00000FFE
D3 $12345678 A3 $00000000
D4 $00000000 A4 $00000000
D5 $FFFFFFFF A5 $00000F0F
D6 $11111111 A6 $00F00ABC
D7 $0F0F0F0F A7 (stack pointer)

And you have theses values in the memory:

Address Value

$00001000 $0000F00030297642509687
$00000010 $0000000E62094368504209425
$00000FFE $00000F00987BCD98E098AF9783
$00001010 $000000F090276459FBCA27FE53

Assuming that we are working with signed integers…

Write the final state of registers and memory after each instruction of this assembly
Language code. Write only the values that have changed and explain briefly
(1 short sentence) how you obtain each result.

ADD.B D1, D2
EXT.W D2
SUB.L D6, D5
MOVE.W D5, A4
MOVE.L (A0)+, D7
MOVE.L 2(A0, A1.L), D6


please help me on this...
thanks

#2
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,705 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
We help with homework but we won't do it for you. Show us what work you've done so far and we'll point you in the right direction.
sudo rm -rf /




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users