Path: utzoo!attcan!uunet!seismo!sundc!newstop!sun-barr!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!dwuuni21.BITNET!phch020 From: phch020@dwuuni21.BITNET Newsgroups: comp.sys.atari.st Subject: Inquiring GDOS Status for Prospero Languages Message-ID: <9002080807.AA11901@ucbvax.Berkeley.EDU> Date: 7 Feb 90 19:32:36 GMT Sender: usenet@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 36 Date: Wed, 7 Feb 90 20:30h cet From: "Th.-M. Kruel" To: Subject: Inquiring GDOS Status for Prospero Languages Two weeks ago I asked about how to inquire GDOS. Thanks to all who posted. Here is the solution suitable for Prospero languages: (adapted to Prospero Macro assembler) xdef vq_gdos ; announce global reference section .code vq_gdos movea.l 4(sp),a0 ; get address of the argument move.w #-2,d0 ; set d0 to -2 trap #2 ; call system (GDOS will modify d0) cmp.w #-2,d0 ; compare d0 with -2 sne d0 ; test condition, sets d0 = 0 if true, otherwise -1 ext.w d0 ; extend to 16 bit move.w d0,(a0) ; move d0 to address in a0 move.l (sp)+,a0 ; move stackpointer to a0 adda.w #4,sp ; add 4 jmp (a0) ; jump to the address in a0 (back to calling program) from Pascal: vq_gdos (i_gdos) (where: var i_gdos:integer2) returns -1 if GDOS loaded, otherwise 0. Thomas-Martin Kruel Inst.f.Physikal.Chemie d.Univ.Wuerzburg, Marcusstr.9-11 D-8700 Wuerzburg, West Germany BITNET: EAN: