English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 03 January 2014, 23:07   #1
Asman
68k
 
Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 828
Startup Code (from Icon ) - Forbid function

As I understand correctly Forbid function is used to off multitasking and I should use pair Forbid and Permit function. But I don't understand why in startup code from icon there is the Forbid call before back to OS. Mean

Code:
	...
	jsr	Forbid(A6)
	move.l	WBenchMsg(PC),A1	;WBenchMsg from GetMsg
	jsr	ReplyMsg(A6)
	moveq	#0,D0
	rts
I found only following information in comment in startup.asm:

"; we forbid so workbench can't UnLoadSeg() us before we are done"

But what about Permit ? Is there any detailed information about icon startup ?
Asman is offline  
Old 04 January 2014, 04:23   #2
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Replying to the Workbench startup-message is how you tell Workbench that your program is about to end, but there's always the chance that a task-switch occurs between the call to ReplyMsg() and actually ending your program, so you need to disable multi-tasking to prevent this. It's not necessary to call Permit() again because this state is relative to each task, so multi-tasking will be correctly enabled again when your program ends.

The details are in the RKMs of course, and probably in the NKDs as well.
Leffmann is offline  
Old 04 January 2014, 10:45   #3
Asman
68k
 
Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 828
Thanks a lot.
Asman is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
C/C++ WB friendly fullscreen game startup code NovaCoder Coders. Tutorials 1 20 August 2019 13:45
PNG Icon to Color Icon Converter? Leandro Jardim request.Apps 1 24 May 2010 04:39
need help with modeid-function Ratte Coders. General 6 17 August 2009 00:57
Snapshot function Eny- support.Apps 4 16 July 2004 08:52
3D code and/or internet code for Blitz Basic 2.1 EdzUp Retrogaming General Discussion 0 10 February 2002 11:40

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 14:47.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.10761 seconds with 13 queries