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: Re: One Byte Memory Reads Message-ID: <43774@apple.Apple.COM> Date: 8 Aug 90 23:26:02 GMT References: <9008082141.AA25062@apple.com> Organization: Apple Computer Inc, Cupertino, CA Lines: 37 In article <9008082141.AA25062@apple.com> MQUINN@UTCVM.BITNET writes: >[...] >Well, taking the GS's CPU out of 16-bit mode intl 8-bit mode is HOW you >take it out of native mode, so it's impossible to be in 8-bit mode and >native mode at the same time [...] This is incorrect. The 65816 can be in Native mode or Emulation mode (that is, "65C02 emulation" mode). When it's in Native mode, the A register can be either 8 bits or 16 bits, and then X and Y registers can be either 8 or 16 bits. The instruction SEP #$30 ("set processory status bits 5 and 4") gives you 8-bit regisers but leaves you in native mode (so your stack can still be anywhere in bank 0, not just in the $01xx area that emulation mode is limited to). >[...] >SEC >XCE >[...] SEC XCE switches you into emulation mode--that's not what you want to do just to get 8-bit memory accesses. (To switch into emulation mode, first you have to make sure your stack is already in page 1 & be able to switch it back later, and you have to be executing in bank 0 *or* disable interrupts, because emulation-mode interrupts only work right when your program counter is in bank 0--the bank you were in isn't saved, so there would be no way to return from the interrupt!). -- 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.