💾 Archived View for mirrors.apple2.org.za › archive › ground.icaen.uiowa.edu › MiscInfo › Programmin… captured on 2024-07-09 at 05:09:53.

View Raw

More Information

⬅️ Previous capture (2023-01-29)

-=-=-=-=-=-=-


On Wed, 30 Oct 2002, Simon Williams wrote:

> Date: Wed, 30 Oct 2002 20:30:39 GMT
> From: Simon Williams <DONTemail@luddite.ca>
> Newsgroups: comp.sys.apple2.programmer
> Subject: Re: Text / Graphics from ML
>
>
> > Yes, text and lo-res graphics are on one of two text pages (the second
> > text page is hardly ever used).  The primary text page is from $400 to
> > $7FF, with some "screen holes" in the range that are not displayed but
> > contain vital peripheral card data (and so must be avoided).
> >
> Where can I find a list of the "forbidden" addresses... I'd like to do
> some fiddling...
> For the most part I've been using a few POKES,PEEKS & CALLS lists as
> reference for Assemby tinkering, but I'm wondering if there is are any
> differences between DOS/ProDOS or betweem 6502 and 65c02... and also,
> how do I translate negative decimals into hex?
>
> SW
>


Hi,
perhaps this little table will help you:

line  0 : $0400
line  1 : $0480
line  2 : $0500
line  3 : $0580
line  4 : $0600
line  5 : $0680
line  6 : $0700
line  7 : $0780
line  8 : $0428
line  9 : $04a8
line 10 : $0528
line 11 : $05a8
line 12 : $0628
line 13 : $06a8
line 14 : $0728
line 15 : $07a8
line 16 : $0450
line 17 : $04d0
line 18 : $0550
line 19 : $05d0
line 20 : $0650
line 21 : $06d0
line 22 : $0750
line 23 : $07d0

If you want to put a char on screen, you can use something like this:

; A = character
; Y = xcoo (0..39)
; X = ycoo (0..23)

putchar:	PHA
		LDA	textaddrl,x
		STA	taddr
		LDA	textaddrh,x
		STA	taddr+1
		PLA
		STA	(taddr),y
		RTS

textaddrl:	HEX	0080008000800080
		HEX	28a828a828a828a8
		HEX	50d050d050d050d0
textaddrh:	HEX	0404050506060707
		HEX	0404050506060707
		HEX	0404050506060707


Mr. Jon Relay has put together a list of the screen holes and their usage.
The following is a quote from his Apple II Info Archives:

<quote>
### Screen Holes:

N is the slot number a card is in.

Apple II
--------
$0478    1144    Slot address of card using $C800 space
                 //c mouse: clamping minimum, lo byte
$04F8    1272    //c mouse: clamping maximum, lo byte
$0578    1400    //c mouse: clamping minimum, hi byte
$05F8    1528    //c mouse: clamping maximum, hi byte

Super Serial Card
-----------------
$0478+n  1144+n  Delay: b0-1=FF b2-3=LF b4-5=CR b6-7=translate option
$04F8+n  1272+n  Accumulator for firmware's command processor
$0578+n  1400+n  b0-2=cmd mode b3-5=slot to ch to b6=lc b7=terminal/CR
$05F8+n  1528+n  b0-6=command byte b7=zap control commands
$0678+n  1656+n  Error: b0=parity b1=framing b2=overrun b3=carrier b5=error
$06F8+n  1784+n  Modem Mode: b0-2=screen slot b3-7=$Cs00 space entry point
                 Printer Mode: current printer width
$0778+n  1912+n  Modem Mode: input buffer
                 Printer Mode: current column
$07F8+n  2040+n  b0=auto LF b1=comm.mode b2=keyb inp b3=chk XOFF b4=Pascal
                 b5=ignore LF b6=enable lc/tabs b7=echo

Apple IIc Serial
----------------
$0578+n  1400+n  printer width
$05F8+n  1528+n  scratch
$0678+n  1656+n  b7=parsing command string
$06F8+n  1784+n  current command character
$0778+n  1912+n  b6=auto LF b7=echo
$07F8+n  2040+n  current printer column

80-Column Card
--------------
$0478+n  1144+n  address of last output routine used by firmware
$04F8+n  1272+n  video firmware operating mode
$0578+n  1400+n  horizontal cursor position
$05F8+n  1528+n  vertical cursor position
$0678+n  1656+n  character to be printed/read
$06F8+n  1784+n  Pascal GOTOXY X coordinate
$0778+n  1912+n  scratch
$07F8+n  2040+n  scratch

Mouse Card
----------
$0478+n  1144+n  X coordinate, lo byte
$04F8+n  1272+n  Y coordinate, lo byte
$0578+n  1400+n  X coordinate, hi byte
$05F8+n  1528+n  Y coordinate, hi byte
$0778+n  1912+n  status: b1=movement int b2=button int b3=VBL int
                 b5=movement b6=still down from last b7=button down
$07F8+n  2040+n  mode: b0=active b1=VBL on move b2=VBL on button b3=VBL

Apple IIc Auxilary Memory
-------------------------
$0478    1144    printer port ACIA control reg
$0479    1145    printer port ACIA command reg
$047A    1146    printer port flags: b0=comm b6=auto LF b7=echo
$047B    1147    printer port printer width
$047C    1148    modem port ACIA control reg
$047D    1149    modem port ACIA command reg
$047E    1150    modem port flags: b0=comm b6=auto LF b7=echo
$047F    1151    modem port line length
</quote>

As you can see, the screen holes are placed at addresses
$0x78 .. $0x7f
$0xf8 .. $0xff

(x = 4,5,6,7)

Differences between 6502 and 65c02:
There are not so many differences between these processors. The 65c02 has
some bugs removed (e.g. the JMP ($xxff)-bug) and has some additional
instructions like PHX, PLY, DEA, STZ addr etc. Probably most programs for
the AppleII were written using 6502 instructions only, so there is no need to
bother too much for the new ones. Note: The 65c02 was introduced on the
AppleIIe and AppleIIc, so if you want your program to run on old AppleIIs,
you'd better stick to the 6502 anyway.

Kind regards

  Holger

P.S.: In case you need an example on how to write strings to the screen
using your own cout routine, I've got an example source code. (A bit too
long to post here.) Just let me know.