JMC <line>, <condition> Read one value from the CPU register If the value is equal to <condition>, put the value <line> in the program counter; thus, the next line to be executed will be <line> Examples: JMC 1, true JMC 14, false JMC 75, true
int a; int b; a = 10; while (a>1){ print (a); } return; } int a global 0 int b global 0 @ LIT 10, 0 STO a, 0 LOD a, 0 LIT 1, 0 OPR 11, 0 ; > JMC #e1, false LOD a, 0 OPR 20, 0 ; print JMP #e2, 0 OPR 1, 0 OPR 0, 0
while { int a; int b; a = 10; while (a>1){ print (a); } return; } int a global 0 int b global 0 int #e1 global 10 int #e2 global 3 LIT 10, 0 STO a, 0 LOD a, 0 LIT 1, 0 OPR 11, 0 ; > JMC #e1, false LOD a, 0 OPR 20, 0 ;print JMP #e2, 0 OPR 1, 0 OPR 0, 0
if { int a; int b; a = 10; if (a>1) { print (a); } else { print (b); } return; } int a global 0 int b global 0 int #e1 global 10 int #e2 global 12 LIT 10, 0 STO a, 0 LOD a, 0 LIT 1, 0 OPR 11, 0 ; > JMC #e1, false LOD a, 0 OPR 20, 0 ;print JMP #e2, 0 LOD b, 0 OPR 20, 0 ;print OPR 1, 0 OPR 0, 0
slides can only be used as study material for the Compilers course at Universidad Panamericana. They cannot be distributed or used for another purpose.