- Timestamp:
- 08/07/2017 02:04:35 PM (7 years ago)
- Branches:
- master
- Children:
- 27c8d40
- Parents:
- 84c0125
- Location:
- lib700
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
lib700/jumpto.s
r84c0125 r8325447 40 40 .text 41 41 42 .xdef _halt,_jumpto,_rjumpto,_sjumpto,_xreset42 .xdef halt,jumpto,rjumpto,sjumpto,xreset 43 43 44 44 .page 45 45 46 _halt: stop #0x2700 | stop dead, interrupts disabled47 jmp _halt | stay stopped if stepped thru46 halt: stop #0x2700 | stop dead, interrupts disabled 47 jmp halt | stay stopped if stepped thru 48 48 49 _jumpto:movea.l 4(a7),a0 | get jump address49 jumpto: movea.l 4(a7),a0 | get jump address 50 50 jmp (a0) | go to the jump address 51 51 52 _rjumpto: reset | reset external devices52 rjumpto: reset | reset external devices 53 53 movea.l 4(a7),a0 | get jump address 54 54 jmp (a0) | go to the jump address 55 55 56 _sjumpto: movea.l 4(a7),a0 | get jump address56 sjumpto: movea.l 4(a7),a0 | get jump address 57 57 movea.l 8(a7),a7 | set stack pointer 58 58 jmp (a0) | go to the jump address 59 59 60 _xreset:reset | reset external devices60 xreset: reset | reset external devices 61 61 rts | return to caller 62 62 -
lib700/rand24.s
r84c0125 r8325447 29 29 .text 30 30 31 .xdef _rand2431 .xdef rand24 32 32 33 33 .xdef _rseed … … 87 87 .page 88 88 89 | _rand24 -- Generate a random number90 | ------ -------------------------91 _rand24:link a6,#0 | Link stack frames89 | rand24 -- Generate a random number 90 | ------ ------------------------ 91 rand24: link a6,#0 | Link stack frames 92 92 tst.l _rseed | See if the seed is zero 93 93 bne rand01 | Jump if not -
lib700/setjmp.s
r84c0125 r8325447 6 6 .text 7 7 8 .xdef _setjmp,_longjmp8 .xdef setjmp,longjmp 9 9 10 _setjmp:movea.l 4(a7),a0 | Get env pointer10 setjmp: movea.l 4(a7),a0 | Get env pointer 11 11 move.l (a7),(a0) | Put return address in env 12 12 movem.l d1-d7/a1-a7,4(a0) | Save registers in env … … 14 14 rts | Return to caller 15 15 16 _longjmp: move.w 8(a7),d0 | Get ret value16 longjmp: move.w 8(a7),d0 | Get ret value 17 17 bne lj1 | Jump if non-zero 18 18 -
lib700/uldiv.s
r84c0125 r8325447 3 3 | Version 2 -- 1987-06-08 -- D.N. Lynx Crowe 4 4 | Lifted from the Alcyon C library by disassembly so I could fix a bug - 5 | _uldivr must be in the bss segment so the code will work in PROM.5 | uldivr must be in the bss segment so the code will work in PROM. 6 6 7 7 | long … … 19 19 .text 20 20 21 .xdef _uldiv,_uldivr21 .xdef uldiv,uldivr 22 22 23 23 DIVIDEND = 8 24 24 DIVISOR = 12 25 25 26 _uldiv: link a6,#0 | Link stack frames26 uldiv: link a6,#0 | Link stack frames 27 27 movem.l d3-d7,-(a7) | Save registers 28 28 move.l DIVIDEND(a6),d7 | d7 = DIVIDEND … … 31 31 bne notdzero | Jump if not 32 32 33 move.l #0x80000000, _uldivr | Force error result33 move.l #0x80000000,uldivr | Force error result 34 34 move.l #0x80000000,d0 | ... by dividing 35 35 divu #0,d0 | ... by zero … … 39 39 bls notunflo | Jump if not 40 40 41 move.l d7, _uldivr | Remainder = dividend41 move.l d7,uldivr | Remainder = dividend 42 42 clr.l d0 | Quotient = 0 43 43 bra ulexit | Exit … … 81 81 bra divloop3 | Loop for next bit 82 82 83 setreslt: move.l d7, _uldivr | Store remainder83 setreslt: move.l d7,uldivr | Store remainder 84 84 move.l d5,d0 | Put quotient in d0 85 85 … … 92 92 .even 93 93 94 _uldivr:.ds.l 194 uldivr: .ds.l 1 95 95 96 96 .end
Note:
See TracChangeset
for help on using the changeset viewer.