- Timestamp:
- 08/07/2017 02:04:35 PM (7 years ago)
- Branches:
- master
- Children:
- 27c8d40
- Parents:
- 84c0125
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
prolog/fsmain.s
r84c0125 r8325447 13 13 .xdef start_ 14 14 15 .xref _Croot15 .xref Croot 16 16 17 .xdef _panic18 .xdef _brk17 .xdef panic 18 .xdef brk 19 19 20 .xdef _ _heap21 .xdef _ _break22 .xdef _ _pmesg20 .xdef _heap 21 .xdef _break 22 .xdef _pmesg 23 23 24 .xdef _errno24 .xdef errno 25 25 26 26 p_bbase = 0x18 | bss base … … 53 53 move.l p_bbase(a1),d0 | Calculate break address 54 54 add.l p_blen(a1),d0 | ... 55 move.l d0,_ _break | Set initial break56 move.l d0,_ _heap | Set heap start55 move.l d0,_break | Set initial break 56 move.l d0,_heap | Set heap start 57 57 58 58 move.l #0,-(a7) | Pass NULL to Croot (no command line) 59 jsr _Croot | call Croot() routine59 jsr Croot | call Croot() routine 60 60 addq.l #4,a7 | ... 61 61 62 62 move.l #pmsg1,-(a7) | panic(pmsg1); 63 jsr _panic | ...63 jsr panic | ... 64 64 addq.l #4,a7 | ... 65 65 … … 69 69 .page 70 70 71 | _panic -- hard halt for fatal errors72 | ----- ---------------------------73 _panic: movea.l 4(a7),a0 | Save panic message address74 move.l a0,_ _pmesg | ...71 | panic -- hard halt for fatal errors 72 | ----- -------------------------- 73 panic: movea.l 4(a7),a0 | Save panic message address 74 move.l a0,_pmesg | ... 75 75 76 76 trap #15 | Invoke ROMP (we hope ...) … … 81 81 .page 82 82 83 | _brk -- set break value84 | --- ----------------83 | brk -- set break value 84 | --- --------------- 85 85 | WARNING: This only works if the stack is above the heap. 86 86 87 _brk: cmpa.l __break,a7 | compare current break with stack87 brk: cmpa.l _break,a7 | compare current break with stack 88 88 bcs pstop | actual stack overflow! 89 89 … … 94 94 bcs badbrk | bad break; 95 95 96 move.l d0,_ _break | OK break: save the break96 move.l d0,_break | OK break: save the break 97 97 clr.l d0 | Set OK return 98 98 rts | return … … 118 118 .even 119 119 120 _ _pmesg:.ds.l 1 | panic() message string address121 _ _heap: .ds.l 1 | Heap start (initial break)122 _ _break:.ds.l 1 | Current break location123 _errno: .ds.w 1 | System error number120 _pmesg: .ds.l 1 | panic() message string address 121 _heap: .ds.l 1 | Heap start (initial break) 122 _break: .ds.l 1 | Current break location 123 errno: .ds.w 1 | System error number 124 124 125 125 .end
Note:
See TracChangeset
for help on using the changeset viewer.