[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFC : SOME IDEAS FOR THE APPLE II FPGA'ers



Jorge Chamorro Bieling wrote:

> Could the stack be made 16bits deep? I've been thinking about it lately,
> and I'm not sure. The question is that *maybe* the S register could be
> seen as 8 bits (the lsb 8 bits of a 16bit S register) by the 6502 code
> (so as to remain compatible with existing code), but be in fact a 16bit
> register, so that when you PHA beyond the 256th byte, even though the S
> register "rolls", in fact you'll get back the correct data when you PLA
> back. The problem here arises when the stack is manipulated "by hand",
> not by PHA/PLA. Well, this is something to think about. If such a thing
> can be done, it should.

No. It won't improve any existing software in any way at all, and
people would be reticent to use it because any code written would not
run on other Apple II's or <insert 6502 box here>. Besides, big stacks
are mainly useful for higher level languages for which compilers don't
exist, and even if they did, you couldn't fit a big enough program in
memory to overflow your big stack anyway.

Ok, ok, there are *some* tasks for which a recursive algorithm is the
most 'natural' that can't do on a 6502, but refactoring the recursive
solution into an iterative one is a good intellectual exercise, and
usually results in more efficient code anyway :-)

Am I the only one here who things that the fact that the stack size is
limited, the zero page is small and preoccupied is the thing that makes
6502 assembly programming still fun?

It's the challenge of doing something impressive with a tiny, limited
machine that brings me back, year after year.

Matt