Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!dlyons From: dlyons@Apple.COM (David A. Lyons) Newsgroups: comp.sys.apple2 Subject: checking native/emulation mode Message-ID: <43491@apple.Apple.COM> Date: 1 Aug 90 04:38:58 GMT References: <3529.apple.net2@pro-grouch> <1990Jul31.184844.10094@laguna.ccsf.caltech.edu> Organization: Apple Computer Inc, Cupertino, CA Lines: 32 In article <1990Jul31.184844.10094@laguna.ccsf.caltech.edu> toddpw@tybalt.caltech.edu (Todd P. Whitesel) writes: >A simpler way to test for emulation mode is > > clc > xce ;force native mode temporarily > php ;save the old e bit which is now in c > xce ;restore old e bit, carry is cleared > plp ;and get it back into the carry > bcc is_native > bcs is_emulation > >Unless I grossly misunderstand the stack effects of mode-switching, this >routine should work under ANY conditions. However, there could be side effects >if we are in emulation mode and the stack pointer is $100 -- namely, the >interrupt info clobbers the top of zero page. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ What? Yeah, if your stack pointer is $100 that's Not Good. If you just meant the stack = $1xx, that's no problem, because switching to NATIVE mode doesn't fiddle with the stack pointer. (If you were switching to emulation from native & the stack was not already in $01xx, *then* there would be problems.) -- David A. Lyons, Apple Computer, Inc. | DAL Systems Apple II Developer Technical Support | P.O. Box 875 America Online: Dave Lyons | Cupertino, CA 95015-0875 GEnie: D.LYONS2 or DAVE.LYONS CompuServe: 72177,3233 Internet/BITNET: dlyons@apple.com UUCP: ...!ames!apple!dlyons My opinions are my own, not Apple's.