Solved

How to find the functinf ths assembly program

Posted on 2009-05-09
14
308 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
  • 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Swapping a Int64 var (using ASM) 19 1,121
Reverse Engineering Assembly Code 17 1,697
c code optimization 6 469
memory mapped I/O query 6 147
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
One of the biggest threats in the cyber realm pertains to advanced persistent threats (APTs). This paper is a compare and contrast of Russian and Chinese APT's.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

813 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now