Page 1 of 2

Opcode: BXLE

PostPosted: Thu Nov 17, 2011 11:31 pm
by RISCCISCInstSet
I'm having a strange issue with BXLE.

It's described by:

BXLE Instruction

— BXLE stands for Branch on Index Low or Equal

— The format is
BXLE R_1,R_3,D_2(B_2)
— R_3 should denote an even-odd pair of registers

— R_3 is added to R_1

— R_1 is compared to R_3+1

— If R_1 is less than or equal to R_3+1, control passes to the address designated by D_2(B_2)

— If R_3 is odd, it is both the increment AND the limit

However, I still need to understand what type of data the instruction takes (and maybe whatever else was left out :?: :!: such as preparation; don't know if it is applicable)

Anyway, could you describe how I need to use this instruction?

Re: Opcode: BXLE

PostPosted: Thu Nov 17, 2011 11:35 pm
by BillyBoyo
All the instructions you have to look up in the Principles of Operation. Do a google, download a PDF, look up instructions as you need them, note the different sorts of instruction groupings, look at the examples, pick up a bit here-and-there. If there is something you don't follow, first work on it, then ask here stating what it is that you understand, and what you don't.

The informal name for BXLE, or where I come from anyway, is Backaxle :-) won't help you in the slightest, just thought to mention it because it is what I think of every time I see it.

Re: Opcode: BXLE

PostPosted: Fri Nov 18, 2011 12:11 am
by dick scherrer
Hello,

Anyway, could you describe how I need to use this instruction?
Sounds like you have a "solution" in search of a requirement. . .

You may never needto use this instruction. Read the specifics in the Principles of Operations and then decide when you might use it. You might also do a bit of experimenting and see if this is something you might want to use. I know of no requirement where this must be used.

Re: Opcode: BXLE

PostPosted: Fri Nov 18, 2011 12:41 am
by RISCCISCInstSet
I possibly need to use this instruction. The reason for that is I have an assignment expressly requesting this instruction, lol. :D

Re: Opcode: BXLE

PostPosted: Fri Nov 18, 2011 12:45 am
by enrico-sorichetti
The reason for that is I have an assignment expressly requesting this instruction

if the requirement is described clearly and You have meditated long enough on the POP it should not be that difficult to solve the issue Yourself

Re: Opcode: BXLE

PostPosted: Fri Nov 18, 2011 1:07 am
by dick scherrer
Hello,

The reason for that is I have an assignment expressly requesting this instruction
Then do the experimenting i mentioned earlier and use one of these to complete the assignment. Unless the assignment includes some kind of specifications - then follow the specifications.

Re: Opcode: BXLE

PostPosted: Fri Nov 18, 2011 1:15 am
by enrico-sorichetti
follow on
a simple google search with bxh bxle verbatim returned quite a few links with examples and clear explanation

Re: Opcode: BXLE

PostPosted: Fri Nov 18, 2011 2:37 am
by BillW
Main purpose of this instruction is to control a loop through a table. You get the address of the table beginning, the length of the table element (which may be single variables or a structure of variables), and the ending address of the table. You loop through the table for whatever purpose you need letting the bxle instruction setup the address of the next element and loop back to the "top" of your loop. You should consider, if this is a search of the table that you want to leave the loop (and not let the bxle continue) or if not found in the table, the bxle instruction will fall through to the NSI (Next Sequential Instruction). This should give you something to think about.

Re: Opcode: BXLE

PostPosted: Fri Nov 18, 2011 3:06 am
by RISCCISCInstSet
I find this information pretty useful - thanks.

Re: Opcode: BXLE

PostPosted: Fri Nov 18, 2011 3:41 am
by steve-myers
Once you figure out this code fragment you will have a pretty good idea of how to use BXLE and BXH.
         LA    14,ARRAY
         LA    0,4
         LA    1,ARRAYEND
LOOP1    LR    15,14
         BXH   15,0,LOOP4
LOOP2    L     2,0(,14)
         C     2,0(,15)
         BNH   LOOP3
         XC    0(4,14),0(15)
         XC    0(4,15),0(14)
         XC    0(4,14),0(15)
LOOP3    BXLE  15,0,LOOP2
         BXLE  14,0,LOOP1
         DC    H'0'
LOOP4    NOPR  0
         ...
ARRAY    DC    F'6,3,10'
ARRATEND DC    F'-5'
Hint: The DC H'0' "instruction" is never executed. Why?