[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cc65 / ca65: how to interface C and assembly?
- Subject: Re: cc65 / ca65: how to interface C and assembly?
- From: "sicklittlemonkey" <Nick.Westgate@gmail.com>
- Date: 7 Dec 2005 08:08:23 -0800
- Complaints-to: groups-abuse@google.com
- In-reply-to: <4396c453$0$9637$9b4e6d93@newsread2.arcor-online.net>
- Injection-info: g14g2000cwa.googlegroups.com; posting-host=61.118.114.17; posting-account=kvb1xQ0AAAAS6Sc0-kM7S3sG9tLW2K14
- Newsgroups: comp.sys.apple2, comp.sys.cbm, comp.sys.atari.8bit
- Organization: http://groups.google.com
- References: <4395b60d$0$9636$9b4e6d93@newsread2.arcor-online.net> <dn51pv$r7h$1@moppi.musoftware.de> <43961c5c$0$9651$9b4e6d93@newsread2.arcor-online.net> <YamdndvG3OsvAAvenZ2dnUVZ_sSdnZ2d@comcast.com> <4396c453$0$9637$9b4e6d93@newsread2.arcor-online.net>
- User-agent: G2/0.2
- Xref: g2news1.google.com comp.sys.apple2:7174 comp.sys.cbm:12868 comp.sys.atari.8bit:3663
> the solution I gave above seems to be ideal, provided
> you use an absolute address, not some expression that has to be
> calculated at runtime (which will compile into an y-indexed indirect store)
Note that for the switch to write mode in your disk write code:
(B83D) LDA #$FF ;(a) = sync byte.
STA Q7H,X ;Write 1 sync byte.
that STA abs,X (with no page crossing) is pretty much essential.
It syncs with the Woz Machine. You can't replace it with a STA abs.
This is covered in obscene detail in Sather's Understanding the Apple
II.
Just to expand on the double write issue, various 6502 ops
perform from 1 to 4 reads and writes to the given address.
Read-modify-write ops always perform two writes.
Read-modify-write,X ops perform two reads, two writes.
65C02 ops perform 1 to 3 reads and writes to the address,
and the read-modify-write ops only perform one write.
Ah, the Apple II. The more you look, the more there is.
It's like Natural Philosophy, or something. ;-)
Cheers,
Nick.