Path: utzoo!attcan!uunet!lll-winken!ames!pasteur!ucbvax!UIAMVS.BITNET!AWCTTYPA From: AWCTTYPA@UIAMVS.BITNET ("David A. Lyons") Newsgroups: comp.sys.apple Subject: testing for 65C02 presence Message-ID: <8901161831.aa18496@SMOKE.BRL.MIL> Date: 17 Jan 89 01:49:45 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 38 X-Unparsable-Date: Monday 16 Jan 89 5:25 PM CT >Date: Sun, 15 Jan 89 05:21:59 PST >From: pbhyd!ldcol@pacbell.pacbell.com >Subject: Re: testing all 3 parts of IIe enhancement I wrote: >Also from the monitor, type > >300:A9 00 1A 00 >300G > >You should get a register dump; I just need to know the value after >"A=". It should be 00 if you have a 6502 and 01 if you have a >65C02. Larry Colton asks: >David, can you please explain why the above works? What is the difference >between the 6502 and the 65c02 as far as how the above code is treated? On the 6502, opcode $1A doesn't do anything (anybody want to guarantee that? as fasr as _I_ know it doesn't); on the 65C02, $1A is "INC A" (or just "INC"), which adds one to the A register. So the above program is 300:A9 00 LDA #$00 302:1A INC 303:00 BRK It loads A with zero, increments it to 1 _if_ a 65C02 (or 65802, or 65816, for that matter) is running the code, and then Breaks into the monitor with a register dump. >Larry Colton {att,bellcore,sun,ames,pyramid}!pacbell!ldcol --David A. Lyons bitnet: awcttypa@uiamvs DAL Systems CompuServe: 72177,3233 P.O. Box 287 GEnie mail: D.LYONS2 North Liberty, IA 52317 AppleLinkPE: Dave Lyons