home *** CD-ROM | disk | FTP | other *** search
- Path: felix.teclink.net!usenet
- From: rad@teclink.net (rad)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Replying to WB Startup message with Sas/C
- Date: 16 Feb 1996 04:25:57 GMT
- Organization: TECLink Internet Services: info@TECLink.Net
- Message-ID: <2635.6619T1326T1642@teclink.net>
- References: <717.6614T755T957@codeworks.gen.nz>
- NNTP-Posting-Host: tc2_54.teclink.net
- Mime-Version: 1.0
- Content-Type: multipart/mixed; boundary="p3TteRS0KXB1gGr8GgR11ND1kkZAlLD31"
- X-Newsreader: THOR 2.22 (Amiga;TCP/IP) *UNREGISTERED*
-
- If you are able to read this, your reader is not MIME compliant.
- If you are using an Amiga, use THOR to avoid the problem.
- If you are not, use some other MIME compliant reader.
-
- --p3TteRS0KXB1gGr8GgR11ND1kkZAlLD31
- Content-type: text/plain; charset=us-ascii
- Content-transfer-encoding: 7bit
-
- Tom Parker <tparker@codeworks.gen.nz> writes:
-
- >I'm using Sas/C 6.56, and I'm linking WITHOUT the startup code. I would like
- >to run my program from the Workbench, so i have to reply to the WBStartup
- >message. The Sas documentation doesn't tell me how to do this, and the RKM's
- >just say that the startup code should handel it.
-
- >Does anyone know how to reply to this message, or, just get a pointer to it
- >in the first place. The RKM's say that there should be a pointer to it in A0
- >when i start up (it's been a while, it might be a different register...), but
- >i'll be damned if i know how to get hold of it.
-
- Attached is one way of retreiving the workbench startup message. Note that
- this is written in the new Motorola format, you'll have to convert it to
- use SAS's assembler. I think you should be able to figure out how to reply
- using the autodocs for ReplyMsg.
-
- INCLUDE "lvo/exec_lvo.i" ; generated from exec.fd
- INCLUDE "dos/dosextens.i"
-
- SECTION text,code
-
- start_segment move.l (4).w,a6 ; load _SysBase
- sub.l a1,a1 ; Get this process's
- ; process structure
- jsr (_LVOFindTask,a6) ; (should never access
- ; system structs
- ; directly)
- move.l d0,a4
- moveq #0,d7 ; WBenchMsg = NULL;
- tst.l (pr_TaskNum,a4) ; if started from CLI goto
- ; .save_wb_msg
- bne.b .save_wb_msg
- .get_wb_msg lea (pr_MsgPort,a4),a0 ; get workbench startup
- ; message
- jsr (_LVOWaitPort,a6)
- lea (pr_MsgPort,a4),a0
- jsr (_LVOGetMsg,a6)
- move.l d0,d7
- beq.b .get_wb_msg
- .save_wb_msg move.l d7,__WBenchMsg ; save startup message
- ; (if any)
-
- SECTION udata,bss
-
- __WBenchMsg ds.l 1
-
- END
-
- --------------------------------------------------------------------------
- - Richard Deken E-Mail: (personal) rad@teclink.net -
- - VLSI design engineer (AuE business) rad@aue.com -
- - Advanced Microelectronics PGP public key available -
- --------------------------------------------------------------------------
-
- --p3TteRS0KXB1gGr8GgR11ND1kkZAlLD31
- Content-type: text/plain; charset=ISO-8859-1; name="a.a"
- Content-transfer-encoding: base64
-
- ICAgICAgICAgICAgICBJTkNMVURFICJsdm8vZXhlY19sdm8uaSIgICAgICAgICAgICAgIDsgZ2Vu
- ZXJhdGVkIGZyb20gZXhlYy5mZAogICAgICAgICAgICAgIElOQ0xVREUgImRvcy9kb3NleHRlbnMu
- aSIKCiAgICAgICAgICAgICAgU0VDVElPTiB0ZXh0LGNvZGUKCnN0YXJ0X3NlZ21lbnQgbW92ZS5s
- ICAoNCkudyxhNiAgICAgICAgICAgICAgICAgICAgICA7IGxvYWQgX1N5c0Jhc2UKICAgICAgICAg
- ICAgICBzdWIubCAgIGExLGExICAgICAgICAgICAgICAgICAgICAgICAgIDsgR2V0IHRoaXMgcHJv
- Y2VzcydzCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
- ICA7IHByb2Nlc3Mgc3RydWN0dXJlCiAgICAgICAgICAgICAganNyICAgICAoX0xWT0ZpbmRUYXNr
- LGE2KSAgICAgICAgICAgICAgICA7IChzaG91bGQgbmV2ZXIgYWNjZXNzIHN5c3RlbSBzdHJ1Y3Rz
- IGRpcmVjdGx5KQogICAgICAgICAgICAgIG1vdmUubCAgZDAsYTQKICAgICAgICAgICAgICBtb3Zl
- cSAgICMwLGQ3ICAgICAgICAgICAgICAgICAgICAgICAgIDsgV0JlbmNoTXNnID0gTlVMTDsKICAg
- ICAgICAgICAgICB0c3QubCAgIChwcl9UYXNrTnVtLGE0KSAgICAgICAgICAgICAgIDsgaWYgc3Rh
- cnRlZCBmcm9tIENMSSBnb3RvIC5zYXZlX3diX21zZwogICAgICAgICAgICAgIGJuZS5iICAgLnNh
- dmVfd2JfbXNnCi5nZXRfd2JfbXNnICAgbGVhICAgICAocHJfTXNnUG9ydCxhNCksYTAgICAgICAg
- ICAgICA7IGdldCB3b3JrYmVuY2ggc3RhcnR1cCBtZXNzYWdlCiAgICAgICAgICAgICAganNyICAg
- ICAoX0xWT1dhaXRQb3J0LGE2KQogICAgICAgICAgICAgIGxlYSAgICAgKHByX01zZ1BvcnQsYTQp
- LGEwCiAgICAgICAgICAgICAganNyICAgICAoX0xWT0dldE1zZyxhNikKICAgICAgICAgICAgICBt
- b3ZlLmwgIGQwLGQ3CiAgICAgICAgICAgICAgYmVxLmIgICAuZ2V0X3diX21zZwouc2F2ZV93Yl9t
- c2cgIG1vdmUubCAgZDcsX19XQmVuY2hNc2cgICAgICAgICAgICAgICAgOyBzYXZlIHN0YXJ0dXAg
- bWVzc2FnZSAoaWYgYW55KQoKICAgICAgICAgICAgICBTRUNUSU9OIHVkYXRhLGJzcwoKX19XQmVu
- Y2hNc2cgICBkcy5sICAgIDEKCgkgICAgICBFTkQK
-
- --p3TteRS0KXB1gGr8GgR11ND1kkZAlLD31--
-
-