Solved

How to find the functinf ths assembly program

Posted on 2009-05-09
Medium Priority
325 Views
Hi to all , I am attaching a code , the q is what is the function of this code ? I aske the same q bfore but not able to know the answer but I done more study and want to check  my work? also there return that should show but could not include in the pic .
``````this is my answer The loop takes in turn 99  data values from a block stored in data memory
starting at hexadecimal address 0500, finds their 2s complement and stores
the results in a block of data memory starting at hexadecimal addres 0563
``````
q3.JPG
0
Question by:hnael
• 8
• 6

LVL 53

Expert Comment

ID: 24343371
I assume this is a follow-up of :

http://www.experts-exchange.com/Programming/Languages/Assembly/Q_24357856.html

>> this is my answer The loop takes in turn 99  data values from a block stored in data memory
>> starting at hexadecimal address 0500, finds their 2s complement and stores
>> the results in a block of data memory starting at hexadecimal addres 0563

There are 100 values there, not 99.

I'm not sure what you mean by "finding the 2s complement". two's complement is a way to stored signed integer values. Read up on it if you're not familiar with it :

http://en.wikipedia.org/wiki/Two%27s_complement

You say it stores "the results" - what are these results ?

How did you get to the address 0x0563 ?
0

LVL 53

Expert Comment

ID: 24343377
In short : it seems you're further off than you were before (in the previous question).

In that question, you analyzed each of the statements, and understood what they did. The only thing that was left to do, was to place it all together, and to see the wood through the trees. That's all.
I suggested using pseudo code to help you understand what was going on. Did you give that a try ?
0

Author Comment

ID: 24345912
sorry my friend , your answer will have to make me go back again and think in totallly different direction, could u tel me please how can I use what u mentioed about pseudo code ?thks .
0

LVL 53

Expert Comment

ID: 24348818
>> could u tel me please how can I use what u mentioed about pseudo code ?thks .

Do you know what pseudo code is ?

http://en.wikipedia.org/wiki/Pseudocode
0

Author Comment

ID: 24348880
yes I know it , we took at uni before long time ago , but thks for the link ......I will see what each instruction is doing again ,and get back asap.
0

LVL 53

Expert Comment

ID: 24348890
ok. I'll be here :)
0

Author Comment

ID: 24349408
Hi , I noticed that no matter what the value in rA is zero so could it be the function that to make sure whats in rA is alawys zero !!!!!!
0

LVL 53

Expert Comment

ID: 24349511
So, what do you think that line 7 does ?
0

Author Comment

ID: 24349537
line seven just jump one instruction whatever the setuation to the instruction that will add 1 to rE SO it jump to the istruction where increment rE BY 1, IS that right .
0

LVL 53

Expert Comment

ID: 24349829
I was referring to the line marked as 7 in the screenshot you posted :

>> add immediate rA 0001

That modifies rA, doesn't it ? So, rA will not always be 0 ...
0

Author Comment

ID: 24349882
that,s correct only if the condition is met  which in this case if the value are -ve then add one to rA . also the program uses whats in rE i.e 0500 and store it in r1 .
0

LVL 53

Accepted Solution

Infinity08 earned 1500 total points
ID: 24349887
>> which in this case if the value are -ve then add one to rA .

Right. So, what's the conclusion ? What will rA contain at the end ?
0

Author Closing Comment

ID: 31579748
well according to the threads  I should know the answer .
0

LVL 53

Expert Comment

ID: 24404182
So, did you find the answer then ?
0

Featured Post

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment Already a member? Login.

Read this post to discover how will you get your first iPhone App Approved by Apple. Make these necessary changes to prevent rejection of the app.
One day, as you try to send an email from your SharePoint account, an error message appears saying: “E-mail Message Cannot be Sent.” You may have outgoing email settings misconfigured.
Through the video, you can check the migration process of Outlook PST file to PDF. Kernel for Outlook to PDF tool can convert Outlook emails with all attributes like Subject, To, From, Cc, Bcc and other folders such as Inbox, Outbox, Sent Items, Jun…
Watch the working video to know how to import Outlook PST/OST files to Amazon WorkMail. Kernel released this tool which is very easy to use and migrate single or multiple PST and OST files to Amazon WorkMail. To know more about Kernel Import PST to …
Suggested Courses
Course of the Month6 days, 9 hours left to enroll

589 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.