CS501 Assignment No. 1 Fall 2011 Solution
Friday, October 28, 2011 Posted In CS and IT Edit This3-address | 2-address | 1-address | 0-address |
Add a,c,4 mpy a,a,15 sub a,a,b | Load a,c Add a,4 Mpy a,15 Sub a,b | Lda c Add 4 Mpy 15 Sub b Sta a | Push c Push 4 Add Push 15 Mpy Push b Sub Pop a |
3-ADDRESS INSTRUCTIONS | 2-ADDRESS INSTRUCTIONS | 1-ADDRESS INSTRUCTIONS | 0-ADDRESS INSTRUCTIONS |
add x,b,c | load y,b | ida d | push d |
add y,d,e | add y,c | adda e | push e |
mul a,x,y | load r,d | sta s | add |
| add r, e | ida b | push b |
| mul y,r | adda c | push c |
| store a,y | mula s | add |
| | sta z | mul |
| | | pop a |