[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
cc65 assembler stack usage?
- Subject: cc65 assembler stack usage?
- From: Harry Potter <rose.joseph12@yahoo.com>
- Date: Thu, 6 Jun 2013 10:13:43 -0700 (PDT)
- Complaints-to: groups-abuse@google.com
- Injection-date: Thu, 06 Jun 2013 17:13:43 +0000
- Injection-info: glegroupsg2000goo.googlegroups.com; posting-host=72.43.119.62; posting-account=xRocggoAAACFej4w6sQauoZjUP9yroE5
- Newsgroups: comp.sys.apple2
- User-agent: G2/1.0
In cc65 assembler, I know that sp is the pointer to the top of the stack. I also know that pusha and pushax push a byte or word onto the stack, respectively, and popa and popax pop. I also know that pusha0 zero-extends the .A to a word before pushing. I know that push0-9 push constants to the stack. But what about reading a parameter or auto variable inside a function? I'm sure there's a better method than setting the .Y then offseting an access as in (sp),y when accessing words.