home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 3931 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  5.0 KB

  1. Path: felix.teclink.net!usenet
  2. From: rad@teclink.net (rad)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Replying to WB Startup message with Sas/C
  5. Date: 16 Feb 1996 04:25:57 GMT
  6. Organization: TECLink Internet Services: info@TECLink.Net
  7. Message-ID: <2635.6619T1326T1642@teclink.net>
  8. References: <717.6614T755T957@codeworks.gen.nz>
  9. NNTP-Posting-Host: tc2_54.teclink.net
  10. Mime-Version: 1.0
  11. Content-Type: multipart/mixed; boundary="p3TteRS0KXB1gGr8GgR11ND1kkZAlLD31"
  12. X-Newsreader: THOR 2.22 (Amiga;TCP/IP) *UNREGISTERED*
  13.  
  14. If you are able to read this, your reader is not MIME compliant.
  15. If you are using an Amiga, use THOR to avoid the problem.
  16. If you are not, use some other MIME compliant reader.
  17.  
  18. --p3TteRS0KXB1gGr8GgR11ND1kkZAlLD31
  19. Content-type: text/plain; charset=us-ascii
  20. Content-transfer-encoding: 7bit
  21.  
  22. Tom Parker <tparker@codeworks.gen.nz> writes:
  23.  
  24. >I'm using Sas/C 6.56, and I'm linking WITHOUT the startup code. I would like
  25. >to run my program from the Workbench, so i have to reply to the WBStartup
  26. >message. The Sas documentation doesn't tell me how to do this, and the RKM's
  27. >just say that the startup code should handel it.
  28.  
  29. >Does anyone know how to reply to this message, or, just get a pointer to it
  30. >in the first place. The RKM's say that there should be a pointer to it in A0
  31. >when i start up (it's been a while, it might be a different register...), but
  32. >i'll be damned if i know how to get hold of it.
  33.  
  34. Attached is one way of retreiving the workbench startup message.  Note that
  35. this is written in the new Motorola format, you'll have to convert it to
  36. use SAS's assembler.  I think you should be able to figure out how to reply
  37. using the autodocs for ReplyMsg.
  38.  
  39.               INCLUDE "lvo/exec_lvo.i"              ; generated from exec.fd
  40.               INCLUDE "dos/dosextens.i"
  41.  
  42.               SECTION text,code
  43.  
  44. start_segment move.l  (4).w,a6                      ; load _SysBase
  45.               sub.l   a1,a1                         ; Get this process's
  46.                                                     ; process structure
  47.               jsr     (_LVOFindTask,a6)             ; (should never access
  48.                                                     ; system structs
  49.                                                     ; directly)
  50.               move.l  d0,a4
  51.               moveq   #0,d7                         ; WBenchMsg = NULL;
  52.               tst.l   (pr_TaskNum,a4)               ; if started from CLI goto
  53.                                                     ; .save_wb_msg
  54.               bne.b   .save_wb_msg
  55. .get_wb_msg   lea     (pr_MsgPort,a4),a0            ; get workbench startup
  56.                                                     ; message
  57.               jsr     (_LVOWaitPort,a6)
  58.               lea     (pr_MsgPort,a4),a0
  59.               jsr     (_LVOGetMsg,a6)
  60.               move.l  d0,d7
  61.               beq.b   .get_wb_msg
  62. .save_wb_msg  move.l  d7,__WBenchMsg                ; save startup message
  63.                                                     ; (if any)
  64.  
  65.               SECTION udata,bss
  66.  
  67. __WBenchMsg   ds.l    1
  68.  
  69.               END
  70.  
  71. --------------------------------------------------------------------------
  72. - Richard Deken                   E-Mail: (personal)     rad@teclink.net -
  73. - VLSI design engineer                    (AuE business) rad@aue.com     -
  74. - Advanced Microelectronics       PGP public key available               -
  75. --------------------------------------------------------------------------
  76.  
  77. --p3TteRS0KXB1gGr8GgR11ND1kkZAlLD31
  78. Content-type: text/plain; charset=ISO-8859-1; name="a.a"
  79. Content-transfer-encoding: base64
  80.  
  81. ICAgICAgICAgICAgICBJTkNMVURFICJsdm8vZXhlY19sdm8uaSIgICAgICAgICAgICAgIDsgZ2Vu
  82. ZXJhdGVkIGZyb20gZXhlYy5mZAogICAgICAgICAgICAgIElOQ0xVREUgImRvcy9kb3NleHRlbnMu
  83. aSIKCiAgICAgICAgICAgICAgU0VDVElPTiB0ZXh0LGNvZGUKCnN0YXJ0X3NlZ21lbnQgbW92ZS5s
  84. ICAoNCkudyxhNiAgICAgICAgICAgICAgICAgICAgICA7IGxvYWQgX1N5c0Jhc2UKICAgICAgICAg
  85. ICAgICBzdWIubCAgIGExLGExICAgICAgICAgICAgICAgICAgICAgICAgIDsgR2V0IHRoaXMgcHJv
  86. Y2VzcydzCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
  87. ICA7IHByb2Nlc3Mgc3RydWN0dXJlCiAgICAgICAgICAgICAganNyICAgICAoX0xWT0ZpbmRUYXNr
  88. LGE2KSAgICAgICAgICAgICAgICA7IChzaG91bGQgbmV2ZXIgYWNjZXNzIHN5c3RlbSBzdHJ1Y3Rz
  89. IGRpcmVjdGx5KQogICAgICAgICAgICAgIG1vdmUubCAgZDAsYTQKICAgICAgICAgICAgICBtb3Zl
  90. cSAgICMwLGQ3ICAgICAgICAgICAgICAgICAgICAgICAgIDsgV0JlbmNoTXNnID0gTlVMTDsKICAg
  91. ICAgICAgICAgICB0c3QubCAgIChwcl9UYXNrTnVtLGE0KSAgICAgICAgICAgICAgIDsgaWYgc3Rh
  92. cnRlZCBmcm9tIENMSSBnb3RvIC5zYXZlX3diX21zZwogICAgICAgICAgICAgIGJuZS5iICAgLnNh
  93. dmVfd2JfbXNnCi5nZXRfd2JfbXNnICAgbGVhICAgICAocHJfTXNnUG9ydCxhNCksYTAgICAgICAg
  94. ICAgICA7IGdldCB3b3JrYmVuY2ggc3RhcnR1cCBtZXNzYWdlCiAgICAgICAgICAgICAganNyICAg
  95. ICAoX0xWT1dhaXRQb3J0LGE2KQogICAgICAgICAgICAgIGxlYSAgICAgKHByX01zZ1BvcnQsYTQp
  96. LGEwCiAgICAgICAgICAgICAganNyICAgICAoX0xWT0dldE1zZyxhNikKICAgICAgICAgICAgICBt
  97. b3ZlLmwgIGQwLGQ3CiAgICAgICAgICAgICAgYmVxLmIgICAuZ2V0X3diX21zZwouc2F2ZV93Yl9t
  98. c2cgIG1vdmUubCAgZDcsX19XQmVuY2hNc2cgICAgICAgICAgICAgICAgOyBzYXZlIHN0YXJ0dXAg
  99. bWVzc2FnZSAoaWYgYW55KQoKICAgICAgICAgICAgICBTRUNUSU9OIHVkYXRhLGJzcwoKX19XQmVu
  100. Y2hNc2cgICBkcy5sICAgIDEKCgkgICAgICBFTkQK
  101.  
  102. --p3TteRS0KXB1gGr8GgR11ND1kkZAlLD31--
  103.  
  104.