正在加载图片...
Three-Address Statements (cont.) Conditional Jumps:jmprelop y,z,L or if y relop z goto L We will jump to the three-address code with the label L if the result ofy relop z is true,and the execution continues from that statement.If the result is false,the execution continues from the statement following this conditional jump statement. Ex: jmpgt y,Z,L1 //jump to Ll if y>z jmpgte y,Z,L1 /jump to Ll ify>=z jmpe y,z,L1 /jump to Ll ify=-z jmpne y,Z,L1 /jump to Ll if y!=z Our relational operator can also be a unary operator. jmpnz Y,,L1 /jump to Ll ify is not zero jmpz y,,L1 /jump to Ll ify is zero jmpt y,,L1 /jump to Ll ify is true jmpf y,,L1 /jump to Ll ify is false CS308 Compiler Theory 6Three-Address Statements (cont.) Conditional Jumps: jmprelop y,z,L or if y relop z goto L We will jump to the three-address code with the label L if the result of y relop z is true, and the execution continues from that statement. If the result is false, the execution continues from the statement followin g jp this conditional jum p statement. Ex: jmpgt y,z,L1 // jump to L1 if y>z jmpgte y,z,L1 // jump to L1 if y>=z jmpe y,z,L1 // jump to L1 if y==z jmpne y,z,L1 // jump to L1 if y!=z Our relational operator can also be a unary operator. jmpnz y,,L1 // jump to L1 if y is not zero j L1 mpz y,,L1 // j t L1 if i // jump to L1 if y is zero jmpt y,,L1 // jump to L1 if y is true jmpf y,,L1 // jump to L1 if y is false CS308 Compiler Theory 6 jmpf y,,L1 // jump to L1 if y is false
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有