|
|
1.1 ! root 1: dsect data ! 2: csect code ! 3: align 2 ! 4: global _runerr ! 5: global _ckadd ! 6: global _cksub ! 7: global _ckmul ! 8: ! 9: ! 10: _ckadd: ! 11: load r0,r14,24 ; r0 gets first argument ! 12: load r1,r14,32 ; r1 gets second argument ! 13: add r0,r1 ; Perform addition ! 14: ;br oflow,L ; Branch if overflow ! 15: ret r11,r11 ; Return result in r0 ! 16: ! 17: dsect data ! 18: csect code ! 19: align 2 ! 20: _cksub: ! 21: load r0,r14,24 ; r0 gets first argument ! 22: load r1,r14,32 ; r1 gets second argument ! 23: sub r0,r1 ; Perform subtraction ! 24: ;br oflow,L ; Branch if overflow ! 25: ret r11,r11 ; Return result in r0 ! 26: ! 27: dsect data ! 28: csect code ! 29: align 2 ! 30: _ckmul: ! 31: load r0,r14,24 ; r0 gets first argument ! 32: load r1,r14,32 ; r1 gets second argument ! 33: mpy r0,r1 ; Perform multiplication ! 34: ;br oflow ; Branch if overflow ! 35: ret r11,r11 ; Return result in r0 ! 36: ! 37: oflow: ; Got overflow on an operation ! 38: laddr r14,r14,-40 ! 39: movei r0,0 ! 40: store r0,r14,32 ! 41: laddr r0,23 ! 42: store r0,r14,24 ! 43: call r11,_runerr,L ; runerr(203,0) ! 44:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.