phch020@dwuuni21.BITNET (02/08/90)
Date: Wed, 7 Feb 90 20:30h cet
From: <phch020@dwuuni21.BITNET> "Th.-M. Kruel"
To: <info-atari16@score.STANFORD.EDU>
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: <phch020@dwuuni21.bitnet>
EAN: <kruel@vax.rz.uni-wuerzburg.dbp.de>