[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Steal RAM -- Question
- Subject: Re: Steal RAM -- Question
- From: "mmphosis" <markstock@mail.com>
- Date: 5 Nov 2006 16:35:18 -0800
- Complaints-to: groups-abuse@google.com
- Injection-info: m7g2000cwm.googlegroups.com; posting-host=70.66.60.9; posting-account=7uQMLQ0AAAB8qpxOFEkK1_UQpZcRVam_
- Newsgroups: comp.sys.apple2
- Organization: http://groups.google.com
- References: <rCb3h.4361$9v5.1239@newssvr29.news.prodigy.net>
- User-agent: G2/1.0
- Xref: g2news2.google.com comp.sys.apple2:14592
Hmmm, I am a little lost in the translation. To answer your first
question:
> Please explain what STA instruction is used for?
Possibly, whatever (sample source code?) you may be looking at is using
a STA (store) instruction. This is a way to access the odd locations
in the range $C080-$C08F _twice_ for each STA instruction. The STA
instruction on a 6502 will access the memory location twice. In order
for the soft switches to actually be switched for the odd locations in
the range $C080-$C08F the memory needs to be accessed twice. Using the
STA should make this work. The alternative is to use two BIT
instructions, or two load instructions rather than a single STA
instruction. The advantages of using the STA instruction is that it
does not affect any registers, it only consumes three bytes of code
space instead of six, and the store absolute instruction executes in 4
cycles instead of 8 cycles for two load immediate instructions.
For example:
BIT $C081 ; Language Card RAM bank2, Read ROM instead of RAM
BIT $C081 ; another successive read WRite-enables RAM
Or, using a single store instruction, should accomplish the same thing:
STA $C081 ; LC Card RAM bank2, Read ROM instead of RAM, WR-enable
RAM
This site is a great source of information:
http://home.swbell.net/rubywand/A2FAQs1START.html
This page describes the peeks and pokes for the soft switches with the
proper label names:
http://home.swbell.net/rubywand/csa2pfaq.html#004
I hope this helps,
mmphosis