List of comparison commands on DLX program
Signed numbers Comparison
slt rd, rs1, rs2 ; set rd to 1 if rs1 < rs2, otherwise set rd to 0
sle rd, rs1, rs2 ; set rd to 1 if rs1 ≤ rs2, otherwise set rd to 0
sgt rd, rs1, rs2 ; set rd to 1 if rs1 > rs2, otherwise set rd to 0
sge rd, rs1, rs2 ; set rd to 1 if rs1 ≥ rs2, otherwise set rd to 0
Unsigned numbers Comparison
sltu rd, rs1, rs2 ; set rd to 1 if rs1 < rs2, otherwise set rd to 0
- Set Less than or equal -Unsigned
sleu rd, rs1, rs2 ; set rd to 1 if rs1 ≤ rs2, otherwise set rd to 0
- Set Greater than -Unsigned
sgtu rd, rs1, rs2 ; set rd to 1 if rs1 > rs2, otherwise set rd to 0
- Set Greater than or eual -Unsigned
sgeu rd, rs1, rs2 ; set rd to 1 if rs1 ≥ rs2, otherwise set rd to 0
Check condtition result register rd by using
branch true or branch false Instuction
Tags:DLX programming, DLX Comparison,DLX Arithmatic Comparison, DLX If Statement
0 comments:
Post a Comment