home *** CD-ROM | disk | FTP | other *** search
-
- ; StormC Startupcode
- ; $VER StormC Startupcode 1.05 (21.02.95)
-
- ; Copyright HAAGE & PARTNER Computer GmbH
-
- ; datamodel: FAR
- ; codemodel: FAR
-
- ; This is a minimal startup code. The "normal" functionality (open
- ; dos.library, build argc/argv etc) is done by other functions from
- ; storm.lib
-
-
- XDEF _exit
- XDEF abort__STANDARD
- XDEF _SysBase
-
- XREF _InitModules
- XREF _CleanupModules
- XREF main_
- XREF wbmain__P09WBStartup
-
- TTL "FAR"
-
- Forbid = -132
- GetMsg = -372
- ReplyMsg = -378
- WaitPort = -384
-
- SECTION "startup",CODE
-
- move.l 4.w,a6
- move.l a6,_SysBase
- move.l a7,returnAddress ; Save stack pointer for exit and abort
-
- move.l $114(a6),a1 ; ThisTask
- tst.l $AC(a1)
- bne .cli
-
- ; Run from Workbench
- lea $5C(a1),a0
- move.l a0,-(a7)
- jsr WaitPort(a6)
- move.l (a7)+,a0
- jsr GetMsg(a6)
- move.l d0,StartupMessage
- jsr _InitModules ; Call INIT functions
- move.l StartupMessage,-(a7)
- jsr wbmain__P09WBStartup ; Call WB main function (C++ version)
- addq.l #4,a7
- jsr _CleanupModules ; Call EXIT functions
- move.l _SysBase,a6
- jsr Forbid(a6)
- move.l StartupMessage,a1
- jsr ReplyMsg(a6)
- moveq #0,d0
- rts
-
- .cli
- move.l a0,-(a7)
- move.l d0,-(a7)
- jsr _InitModules ; Call INIT functions
- jsr main_ ; Call main function (C++ version)
- addq.l #8,a7
- move.l d0,-(a7)
- jsr _CleanupModules ; Call EXIT functions
- move.l (a7)+,d0
- rts
-
- SECTION "exit",CODE
-
- _exit
- move.l 4(a7),d0
- move.l returnAddress,a7 ; Restore stack pointer
- move.l d0,-(a7)
- jsr _CleanupModules ; Call EXIT functions
- move.l StartupMessage,d2
- beq .nowb
- move.l _SysBase,a6
- jsr Forbid(a6)
- move.l d2,a1
- jsr ReplyMsg(a6)
- .nowb
- move.l (a7)+,d0
- rts
-
- SECTION "abort_STANDARD",CODE
-
- abort__STANDARD
- move.l returnAddress,a7 ; Restore stack pointer
- move.l StartupMessage,d2
- beq .nowb
- move.l _SysBase,a6
- jsr Forbid(a6)
- move.l d2,a1
- jsr ReplyMsg(a6)
- .nowb
- moveq #3,d0
- rts
-
- SECTION "startupd",DATA
-
- _SysBase
- dc.l 0
- returnAddress
- dc.l 0
- StartupMessage
- dc.l 0
-
- END
-