Question

Subroutine in assembply language

Asked by: hnael

I attached a file with all the details .

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-04-27 at 04:41:34ID24357856
Tags

Assemply language

Topic

Assembly Programming Language

Participating Experts
1
Points
500
Comments
70

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Subroutine
    I tried to move some code into a subroutine, but it didn't work. Vector v1; Vector v2; sub1(v1); sub1(v2); ... public void sub1(Vector v){ v=new Vector(); } Is there a way to do what I am trying?
  2. putting subroutine "stubs" into personal.xls
    My personal.xls is getting cluttered. It has about 15 subroutines that I only use occasionally. Rather that turn them all into addins, I am thinking of replacing them with "stubs". Has anybody ever used this approach successfully (or unsuccessfully) something l...
  3. Two forms using the same subroutines
    Hi, Is it possible to use the same subroutine in two forms which are defined with the same controls, including control names, but with a different layout. The different layout is needed for different interface language. The controls should use the same subroutine for event...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: Infinity08Posted on 2009-04-27 at 04:46:53ID: 24240744

And what's your question ?

 

by: hnaelPosted on 2009-04-27 at 05:35:06ID: 24241016

My question If possible to answer the questions from (a) to (e) which the question is asking in simple way so that  can understand how this program is working ? pls .

 

by: Infinity08Posted on 2009-04-27 at 05:49:52ID: 24241114

I'm afraid EE won't solve your assignments for you. What we can do however, is guide you, and answer specific questions.

So, if you tell us what you tried, where you are stuck, etc., we'll be able to assist you.

 

by: hnaelPosted on 2009-04-27 at 06:10:46ID: 24241252

thats fair enough , I will send the answer I managed to solve and see what you think ? is that acceptable , I am going mad with this assembly , its really hard to understand , at least thats how I see it , ok one question pls can you explain what the stack and what the stack pointer is other than a place where the main program remeber to go to when it run the call instruction.thank you .

 

by: Infinity08Posted on 2009-04-27 at 06:35:06ID: 24241468

>> is that acceptable

Definitely. I'll have a look at what you posted, and give you my comments.


>> ok one question pls can you explain what the stack and what the stack pointer is other

The stack is a region in memory where all local variables, function arguments, call return addresses etc. are saved.

For each function call, a stack frame is set up and added to the top of the current stack. That stack frame contains among other things the return address (where the execution should continue once the function ends), the local function variables, as well as saved registers (in case their value has to be placed back when the function ends).

If, at any time, you walk through the stack from bottom to top, you'll find the stack frames for all current nested function calls. You could see the stack as the current state of the execution.

The stack pointer simply points to the current top of the stack (ie. where the push and pop operations are done).

 

by: hnaelPosted on 2009-04-27 at 06:46:18ID: 24241574

thks for the explanation , will stay in touch as soon as I mange to solve the question (if I can) , also pls be patient as these things take lots of thinking and time consuming as well .

 

by: Infinity08Posted on 2009-04-27 at 07:23:00ID: 24241954

No problem. Don't hesitate to ask for (specific) help if you're stuck somewhere, or are unsure about something. I'm not allowed to solve the assignment for you, but I can give helpful tips and hints, as well as answer specific questions ;)

 

by: hnaelPosted on 2009-04-27 at 07:31:51ID: 24242066

I am really grateful , I just can not get my head round it at the moment , I invest lots of hours with the simulator I got to understand the stack but still unable to grasp what it exactly do and unless I do I can not move one step ahead I feel depress ..at the moment , write If I attach apic for some activitis I captured with the simulator and pose question on that will that be ok .(its activities not assignment or thing like that ).?

 

by: Infinity08Posted on 2009-04-27 at 08:05:01ID: 24242474

>> I got to understand the stack but still unable to grasp what it exactly do and unless I do I can not move one step ahead

The image you posted is not for a question directly related to the stack, so even if you don't fully understand what the stack is and how it works, that shouldn't prevent you from answering the questions there.


Do you know the concept of a stack (LIFO) data structure ?

 

by: hnaelPosted on 2009-04-27 at 09:32:07ID: 24243340

I do remember that what put in first retrieved last and vice versa I think ?  Am I correct?

 

by: Infinity08Posted on 2009-04-27 at 09:36:04ID: 24243373

Yes, compare it to a stack of papers on your desk. You add new papers on top of the stack, making the stack grow, and you take the top-most paper off of the stack, making the stack shrink. LIFO = last-in-first-out.

The stack in this case is exactly the same : it grows in one direction (increasing in size whenever a function is called or local variables are allocated, or ...), and then shrinks again (when returning from a function, etc.)

 

by: hnaelPosted on 2009-04-27 at 09:45:17ID: 24243472

waw I love you for this explanation now I understand much better the horrible stack thingee . you r really good in this I have to say , but do you really use the assembly in real world ?

 

by: Infinity08Posted on 2009-04-27 at 10:00:24ID: 24243583

>> but do you really use the assembly in real world ?

Sure, for certain parts of certain projects.

The most important thing is however, that you gain a better understanding of how a computer works by learning assembly, and that's something you can use in all domains of computer science.

 

by: hnaelPosted on 2009-04-27 at 10:12:06ID: 24243685

cool , I am learning great deal about the processor now and I do understand lots of things but its some how complicated and the connection it seems as if u r in a dark tunnel , but I will never give up to understanding it , eg. we know thats inforamtion does not stop b/n main memory and processor so if I ask where is the first instruction starting who initiate it first ?what your answer will be , by the way this is not at all exam questions or anything like that , just question from my head .

 

by: hnaelPosted on 2009-04-27 at 10:14:26ID: 24243705

Also sorry forget to ask , is there abook or website that can help me with this pls that would be great , I got some note but hard to understand sometime.

 

by: Infinity08Posted on 2009-04-27 at 10:28:08ID: 24243820

>> but I will never give up to understanding it

That's good :)


>> so if I ask where is the first instruction starting who initiate it first ?what your answer will be

The operating system that runs on the computer takes care of starting and managing processes. A process has an entry point, so when the operating system starts a process, it starts execution at that entry point (main for example). From then on, the instructions that are called depend on the flow of control  (comparisons, sumps, loops, etc.).


In the case of the code you posted, I can't tell you who will call it - it's just a piece of code that could be called when needed.

 

by: hnaelPosted on 2009-04-27 at 10:38:41ID: 24243916

ahh ok ,I am begining to understand it more and more now thank you , you r beeing very helpful , but I  am not going to leave alone haaa because I am going to bombard you with questions if thats okay with you , I am more intrested in understanding to be honest nothing more . so will keep in touch if any issue arise and sure you deserve all the pointa no doubt about that , I am just leaving the question open so that I can save it to my knowledge base also I want to answer this question (my self ) but need some help to check if I am on the right track.cheers mate you r being great help .

 

by: Infinity08Posted on 2009-04-27 at 11:03:30ID: 24244097

No problem. Take your time.

 

by: hnaelPosted on 2009-04-29 at 00:03:23ID: 24257884

Hello there , its me again with answers so pls let e know what you think ?
(a). the register rB is used as loop counter .
(b).the loop will be executed 64 time in hex whihc is 100 in denary .
(c) still can not figure it out .
(d). add immediate r1 0000 is used to test whats in r1 weather its -ve , +ve or zero .
(e). the subroutine is a peice of code (program) withen a main program that needs to be executed n numbers of time .
thats what I could come up with but could not find the gihest and lowest value in this program so pls I appreciate any help .thks in advance

 

by: Infinity08Posted on 2009-04-29 at 01:19:51ID: 24258190

>>(a). the register rB is used as loop counter .

Correct.


>> (b).the loop will be executed 64 time in hex whihc is 100 in denary .

I assume that denary is the same as decimal (ie. base 10) ? If so, then that looks ok.


>> (c) still can not figure it out .

I'll give you a hint : 0500, which is loaded into rE at the start, is a memory address.


>> (d). add immediate r1 0000 is used to test whats in r1 weather its -ve , +ve or zero .

Indeed. We're not interested in the immediate impact (adding 0 doesn't change the value), but in the side effects of the instruction.


>> (e). the subroutine is a peice of code (program) withen a main program that needs to be executed n numbers of time .

You need to explain what it actually does ... For example "it sums an array of integers" or something like that (this is just an example, not actually what this code does).

 

by: hnaelPosted on 2009-04-29 at 01:37:08ID: 24258298

right , regarding denary means decimal yes but we have been tought to use denary otherwise the computer geeks gets upset haaa...
so ,I presume that the adress 0500 is the lowest address in data memory and the higest is 0564 because this is the last value rE has got when rB got to 0000 in the simulater, is that correct ?
if yes I will be left only with what this subroutine does as u mentioned .....I followed the instruction step by step but all I can tel for now there is a loop going on for 100 times it increases rE by one , decrease the loop counter by one , it checkes whats in R1 (0,+.-) when rB reach the value zero it jumps and store 0600 in rA if value is not zero then it goes back fff7 which I think its -9 ,what do you think ?

 

by: hnaelPosted on 2009-04-29 at 01:44:53ID: 24258333

pls if I did not reply quick for ur comments this is because I have dr.appointment in half an hour time , nothing serious just not feeling well ....but sure as soon as I get reply I will keep in touch so patience ..patience ..thank you very much ...what mechanism best to use to know what the program is doing ? I understand is to run it and see what i does but when I did that nothing much happened ,all I could see increase in rE , DECREASE IN rB , and zero flag  is ticked when it got to zero and it jump back fff7 so .....

 

by: Infinity08Posted on 2009-04-29 at 01:47:00ID: 24258344

>> regarding denary means decimal yes but we have been tought to use denary otherwise the computer geeks gets upset haaa...

Heh. Well I've never heard of the term denary ;)


>> I presume that the adress 0500 is the lowest address in data memory and the higest is 0564 because this is the last value rE has got when rB got to 0000 in the simulater, is that correct ?

0500 is the lowest indeed. The load register-indirect instruction reads the value at the current memory address.

However, 0564 is not the highest ... In the last iteration of the loop, what will be the address ? In the first, it's 0500, in the second 0501, etc. And for the 100th iteration ?


>> all I can tel for now there is a loop going on for 100 times it increases rE by one , decrease the loop counter by one

Right.


>> it checkes whats in R1 (0,+.-)

And what's in r1 at that moment ?


>> when rB reach the value zero it jumps

Ok.


>> and store 0600 in rA

It's the other way around ... Think memory address again ;)


>> if value is not zero then it goes back fff7 which I think its -9 ,what do you think ?

Right. And to which instruction would that jump bring you ?

 

by: hnaelPosted on 2009-04-29 at 02:00:44ID: 24258404

I see so the higest must be 0500 in hex +100 which is 0600 , regarding where it jump back I have to run it again and see to which instruction it goes back , no wonder people are scared to read assembly language because its such apain sorry .

 

by: Infinity08Posted on 2009-04-29 at 02:04:08ID: 24258421

>> I see so the higest must be 0500 in hex +100 which is 0600

No. The loop only iterates 100 times (64 in hex), so in the last iteration, it will have incremented the address 0500 only 99 times ...

 

by: hnaelPosted on 2009-04-29 at 04:11:08ID: 24259068

oh yeh , usually its n-1 where n is the no of addresses - 1 to get the total so it must be 0599 thank you ,you r brilliant , how u understand it so much , I envay you for that excellant ,can you give me more clue of what the subroutine does pls .

 

by: Infinity08Posted on 2009-04-29 at 04:15:04ID: 24259095

>> so it must be 0599

Not quite. Remember that 0500 was in hexadecimal, and 99 in decimal ? You can't just add them like that ...

 

by: hnaelPosted on 2009-04-29 at 04:21:45ID: 24259132

oh my God , i am so stupid it must be 0500 + 0063 that is 0563 it must be correct this time ?
pls tel me correct .

 

by: Infinity08Posted on 2009-04-29 at 04:26:54ID: 24259161

>> is 0563 it must be correct this time ?

Yes :) 0563 is the memory address of the last processed item.


>> can you give me more clue of what the subroutine does pls .

Well, the load register-indirect instruction reads the item at the current memory address, and places it in r1.
What happens to r1 after that ?

 

by: hnaelPosted on 2009-04-29 at 04:45:11ID: 24259278

the instruction says load register -indirect via rE r1 so my understanding is it copies the contents of the location in data memory that corrospond to rE and put it in r1 so the contnts of rE means the contents of 0500 address  (which I do not know) and copy it in r1 !!!! its a puzzle to me how will I know the contents or rE ?

 

by: Infinity08Posted on 2009-04-29 at 04:48:06ID: 24259303

>> the instruction says load register -indirect via rE r1 so my understanding is it copies the contents of the location in data memory that corrospond to rE and put it in r1 so the contnts of rE means the contents of 0500 address  (which I do not know) and copy it in r1 !!!!

That's what I said, yes ;)


>> its a puzzle to me how will I know the contents or rE ?

rE contains the memory addresses that start at 0500 and are incremented on each iteration, remember ?
The data at those memory addresses is irrelevant to understanding what happens in the code. Knowing that it takes an item from the given memory address, and places it in r1 is sufficient to continue.

So, now that r1 contains a value read from memory, what happens to r1 after that ?

 

by: hnaelPosted on 2009-04-29 at 04:53:28ID: 24259340

what happen to r1 is the next instruction which is add immediate r1 0000 thats is add nothing to it (thats is what we said earliar to test the value or r1 )?

 

by: hnaelPosted on 2009-04-29 at 04:55:12ID: 24259350

or maybe you mean r1 will have the contents of rE whihc is 0500 so that will be r1 = 0500

 

by: Infinity08Posted on 2009-04-29 at 04:58:10ID: 24259374

>> what happen to r1 is the next instruction which is add immediate r1 0000 thats is add nothing to it (thats is what we said earliar to test the value or r1 )?

Go on ...

 

by: Infinity08Posted on 2009-04-29 at 04:59:23ID: 24259382

>> or maybe you mean r1 will have the contents of rE whihc is 0500 so that will be r1 = 0500

No, r1 contains the value at address 0500 - it doesn't contain the address 0500 (in the first iteration of the loop).

 

by: hnaelPosted on 2009-04-29 at 05:07:59ID: 24259452

so when add 0000 to r1 it does the test that is jump if negative relative 0001 so if the result in r1 negative then jump one step otherwise jump relative 0001 which means jump another time to get to the instruction subtract immediate rB 0001 (decrement the loop by one) once the loop reach to zero value that is rB =0000 JUMP ONCE  to get to the store direct rA 0600 (i.e copy the contents of rA the location with address 0600 otherwise go back fff7 .

 

by: Infinity08Posted on 2009-04-29 at 05:17:01ID: 24259533

>> so if the result in r1 negative then jump one step

Where to ? Which instruction ?


>> otherwise jump relative 0001

Where to ? Which instruction ?

 

by: hnaelPosted on 2009-04-29 at 14:53:21ID: 24265154

Hello again , ok if result is in r1 -ve then jump one instruction to add immediate rA 0001 otherwise  jump relative will get execute and jump one step to add immediate rE 0001 . I have to say I run the program 5 times and all its doing is incrementing rE by one every time and when loop get to zero it copy the content of rA into the location where the address is 0600 . so can I say the purpose is to incrementing rE by one .?

 

by: Infinity08Posted on 2009-04-29 at 15:25:50ID: 24265332

>> -ve then jump one instruction to add immediate rA 0001 otherwise  jump relative will get execute and jump one step to add immediate rE 0001 .

Right.


>> I have to say I run the program 5 times and all its doing is incrementing rE by one every time

It's doing something else too, isn't it ? You just mentioned it above ...


>> so can I say the purpose is to incrementing rE by one .?

No. Do you remember what rE holds ? What rE is used for ?

 

by: hnaelPosted on 2009-04-29 at 22:59:22ID: 24267259

rE is holding the value 0500 and I think its used for the" sum for now"  right or wrong ?

 

by: Infinity08Posted on 2009-04-30 at 00:42:58ID: 24267682

>> rE is holding the value 0500 and I think its used for the" sum for now"  right or wrong ?

If you remember from previous discussion, rE holds a memory address. Incrementing it means that it now points to the next item.

 

by: hnaelPosted on 2009-04-30 at 01:46:18ID: 24267941

so could I say the purpose of this subroutine is to show the next item or adding numbers ?

 

by: Infinity08Posted on 2009-04-30 at 01:55:19ID: 24267967

>> so could I say the purpose of this subroutine is to show the next item or adding numbers ?

It isn't "showing" anything.
It isn't adding any numbers (except for the increments).

So, no, that's not the purpose of the function ;)


Refer back to my earlier post http:#24265332, namely the second comment I made there ...

 

by: hnaelPosted on 2009-04-30 at 05:07:44ID: 24268968

right I looked into it , I got a question that got a table with memory mapped addresses like say 0f05 it means a buzzer etc, but the addresses I got say 0500 is not any where in the table I got that indicate what it does .so any thought on that pls .

 

by: Infinity08Posted on 2009-04-30 at 05:16:36ID: 24269044

>> but the addresses I got say 0500 is not any where in the table I got that indicate what it does .so any thought on that pls .

0500 is just a memory address ... It doesn't do anything special ... It's just a location in memory where some data can be found.
It doesn't matter which data either. All that matters is what the code does with that data ... We already figured out that there's a loop that loops over the first 100 items starting from that address. Now, what does it do with each of those 100 items ?

 

by: hnaelPosted on 2009-04-30 at 07:21:00ID: 24270204

each time the loop occure it repeat it again and again till 100 times done ..........what else it can be , this is really crazy .

 

by: Infinity08Posted on 2009-04-30 at 11:56:24ID: 24273220

>> each time the loop occure it repeat it again and again till 100 times done

It repeats what ?

Again, allow me to refer to my second comment in my earlier post http:#24265332. There is a decrement used for the loop counter, an increment used for going to the next item in memory, and one more increment. the latter one is the interesting one ... What does it do ?

 

by: hnaelPosted on 2009-04-30 at 11:58:34ID: 24273240

if you look at the file i sent , the only thing happen there is under zero flag you got a tick , that s to say at this stage in the program result is zero ,just once you execuate the nest step the zero flag is empted , so the whole purpose to teat if the rE Iis zero or not -ve and if zero it keeps doing the loop till it become -ve then it jumps out side the loop ? what do u think ?

 

by: Infinity08Posted on 2009-04-30 at 12:01:37ID: 24273277

No, that's not what's happening. Focus on the 3 lines starting with the "jump if negative". If the value read from memory is negative, what happens ?

 

by: hnaelPosted on 2009-04-30 at 12:05:58ID: 24273316

if te value read is -ve it jump one step and execute the instruction that is increase rA by one also increase rE by one and then subtract rB by one ......

 

by: Infinity08Posted on 2009-04-30 at 12:07:16ID: 24273326

>> and execute the instruction that is increase rA by one

ok.

And if it's not negative ?

 

by: hnaelPosted on 2009-04-30 at 12:10:03ID: 24273358

it will execute jump relative 0001 that is to jump one step and add rA BY one

 

by: hnaelPosted on 2009-04-30 at 12:11:15ID: 24273368

sorry I meant rE by one not rA

 

by: Infinity08Posted on 2009-04-30 at 12:11:46ID: 24273378

>> it will execute jump relative 0001 that is to jump one step and add rA BY one

Are you sure ? Where does the jump relative jump to ?
Or put differently : if it just goes to the next instruction, what's the point of the jump ?

 

by: Infinity08Posted on 2009-04-30 at 12:12:36ID: 24273384

>> sorry I meant rE by one not rA

Ah, ok.

So, there's different behavior when the value is negative, than when it's positive. So, can you explain what the function does now ?

 

by: hnaelPosted on 2009-04-30 at 12:21:26ID: 24273460

well , I can try , testing the value weather its +ve , -ve or zero? I hope this correct my brain is dead from it , I spnt so much time on it .

 

by: Infinity08Posted on 2009-04-30 at 12:22:52ID: 24273469

Ok, different approach : what will rA contain at the end of the loop ?

 

by: hnaelPosted on 2009-04-30 at 12:25:43ID: 24273505

rA did not change it staed zero !!

 

by: Infinity08Posted on 2009-04-30 at 12:26:56ID: 24273519

>> rA did not change it staed zero !!

Just look at the code ... Ignore your tool.

What will rA contain ?

I'm not looking for a specific value - just a description of the value.

 

by: hnaelPosted on 2009-04-30 at 12:32:53ID: 24273571

rA will contain the final value . right when loop is finished

 

by: Infinity08Posted on 2009-04-30 at 12:36:37ID: 24273592

>> rA will contain the final value . right when loop is finished

Come on, just think about it. It's right in front of you ... if the value read from memory is negative, rA is incremented, if it's not, then it's not incremented ... So, what will rA contain in the end ?

I can't give you any better hints than that ... Just think about it.

 

by: hnaelPosted on 2009-04-30 at 12:39:44ID: 24273624

okay mate , thank you very much I will accept the answer because you really done great job .pls I may trouble you with more questions ,not assighment haaa ,have a great evening , I am closing it ,I am off for a coffee it might open my mind for an answer haa ,thks

 

by: hnaelPosted on 2009-04-30 at 12:40:43ID: 31574881

I have to say such a great help from infinity08

 

by: Infinity08Posted on 2009-04-30 at 12:48:57ID: 24273709

So, did you find the solution ? Feel free to post your thoughts here ...

 

by: hnaelPosted on 2009-04-30 at 13:23:10ID: 24274046

I would say the function of this loop is a decesion making about the value being +ve , -ve or zero

 

by: Infinity08Posted on 2009-04-30 at 13:23:59ID: 24274055

There's not just one value. There are 100 values ...

 

by: hnaelPosted on 2009-04-30 at 13:26:15ID: 24274080

you mean I should say values not value , but is it correct though ?

 

by: Infinity08Posted on 2009-04-30 at 13:28:50ID: 24274105

No. There is a loop that does something for each of those 100 values.

What does it do ? (we've already discussed that at length)
What will the value in rA be at the end ?

 

by: hnaelPosted on 2009-05-01 at 08:24:31ID: 24280341

Hi, this is driving me mad. Is function turning something on and off?

 

by: Infinity08Posted on 2009-05-01 at 09:41:24ID: 24281127

No.

Maybe it might be useful to re-read this whole thread. It's full of very clear hints.

Ignore the application you use. Just look at the code. Make notes about what it does in pseudo code, so you can easily follow what's happening.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...