- .begin
- .org 2048
- mov %r0, %r20 ! %r20 = memory offset
- mov %r0, %r21 ! %r21 = SUM
- AddThree:
- ld [ INPUT + %r20 ], %r10
- add %r10, %r21, %r21
- subcc %r10, 0, %r0
- add %r20, 4, %r20
- add %r22, 1, %r22
- cmp %r22, 3
- bne AddThree
- StoreResult:
- mov %r21, %r4
- st %r4, [OUTPUT]
- mov %r0, %r21
- mov %r0, %r22
- halt
- INPUT: 10
- 10
- 10
- 20
- 20
- 20
- 30
- 30
- 30
- 40
- 40
- 40
- 0
- 0
- 0
- OUTPUT:
- END:
- .end
AHHHH
By: microhaxo | Date: Jun 26 2009 23:40 | Format: None | Expires: never | Size: 563 B | Hits: 975
Latest pastes
1 hours ago
11 hours ago
1 days ago
2 days ago
2 days ago