Forum Discussion
Altera_Forum
Honored Contributor
16 years agonios ii psedo-instruction and equivalent instruction
Hello,everyone.
I'm am learning nios ii instruction set. Can anybody explain psedo-instruction and equivalent instruction, for example( from Altera Nios ii processor reference handbook): psedo-instruction equivalent instruction bgt rA, rB, label blt rB, rA, label bgt (psedo-instruction) Operation: if ((signed) rA > (signed) rB) then PC ←label else PC ←PC + 4 Assembler Syntax: bgt rA, rB, label blt (equivalent instruction) Operation: if ((signed) rA < (signed) rB) then PC ←PC + 4 + σ (IMM16) else PC ←PC + 4 Assembler Syntax: blt rA, rB, label bgt(psedo-instruction) and blt(equivalent instruction) are equivalent ? When they are else statements, they are equivalent. But, i think if conditons are met, they are not equivalent : bgt : PC ←label, however ,blt: PC ←PC + 4 + σ (IMM16) Can someone explain it ? Best regards hanshaohua4 Replies
- Altera_Forum
Honored Contributor
--- Quote Start --- bgt (psedo-instruction) Operation: if ((signed) rA > (signed) rB) then PC ←label else PC ←PC + 4 Assembler Syntax: bgt rA, rB, label blt (equivalent instruction) Operation: if ((signed) rA < (signed) rB) then PC ←PC + 4 + σ (IMM16) else PC ←PC + 4 Assembler Syntax: blt rA, rB, label --- Quote End --- This is wrong whether in the original form or by transcription in this post. They are not equivalent, but this is not correct since it should be: rA > rB and rB < rA I see reference elsewhere to: bgt rA, rB, label is the same as blt rB, rA, label which is of course correct. Bill - Altera_Forum
Honored Contributor
Hi,bill.
Can you explain it more clear ? I can't catch what you mean. :) - Altera_Forum
Honored Contributor
The pseudo-opcode
bgt rA, rB, label is the same as blt rB, rA, label because rA < rB is the same as rB > rA You mention conditions where they are not equal which is true for what was in your original post, however your original post isn't correct. Bill - Altera_Forum
Honored Contributor
--- Quote Start --- The pseudo-opcode bgt rA, rB, label is the same as blt rB, rA, label because rA < rB is the same as rB > rA You mention conditions where they are not equal which is true for what was in your original post, however your original post isn't correct. Bill --- Quote End --- Yes, thank you!