::: Area #187 (Acorn Sysop UK Echo) Message: #39412 (Read 8 times, has 0 replies, 3944 bytes) Date : Thu Jan 28 00:23:50 1999 From : Vincent Lefevre of fidonet#2:254/27.2 To : All Subject: Re: Wimptask modules Message-ID: <48cb33ec88Vincent.Lefevre@pm-vlefevre.ens-lyon.fr> In article <1b331ccb48%Jeremy@golden.argonet.co.uk>, Jeremy Poulter wrote: > Can someone please post clear instructions about how to write a module based > Wimp task. > I can figure it out I keep on getting DataAbort error message during the > Wimp_initialise call. Here's what I do (NAME is the name of the module): ^ 0 ;Workspace structure. # 4 ;Task handle. [...] STACK # STACKSIZE SIZE # 0 BaseAddr DCD RM_Start -BaseAddr DCD RM_Init -BaseAddr DCD RM_Die -BaseAddr DCD 0 DCD RM_Title -BaseAddr DCD RM_Help -BaseAddr DCD RM_HCtable-BaseAddr task DCB "TASK" Help_Desktop DCB "Do not use *",27,0,", use *Desktop instead.",0 ALIGN RM_HCtable DCB "Desktop_" RM_Title DCB NAME,0 ALIGN DCD Desktop-BaseAddr,0,0,Help_Desktop-BaseAddr [...] DCB 0 ALIGN Desktop MOV R6, LR MOV R2, R0 ADR R1, RM_Title MOV R0, #2 SWI XOS_Module ;Enter the module. MOV PC, R6 RM_Init LDR R2, [R12] ;R2: pointer to workspace or 0. MOV R6, LR CMP R2, #0 ;(V = 0.) MOVEQ R0, #6 ;Executed unless re-init. MOVEQ R3, #SIZE SWIEQ XOS_Module ;Claim. MOVVS PC, R6 ;Return with V=1 if not enough memory. STREQ R2, [R12] ;Pointer to workspace. MOV R0, #0 STR R0, [R2] ;Reset task handle. [...] MOVS PC, R6 ;Return with no error. RM_Die MOV R6, LR LDR R12, [R12] ;R12: pointer to workspace. LDR R0, [R12] LDR R1, task ;"TASK". TEQ R0, #0 SWINE XWimp_CloseDown [...] MOVS PC, R6 ;Return with no error. RM_Start LDR R6, [R12] ;R6: pointer to workspace. ADD SP, R6, #SIZE LDR R0, [R6] ;Task handle or 0. MOV R5, #0 TEQ R0, #0 LDR R1, task ;"TASK". SWINE Wimp_CloseDown STRNE R5, [R6] ;Reset task handle. MOV R0, #300 ;Last Wimp version known: 3.00. ADR R2, RM_Title ADR R3, messages SWI XWimp_Initialise LDRVS R1, task MOVVS R0, #200 ;If init failed, try ROS 2.00. SWIVS XWimp_Initialise MOVVS R3, R2 SWIVS OS_ExitAndDie STR R1, [R6] ;Store task handle. [ Wimp_Poll loop ] There are some examples on my web pages. They may be a little different, though. -- Vincent Lefevre - PhD stud. in Computer Science Web: http://www.ens-lyon.fr/~vlefevre/ - 100% validated HTML - Acorn Risc PC, Yellow Pig 17, Championnat International des Jeux Mathematiques et Logiques, TETRHEX, Faits divers insolites, etc... --- EchoMaker 0.49 # Origin: a training zoo * Origin: The Arcade BBS Usenet News Gateway (2:254/27.2)