Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
histcomp:apple_ii [2024-08-24 05:53] – copied memory regions and IO through page 384 of Inside the Apple IIe asdf | histcomp:apple_ii [2024-10-01 06:15] (current) – asdf | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Apple ][ ====== | ====== Apple ][ ====== | ||
- | The bulk of this page will focus on the Enhanced IIe, both because it was the most popular of the line and because it is the model we have. | + | The bulk of this page will focus on the Enhanced IIe, both because it was the most popular of the line and because it is the model we have. |
===== Memory layout ===== | ===== Memory layout ===== | ||
Despite the [[.: | Despite the [[.: | ||
- | * \$0000--\$00ff: zero page | + | * \$0000--\$00FF: [[#zero page]] |
- | * \$0100--\$01ff: stack, Applesoft temporary storage | + | * \$0100--\$01FF: stack, |
- | * \$0200--\$02ff: keyboard/ | + | * \$0200--\$02FF: keyboard/ |
- | * \$0300--\$03cf: user assembly programs | + | * \$0300--\$03CF: user assembly programs |
- | * \$03d0--\$03ff: subroutine vectors for DOS, Applesoft, and system monitor | + | * \$03D0--\$03FF: subroutine vectors for DOS, Applesoft, and system monitor |
- | * \$0400--\$07ff: text/ | + | * \$0400--\$07FF: text/ |
- | * \$0800--\$0bff: text/ | + | * \$0800--\$0BFF: text/ |
- | * \$0c00--\$1fff: free for use | + | * \$0C00--\$1FFF: free for use |
- | * \$2000--\$3fff: high-res page 1 | + | * \$2000--\$3FFF: high-res page 1 |
- | * \$4000--\$5fff: high-res page 2 | + | * \$4000--\$5FFF: high-res page 2 |
- | * \$6000--\$bfff: normally free for use; \$9600 and above is used by DOS | + | * \$6000--\$BFFF: normally free for use; \$9600 and above is used by DOS |
- | * \$c000--\$c0ff: I/O | + | * \$C000--\$C0FF: [[#I/O]] |
+ | * \$C100--\$C1FF: | ||
+ | * \$C200--\$C2FF: | ||
+ | * \$C300--\$C3FF: | ||
+ | * \$C400--\$C4FF: | ||
+ | * \$C500--\$C5FF: | ||
+ | * \$C600--\$C6FF: | ||
+ | * \$C700--\$C7FF: | ||
+ | |||
+ | ==== Zero page ==== | ||
+ | |||
+ | ==== I/O ==== | ||
<table |tab_io> | <table |tab_io> | ||
- | < | + | < |
^ Address ^ Direction ^ Symbolic name ^ Description ^ | ^ Address ^ Direction ^ Symbolic name ^ Description ^ | ||
| \$C000 | W | '' | | \$C000 | W | '' | ||
Line 40: | Line 51: | ||
| \$C00F | W | '' | | \$C00F | W | '' | ||
| \$C010 | R7 | '' | | \$C010 | R7 | '' | ||
+ | | | RW | '' | ||
| \$C011 | R7 | '' | | \$C011 | R7 | '' | ||
| \$C012 | R7 | '' | | \$C012 | R7 | '' | ||
Line 55: | Line 67: | ||
| \$C01E | R7 | '' | | \$C01E | R7 | '' | ||
| \$C01F | R7 | '' | | \$C01F | R7 | '' | ||
- | | \$C020 | | + | | \$C020 |
| \$C021 | | | \$C021 | | ||
| \$C022 | | | \$C022 | | ||
Line 71: | Line 83: | ||
| \$C02E | | | \$C02E | | ||
| \$C02F | | | \$C02F | | ||
- | | \$C030 | | + | | \$C030 |
| \$C031 | | | \$C031 | | ||
| \$C032 | | | \$C032 | | ||
Line 87: | Line 99: | ||
| \$C03E | | | \$C03E | | ||
| \$C03F | | | \$C03F | | ||
- | | \$C040 | | + | | \$C040 |
| \$C041 | | | \$C041 | | ||
| \$C042 | | | \$C042 | | ||
Line 119: | Line 131: | ||
| \$C05E | RW | '' | | \$C05E | RW | '' | ||
| \$C05F | RW | '' | | \$C05F | RW | '' | ||
- | | \$C060 | | + | | \$C060 |
- | | \$C061 | | + | | \$C061 |
- | | \$C062 | | + | | \$C062 |
- | | \$C063 | | + | | \$C063 |
- | | \$C064 | | + | | \$C064 |
- | | \$C065 | | + | | \$C065 |
- | | \$C066 | | + | | \$C066 |
- | | \$C067 | | + | | \$C067 |
- | | \$C068 | | + | | \$C068 |
| \$C069 | | | \$C069 | | ||
| \$C06A | | | \$C06A | | ||
Line 151: | Line 163: | ||
| \$C07E | | | \$C07E | | ||
| \$C07F | | | \$C07F | | ||
- | | \$C080 | | + | | \$C080 |
- | | \$C081 | | + | | \$C081 |
- | | \$C082 | | + | | \$C082 |
- | | \$C083 | | + | | \$C083 |
| \$C084 | | | \$C084 | | ||
| \$C085 | | | \$C085 | | ||
| \$C086 | | | \$C086 | | ||
| \$C087 | | | \$C087 | | ||
- | | \$C088 | | + | | \$C088 |
- | | \$C089 | | + | | \$C089 |
- | | \$C08A | | + | | \$C08A |
- | | \$C08B | | + | | \$C08B |
| \$C08C | | | \$C08C | | ||
| \$C08D | | | \$C08D | | ||
| \$C08E | | | \$C08E | | ||
| \$C08F | | | \$C08F | | ||
- | | \$C090 | + | | \$C090--\$C09F | | | Reserved for use by slot 1 | |
- | | \$C091 | | + | | \$C0A0--\$C0AF | | | Reserved for use by slot 2 | |
- | | \$C092 | + | | \$C0B0--\$C0BF | | | Reserved for use by slot 3 | |
- | | \$C093 | | + | | \$C0C0--\$C0CF | | | Reserved for use by slot 4 | |
- | | \$C094 | | + | | \$C0D0--\$C0DF | | | Reserved for use by slot 5 | |
- | | \$C095 | | + | | \$C0E0--\$C0EF | | | Reserved for use by slot 6 | |
- | | \$C096 | | + | | \$C0F0--\$C0FF | | | Reserved for use by slot 7 | |
- | | \$C097 | | + | </ |
- | | \$C098 | | + | |
- | | \$C099 | | + | ==== Video memory ==== |
- | | \$C09A | | + | ==== Other locations ==== |
- | | \$C09B | | + | To determine the exact model and version, examine |
- | | \$C09C | | + | |
- | | \$C09D | | + | |
- | | \$C09E | | + | |
- | | \$C09F | + | |
- | | \$C0A0 | + | |
- | | \$C0A1 | | + | ===== Programming ===== |
- | | \$C0A2 | + | ==== Applesoft ==== |
- | | \$C0A3 | | + | ==== Integer BASIC ==== |
- | | \$C0A4 | | + | ==== System monitor ==== |
- | | \$C0A5 | | + | < |
- | | \$C0A6 | | + | < |
- | | \$C0A7 | | + | |
- | | \$C0A8 | | + | |
- | | \$C0A9 | | + | |
- | | \$C0AA | | + | |
- | | \$C0AB | | + | |
- | | \$C0AC | | + | |
- | | \$C0AD | | + | |
- | | \$C0AE | | + | |
- | | \$C0AF | + | |
- | | \$C0B0 | + | |
- | | \$C0B1 | | + | |
- | | \$C0B2 | + | |
- | | \$C0B3 | | + | |
- | | \$C0B4 | | + | |
- | | \$C0B5 | | + | |
- | | \$C0B6 | | + | |
- | | \$C0B7 | | + | |
- | | \$C0B8 | | + | |
- | | \$C0B9 | | + | |
- | | \$C0BA | | + | |
- | | \$C0BB | | + | |
- | | \$C0BC | | + | |
- | | \$C0BD | | + | |
- | | \$C0BE | | + | |
- | | \$C0BF | + | |
- | | \$C0C0 | + | |
- | | \$C0C1 | | + | |
- | | \$C0C2 | + | |
- | | \$C0C3 | | + | |
- | | \$C0C4 | | + | |
- | | \$C0C5 | | + | |
- | | \$C0C6 | | + | |
- | | \$C0C7 | | + | |
- | | \$C0C8 | | + | |
- | | \$C0C9 | | + | |
- | | \$C0CA | | + | |
- | | \$C0CB | | + | |
- | | \$C0CC | | + | |
- | | \$C0CD | | + | |
- | | \$C0CE | | + | |
- | | \$C0CF | + | |
- | | \$C0D0 | + | |
- | | \$C0D1 | | + | |
- | | \$C0D2 | + | |
- | | \$C0D3 | | + | |
- | | \$C0D4 | | + | |
- | | \$C0D5 | | + | |
- | | \$C0D6 | | + | |
- | | \$C0D7 | | + | |
- | | \$C0D8 | | + | |
- | | \$C0D9 | | + | |
- | | \$C0DA | | + | |
- | | \$C0DB | | + | |
- | | \$C0DC | | + | |
- | | \$C0DD | | + | |
- | | \$C0DE | | + | |
- | | \$C0DF | + | |
- | | \$C0E0 | + | |
- | | \$C0E1 | | + | |
- | | \$C0E2 | + | |
- | | \$C0E3 | + | |
- | | \$C0E4 | | + | |
- | | \$C0E5 | | + | |
- | | \$C0E6 | + | |
- | | \$C0E7 | + | |
- | | \$C0E8 | | + | |
- | | \$C0E9 | | + | |
- | | \$C0EA | | + | |
- | | \$C0EB | | + | |
- | | \$C0EC | | + | |
- | | \$C0ED | | + | |
- | | \$C0EE | | + | |
- | | \$C0EF | | + | |
- | | \$C0F0 | | + | |
- | | \$C0F1 | | + | |
- | | \$C0F2 | | + | |
- | | \$C0F3 | | + | |
- | | \$C0F4 | | + | |
- | | \$C0F5 | | + | |
- | | \$C0F6 | | + | |
- | | \$C0F7 | | + | |
- | | \$C0F8 | | + | |
- | | \$C0F9 | | + | |
- | | \$C0FA | | + | |
- | | \$C0FB | | + | |
- | | \$C0FC | | + | |
- | | \$C0FD | | + | |
- | | \$C0FE | | + | |
- | | \$C0FF | | + | |
</ | </ | ||
+ | ===== Operating systems ===== | ||
+ | ==== DOS 3.3 ==== | ||
+ | ==== ProDOS 8 ==== | ||
+ | ==== CP/M ==== | ||
+ | In order to run CP/M, a Z80 soft card is required. While we do not currently possess one, it should be possible to find one online --- or we may be able to assemble our own from scratch using available schematics [(msc80scschem)]. | ||
+ | |||
+ | ===== Peripheral cards ===== | ||
+ | As with the rest of this page, we will focus on cards our machine has installed. | ||
+ | |||
+ | The Apple IIe has eight expansion slots (7 regular and 1 auxiliary). This alone is indicative of a completely different era of Apple' | ||
+ | |||
+ | ==== Apple extended 80-column card ==== | ||
+ | ==== Disk II interface ==== | ||
+ | ==== Super Serial ==== | ||
+ | ==== Applied Engineering RAMFactor | ||
+ | A RAM disk/memory expansion. ProDOS automatically registers it as a volume named ''/ | ||
+ | |||
+ | The particular revision we have contains a total of 1 MB of RAM. | ||
+ | |||
+ | ===== Sample code ===== | ||
+ | ==== Determining current execution page ==== | ||
+ | This snippet is particularly useful for writing peripheral card ROM, where the code needs to function irrespective of its installed slot. It works by calling a " | ||
+ | |||
+ | If calling from a peripheral card, the slot number can be identified by ANDing the result with 0F. | ||
+ | <code asm6502> | ||
+ | ; stores the high byte of the execution address in the A register | ||
+ | ; clobbers: A, X | ||
+ | getpage: | ||
+ | JSR $FF58 ; push the return address to the stack | ||
+ | TSX ; use stack pointer as index to stack page | ||
+ | LDA $100, | ||
+ | RTS | ||
+ | </ | ||
+ | |||
+ | ==== Writing bytes as hexadecimal ==== | ||
+ | We don't have to reinvent the wheel for this one --- the [[#system monitor]] includes a handy routine called '' | ||
+ | |||
+ | <code asm6502> | ||
+ | PRBYTE: | ||
+ | LSR A | ||
+ | LSR A | ||
+ | LSR A | ||
+ | LSR A | ||
+ | JSR PRHEXZ | ||
+ | PLA | ||
+ | PRHEX: | ||
+ | PRHEXZ: | ||
+ | CMP #$BA | ||
+ | BCC COUT ; =$FDED | ||
+ | ADC #$06 | ||
+ | COUT: JMP (CSWL) | ||
+ | </ | ||
+ | |||
+ | To make use of it from Applesoft, load the following anywhere into memory: | ||
+ | |||
+ | <code asm6502> | ||
+ | JSR $DEBE ; CHKCOM - skips comma in Applesoft parsing | ||
+ | JSR $DFE3 ; GETPNT - get pointer to variable data, put it in $83...$84 | ||
+ | LDY #$00 | ||
+ | LDA ($83), | ||
+ | JSR $FDDA ; PRBYTE | ||
+ | INY | ||
+ | LDA ($83), | ||
+ | JMP $FDDA ; PRBYTE (will RTS for us) | ||
+ | </ | ||
+ | |||
+ | Then it can be called from Applesoft like so (assuming the program was loaded at \$0300): | ||
+ | |||
+ | <code basic> | ||
+ | 10 LET X% = 69 | ||
+ | 20 CALL 768,X% | ||
+ | </ | ||
+ | |||
+ | ==== Generate the Mandelbrot set ==== | ||
+ | Useful as a benchmark. The computer must be in 80-column mode for it to display properly. | ||
+ | |||
+ | <code basic> | ||
+ | 10 FOR Y=-12 TO 12 | ||
+ | 20 FOR X=-39 TO 39 | ||
+ | 30 CA=X*0.0458 | ||
+ | 40 CB=Y*.08333 | ||
+ | 50 A=CA | ||
+ | 60 B=CB | ||
+ | 70 FOR I = 0 TO 15 | ||
+ | 80 T=A*A-B*B+CA | ||
+ | 90 B=2*A*B+CB | ||
+ | 100 A=T | ||
+ | 110 IF(A*A+B*B)> | ||
+ | 120 NEXT I | ||
+ | 130 PRINT " "; | ||
+ | 140 GOTO 210 | ||
+ | 200 IF I>9 THEN I=I+7 | ||
+ | 205 PRINT CHR$(48+I); | ||
+ | 210 NEXT X | ||
+ | 220 PRINT | ||
+ | 230 NEXT Y | ||
+ | </ | ||
+ | |||
===== Resources ===== | ===== Resources ===== | ||
* [[https:// | * [[https:// | ||
+ | * [[http:// | ||
+ | * [[https:// | ||
+ | |||
+ | ===== Notes ===== | ||
+ | [(Little1985>// | ||
+ | [(a2etechnotes> | ||
+ | [(a2etechrefmanual> | ||
+ | [(msc80scschem> | ||
+ | [(a2eenhpg> | ||
+ | [(Sather1985> | ||
+ | [(usingprodos> | ||
+ | [(allpinoutsa2> | ||
+ | |||
+ | ~~REFNOTES~~ |