![]() |
I called bricks the short pieces of code, that "COMPAS" generate as a part of operator. Compiler builds result machine code from the bricks. Step 1 (extract first operand to R1) Step 2 (compare with the second operand) Step 3 (jump, if condition is FALSE) Condition analysis: step 1 (extract first operand to R1) (see step 1 for assign operator) Back to: Condition analysis: step 2 (compare with the second operand) Compare simple variable (e.g. a) or variable with concrete index (e.g. b[2]) with R1 (assume, that variable address is 90):
Compare index variable (e.g. b[i]) with R1 (assume, that i address is 90 and b[0] address is D0):
Compare constant >15 with R1 (assume, that constant is 40):
Compare constant <=15 with R1 (assume, that constant is 1010=A16):
Back to: Condition analysis: step 3 (jump, if condition is FALSE) Jump instructions for different conditions:
Back to: Examples of full conditions 1. i < k (DE - address of variable i, DC - k)
2. 2 = a[i] (DE - address of variable i, D0 - a[0])
Back to: |