Pete wrote: > > Alain Pastor on 28/9/01 11:08 PM scrawled: > > > Pete wrote: > >> > >> I'm writing an .INCL that will allow me to determine if MacsBug is > >> installed, and if it is, then I can call some debugging FNs. > >> > >> What I'm having trouble with, is determining if MacsBig is > >> installed/running. > >> > > > > Pete, > > > > Is it really necessary nowadays to test for the 24 bit addressing mode? > > According to your explanation and a visit to the Apple universal > > headers, I would try something like this: > > > > > clear local mode > > local fn MagsBugEstaInstalado > > dim @ respuesta as long > > dim bandera as unsigned byte > > > > long if [_Macjmp] > 0 > > long if fn Gestalt(_gestaltAddressingModeAttr, respuesta) = _noErr > > long if (respuesta and _gestalt32BitAddressing%) != 0 > > bandera = |0x0BFF| > what does the line above & the line below mean ? It's a bit of spanish with a bit of Chinese*, you should ask Heather for this now. Notice that with a bunch of bits you can make a byte.;-) The flag to examine is a byte located at the address 0x0BFF when the app is running in 32 bit mode addressing. The || symbols surrounding the address stand for PEEK BYTE In 24 bit mode the flag is packed with the address locating MacsBug. I have understood that the flag is the high byte of the long integer stored at _MacJump (the actual address consisting of the remaining bytes). The line below extracts the high byte: PEEK BYTE(PEEK LONG(_MacJmp)) or with the equivalent shorthands: |[_MacJmp]| Well, I'm not sure this is correct, furthermore I couldn't test the function in 24 bit addressing mode. I could check that it works as expected on my machine in 32 bit addressing mode. Finally, once you have gotten the flag you can test if certain bits are set and that's it. > > > xelse > > bandera = |[_Macjmp]| > > end if > > end if > > end if > > end fn = (bandera != 0) and ((bandera and 0xe0) == 0x60 ) > > > > long if fn MagsBugEstaInstalado > > print "Puede llamar a MacsBug cuando quiera" > > xelse > > print "Lo siento pero no MacsBug para usted" > > end if > > > > do > > until fn button > > > > > > I'm not a bit twidler and I cannot guarantee that the conversion is > > correct. All I can say is that it gives the good result on my configuration. > Pete... (the other one) [*] In French we have an expression that says: "You speak Chinese to me!" when someone is babbling so weirdly you can hardly understand. -- Cheers Alain ----------------------------------------------------- FB^3 in Europe: http://euro.futurebasic.com/ FB II Pouch: http://www.pixmix.com/FB/outils.html -----------------------------------------------------