View previous topic :: View next topic
|
Author |
Message |
subhasis_50
Moderator
Joined: 09 Mar 2005 Posts: 363 Location: Earth
|
|
|
|
Hi,
I want to know how BXLE instruction works. Please explain with example. |
|
Back to top |
|
|
ajita_aju
New User
Joined: 20 May 2005 Posts: 2
|
|
|
|
BXLE has three parameters.
ex. BXLE 3,4,LOOP
Basics:The first two are registers while the last one is a memory location.
The second operand is an even-odd register pair.
Defn: The instruction stands for Branch on Less than or equal to.
Explanation:
In the given example register 3 should have the contents of an address location and similarly register 5 (hidden in the even-odd register pair) will have contents of an address location. Register 4 will have a value that serves as a count for incrementing.
The contents of register 3 is incremented by the value in register 4 and the result is compared with the contents of register 5. If the result is less than or equal to the contents of register 5 a branch takes place to the location pointed by the third operand (LOOP).
A practical example is where you store the starting address of an array in register 3 and the ending address of the same array in register 5. Considering that each element of the array is of the same lenght, store the length of element in register 4.
Hope this explains. |
|
Back to top |
|
|
ajita_aju
New User
Joined: 20 May 2005 Posts: 2
|
|
|
|
Just to add one more point, By contents of an address location, I mean the address itself. |
|
Back to top |
|
|
subhasis_50
Moderator
Joined: 09 Mar 2005 Posts: 363 Location: Earth
|
|
|
|
Hi Aju,
Thanks a lot for your clear explanation. |
|
Back to top |
|
|
|