1 Jun 2013

Comparing registers on DLX program

List of comparison commands on DLX program

Signed numbers Comparison
  • Set Less than
slt rd, rs1, rs2 ; set rd to 1 if rs1 < rs2, otherwise set rd to 0
  • Set Less than or equal
sle rd, rs1, rs2 ; set rd to 1 if rs1 ≤ rs2, otherwise set rd to 0
  • Set Greater than
sgt rd, rs1, rs2 ; set rd to 1 if rs1 > rs2, otherwise set rd to 0
  • Set Greater than or eual
sge rd, rs1, rs2 ; set rd to 1 if rs1 ≥ rs2, otherwise set rd to 0


Unsigned numbers Comparison 


  • Set Less than -Unsigned
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

Popular Posts