Path: utzoo!attcan!uunet!know!zaphod.mps.ohio-state.edu!usc!ucsd!ucbvax!agate!darkstar!ucscb.UCSC.EDU!unknown From: unknown@ucscb.UCSC.EDU (The Unknown User) Newsgroups: comp.sys.apple2 Subject: Instruction sets (was:Re: MacMusings) Message-ID: <8252@darkstar.ucsc.edu> Date: 27 Oct 90 22:08:58 GMT References: <9010271753.AA23864@apple.com> Sender: usenet@darkstar.ucsc.edu Organization: University of California, Santa Cruz; Open Access Computing Lines: 53 In art. <9010271753.AA23864@apple.com> MQUINN%UTCVM@PUCC.PRINCETON.EDU writes: >On Sat, 27 Oct 90 07:24:26 GMT The Unknown User said: >> But having more registers takes up more bits of an instruction >>if you want instructions to be general and use any register.. (I should >I don't think I follow. I don't deny this, I just don't understand it and it >sounds interesting. Well, since the 6502 is an 8 bit computer, the smartest (that is, fastest) thing to do is to make all instructions take up only 8 bits, since the data bus is 8 bits (it can only send/receive 8 bits at a time). So an instruction is x x x x x x x x where each x is either a one or a zero, making up an 8 bit binary number. With instructions that only take up 8 bits, if you have more registers, you will have to use MORE of those 8 bits telling WHICH register you are using. Since I don't know the 6502 instruction set, especially not at the low level I am talking about, I'll make up an instruction... The instruction will be to load a register with the value that's in the location that another register points to.. I realize that it actually takes up 2 bytes to make an address, so I'll assume it's a zero page loading (the high byte of the address to load from is automatically zero).. I hope all of these conditions are not confusing you, I just keep thinking up these conditions that will make this DEFINITELY be an 8 bit instruction. So let's assume if the first 4 bits are 0111, then the instruction is an indirect load... 0111 xx yy |__| || || | | |_register to use as the low byte address to get data from | |_ register where the result will be put |_ code that signifies it's an indirect load instruction since xx and yy are only two bits apiece, there are four choices for each of the values... Having the capability for more registers means those numbers would have to be bigger... Some tricks can be used in other ways to add more instructions total, such as if there was a move register,register instruction.. since moving register X to register X is kinda pointless, that space could be taken up for a new instruction. gotta run, someone's requesting a talk. -- /Apple II(GS) Forever! unknown@ucscb.ucsc.edu MAIL ME FOR INFO ABOUT CHEAP CDs\ \"If cartoons were meant for adults, they'd be on in prime time."-Lisa Simpson/