20 likes | 105 Vues
Block-structured. goto C. Assembly. cmp #3, &x jnz x_not_3 mov #4, &y jmp end_not3 x_not_3: mov #5, &y end_not3:. if (x!= 3) goto x_not_3; y = 4; goto end_not3; x_not_3: y = 5; end_not3:. if ( x==3 ) y = 4; else y = 5;. Expression. Parse Tree. Assembly. =.
E N D
Block-structured goto C Assembly cmp #3, &x jnz x_not_3 mov#4, &y jmp end_not3 x_not_3: mov #5, &y end_not3: if (x!=3)goto x_not_3; y = 4; gotoend_not3; x_not_3: y = 5; end_not3: if (x==3) y = 4; else y = 5;
Expression Parse Tree Assembly = mov &b, r4 ; r4 := b rra r4 ; r4 := b / 2 add &a, r4 ; r4 := a + b / 2 mov #d, r5 ; r5 := &d mov r4, 0(r5) ; *r5 := r4 (r4) (r5) + * *d = a + b / 2; (r4) a / d b 2