Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-lcc!styx!ames!ucbcad!ucbvax!decvax!mcnc!ecsvax!ranger From: ranger@ecsvax.UUCP (Rick N. Fincher) Newsgroups: comp.sys.apple Subject: Re: 65C816 programming weirdness; is it true? Message-ID: <2504@ecsvax.UUCP> Date: Fri, 19-Dec-86 09:43:28 EST Article-I.D.: ecsvax.2504 Posted: Fri Dec 19 09:43:28 1986 Date-Received: Sat, 20-Dec-86 06:37:03 EST References: <433@cod.UUCP> Organization: UNC Educational Computing Service Lines: 48 Keywords: IIGS, 65C816, assembly language, 8/16 bit modes Summary: I think 65816 is easier... > > I would appreciate any information regarding 65C816 assembly language > difficulties on the Apple IIGS. If there are such difficulties, I wonder > what that will mean for development of IIGS specific software. I think that programming the 65816 is easier than programming the 6502. There are two modes, 8 and 16 bit. The 8 bit mode exists primarily to run older software. There is no real need to use it idf you use Prodos 16 . The only real limitation is the 64 bank switching scheme. It sort of reminds you of segments on the 8088, but it is not that restrictive. Some instructions (branches, for example) only work inside a 64K bank that is identified by the top two hex digits in the address. A gs monitor dump looks like 00/ffffFFFF, with the slash separating the bank address from the 64K address. Branches will wrap around inside a bank rather than going to the next bank. You can do direct addressing of any location, long jumps and long jumps to subroutines from anywhere in memory to anywhere else in memory. One new set of instructions is the stack relative set of instructions and addressing modes. These allow the programmer to load and store relative to addresses placed on the stack. These were added to make code completely relocatable, but will require a little study for a 6502 programmer to understand. A good book on the '816 is "Programming the 65816" by David Eyes (now working at Apple in //gs software tools development), published by Brady Books. It is a good reference for the entire 65xxx family. Another thing that will take some getting used to is the Prodos 16 memory management scheme. I don't have all of the details but I understand that it uses some sort of demand paging scheme. If your program requires 2 meg and your computer only has 512K it will switch out 64K banks as needed to disk. From what little I have heard it looks to the programmer much like the system the Mac uses (Thank God memory upgrades are easy!), but this is all rumor and hearsay, I haven't seen the tech manuals yet on Prodos 16. I think that the '816 is also easier to program because you can have multiple zero pages in the first 64K of memory as well as a much larger hardware stack. Except for some possible special applications with 8 bit quantities that may be more efficient in 8 bit mode, I don't see any reason to switch between the 8 and 16 bit mode on the //gs. Some people have been writing stuff on 65802 processors put in a //e for awhile, and in this case you have to switch back and forth to do I/O Prodos calls in 8 bit mode. The '816 comes up in the 8 bit mode for compatibility purposes, so the first thing you can do on a gs is switch into the 16 bit mode. I think you will like the power of the '816 once you get used to it, you won't want to go back to the restrictions of the 6502. Aim Flames at: Rick Fincher ranger@ecsvax