🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.micro.atari16
Article #1260

What is wrong with this program???

#1260
From: uh
Date: Mon, 21 Jul 1986 17:49
78 lines
3309 bytes
What is wrong with this program???

I want to write some sort of interrupt handler in TDI Modula-2 for the
Atari ST series, using the IOTransfer procedure.
Following is a small Modula-2 test program which has the same task as
the Megamax C interrupt test program, which have been posted two or three 
weeks ago in net.micro.atari16. I used the TDI Version 2.10a Modula-2 compiler.
The documentation is very poor at this point, so if anybody knows a
hint how to get this program running, please mail to

uh@unido

Many thanks in advance.
---------------------------cut here---------------------------------
MODULE INTRTEST;

FROM SYSTEM  IMPORT ADDRESS, PROCESS, NEWPROCESS, TRANSFER, IOTRANSFER;
FROM XBIOS   IMPORT Timer, SetTimerInterrupt;
FROM Storage IMPORT ALLOCATE;
FROM InOut   IMPORT WriteInt, WriteLn;

CONST INTTIMER = 77; (*Interrupt number of timer A interrupt*)

VAR I     : CARDINAL;
    N     : CARDINAL;
    ROOT  : PROCESS;
    INT   : PROCESS;
    IADDR : ADDRESS;

PROCEDURE DUMMY; 
BEGIN 
   (*Should a CODE(RTE) stand here ?!?*)
END DUMMY;

PROCEDURE INTHANDLER; 
BEGIN
   LOOP                                (*Interrupt handler never ends*)
      IOTRANSFER(INT,ROOT,4*INTTIMER); (*Give controll back to root; but only  
\012                                      until a timer A interrupt arrives*)
      INC(N);                          (*Count interrupts*)
   END;
END INTHANDLER;

BEGIN
   N := 0;                                (*Initialize interrupt counter*)
   SetTimerInterrupt(TimerA,1,100,DUMMY); (*Set timer A interrupt to dummy
					   procedure until IOTRANSFER takes
					   over control*)
   ALLOCATE(IADDR,1024);                  (*Create process space, then ..*)
   NEWPROCESS(INTHANDLER,IADDR,1024,INT); (*.. create the process*)
   TRANSFER(ROOT,INT);                    (*Give control to new created
					   process*)
   I := 0;                                (*Now wait a while*)
   WHILE I < 30000 DO
      INC(I);
   END;
   SetTimerInterrupt(TimerA,0,0,PROC(0)); (*Disable Timer A (I hope that 
					    will do?!?)*)
   WriteInt(N,10);                        (*Display number of interrupts ..*)
   WriteLn;                               (*.. during wait*)
END INTRTEST.
---------------------------cut here---------------------------------
This program bombs: 3 mushrooms (aah bombs).
But first if you hack something on the keyboard (i.e. move the mouse) when
the program is ended (N is 0).

Some words about my configuration:
   260ST upgraded to 1MB,
   SF 354,
   SM124,
   TOS in ROM.
   
Please, please help!!!

     Uwe Hoch
     Computer Science Department, University of Dortmund
     4600 Dortmund 50, P.O. Box 500500, W.-Germany
     E-mail address: uh@unido.uucp, uh@unido.bitnet
Technical Details
Message-ID: <96100016@unido.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utcs!mnetor!seismo!mcvax!unido!uh

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!utcs!mnetor!seismo!mcvax!unido!uh
From: uh@unido.UUCP
Newsgroups: net.micro.atari16
Subject: What is wrong with this program???
Message-ID: <96100016@unido.UUCP>
Date: Mon, 21-Jul-86 13:49:00 EDT
Article-I.D.: unido.96100016
Posted: Mon Jul 21 13:49:00 1986
Date-Received: Tue, 22-Jul-86 09:05:23 EDT
Sender: notes@unido.UUCP
Lines: 79
Nf-ID: #N:unido:96100016:000:2737
Nf-From: unido!uh    Jul 21 18:49:00 1986