- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 hanshaohuaLink Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,bill.
Can you explain it more clear ? I can't catch what you mean. :)- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- 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!

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page