Solved

How to find the functinf ths assembly program

Posted on 2009-05-09
14
310 Views
Last Modified: 2012-05-06
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

Open in new window

q3.JPG
0
Comment
Question by:hnael
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 6
14 Comments
 
LVL 53

Expert Comment

by:Infinity08
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

by:Infinity08
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

by:hnael
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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 53

Expert Comment

by:Infinity08
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

by:hnael
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

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

Author Comment

by:hnael
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

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

Author Comment

by:hnael
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

by:Infinity08
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

by:hnael
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

by:
Infinity08 earned 500 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

by:hnael
ID: 31579748
well according to the threads  I should know the answer .
0
 
LVL 53

Expert Comment

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

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Justin
In light of the WannaCry ransomware attack that affected millions of Windows machines, you might wonder if your Mac needs protecting. Yes, it does and here is how to do it.
Resolving an irritating Remote Desktop connection that stops your saved credentials from being used.
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

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

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

Join & Ask a Question