Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .pos 0x1000
- ld $s, r0 #r0 = &s - load s into r0
- ld (r0), r0 #r0 = value of r0 - load value of s into r0
- ld (r0), r1 #r1 = value of r0 - load value of s into r1
- ld 4(r0), r2 #r2 = r0+4 - load value of s + 4 into r2
- ld 4(r1), r3 #r3 = r1 + 4 - load value s+ 4 into r3
- st r3, (r2) #m[r2] = r3 - store contents of r3 into memory r2
- ld 4(r2), r3 #r3 = r2 + 4 - load value of s +4 +4 into r3
- st r3, (r1) #m[r1] = r3 - store contents of r1 into memory r3
- halt
- .pos 0x2000
- s: .long d0
- # END OF STATIC ALLOCATION
- # DYNAMICALLY ALLOCATED HEAP SNAPSHOT
- # (malloc'ed and dynamically initialized in c version)
- d0: .long d1
- .long d2
- d1: .long 1
- .long 2
- d2: .long 3
- .long 4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement