ebook img

Apple /// SOS Operating System Source Code Listing - Apple3.org PDF

456 Pages·2006·0.72 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Apple /// SOS Operating System Source Code Listing - Apple3.org

Apple /// Computer Technical Information ————————————————————— Apple /// SOS Operating System Source Code Listing ————————————————————— Version 1.3 Apple Computer -- 1982 —————————————————————————— Assembly Listing Produced by Paul R. Santa-Maria August 2006 —————————————————————————— Apple /// SOS Operating System Source Code Listing | Version 1.3 | Apple Computer | 1982 Assembly Listing Produced by Paul R. Santa-Maria | August 2006 | Page 1 of 456 ——————————————————————————————————————————— Apple III SOS 1.3 Source Code Assembly Commentary ——————————————————————————————————————————— Apple3SOS13List.pdf is where I started from. The six disk images contain the source code. The name contains the slot/drive where it should be mounted; for example, SOS13-42.DSK should be in slot 4 drive 2. I put a DOS 3.3 boot disk in slot 5, drive 1, and the DOS Tool Kit assembler disk in slot 5 drive 2. This means eight 140KB drives have to be connected to the Apple II. This is hard for a real Apple II, but trivial in an Apple II emulator. SOS13-62.DSK has no source code; it got the OBJ files. I modified the source code as little as possible. There was some bit rot on SOS13-41.DSK. Search for BITROT in the listing to see where I had to modify the source so it would assemble. Compare it to the PDF file to see the differences. I changed slot/drive assignments in the source code to match the disk assignments here. I deleted volume numbers. SOS13-D.LST was created using DOS EDASM, while SOS13-P.LST used ProDOS EDASM. SOS13-D.LST ran out of memory while assembling the last file, PRINT. SOS13-P.LST shows the full assembly. SOS13-D.LST shows twelve warnings in INIT but it assembles okay. The warnings are "EXTRN USED AS ZXTRN IN LINE" and are about the label FCBZPP. SOS13- P.LST shows four warnings and fourteen errors in INIT. It seems that the rules have changed between the DOS and ProDOS versions I used. That is why I include listings for both versions of EDASM. I never compared the output files from the assembler with the SOS.KERNEL file, but I have included SOSKERNEL.BIN. if you want to compare. --- Paul R. Santa-Maria --- Temperance, Michigan USA --- August 2006 Apple /// SOS Operating System Source Code Listing | Version 1.3 | Apple Computer | 1982 Assembly Listing Produced by Paul R. Santa-Maria | August 2006 | Page 2 of 456 SOURCE FILE #01 =>SOSLDR.SRC SOURCE FILE #02 =>SOSLDR.A.SRC SOURCE FILE #03 =>SOSLDR.B.SRC SOURCE FILE #04 =>SOSLDR.C.SRC SOURCE FILE #05 =>SOSLDR.D.SRC SOURCE FILE #06 =>SOSLDR.E.SRC SOURCE FILE #07 =>SOSLDR.F.SRC ***** UNDEFINED IDENTIFIER ERROR IN LINE 571 Apple /// SOS Operating System Source Code Listing | Version 1.3 | Apple Computer | 1982 Assembly Listing Produced by Paul R. Santa-Maria | August 2006 | Page 3 of 456 01 SOSLDR.SRC SOS 1.1 SOS LOADER AUGUST-2006 PAGE 2 0000: 2 REL 1E00: 1E00 3 ORG $1E00 1E00: 1E00 4 ZZORG EQU * 1E00: 5 MSB OFF 1E00: 6 **************************************************************************************************** 1E00: 7 * COPYRIGHT (C) APPLE COMPUTER INC. 1980 1E00: 8 * ALL RIGHTS RESERVED 1E00: 9 **************************************************************************************************** 1E00: 10 * 1E00: 11 * SOS KERNEL LOAD & MEMORY POINTS 1E00: 12 * 1E00: 13 * MODULE START END I/O ROM SOS BLOAD SIZE 1E00: 14 *------------------------------------------------------ 1E00: 15 * SOSLDR 1E00 - 28F7 2000 0CF8 1E00: 16 * INIT 28F8 - 2AA9 2AF8 [01B2] 1E00: 17 * SYSGLOB 18FC - 1A03 2CF8 1E00: 18 * 1E00: 19 * BFM.INIT2 + BITMAPS 1E00: 20 * B800 - BBFF 2E00 03FF 1E00: 21 * BFM BC00 - DE62 3200 2263 1E00: 22 * <PATCH> DE63 - DE6A 5463 0008 1E00: 23 * 1E00: 24 * OPRMSG DE6B - E48A X 546B 015A 1E00: 25 * IPL DFC5 - E48F X X 55C5 04CB 1E00: 26 * UMGR E490 - E89D X X 5A8B 040E 1E00: 27 * 1E00: 28 * DISK3 E899 - EE03 X X 5E99 056B 1E00: 29 * SYSERR EE04 - EED8 X 64D9 00D5 1E00: 30 * DEVMGR EED9 - F05D 64D9 0185 1E00: 31 * 1E00: 32 * SCMGR F05E - F2F3 665E 0296 1E00: 33 * FMGR F2F4 - F354 68F4 0061 1E00: 34 * CFMGGR F355 - F551 6955 01FD 1E00: 35 * 1E00: 36 * BUFMGR F552 - F86D 6B52 031C 1E00: 37 * MEMMGR F86E - FFBE 6E6E 0751 1E00: 38 * <END> FFBE 1E00: 39 * 1E00: 40 **************************************************************************************************** 1E00: 41 * SOS LOADER (VERSION = 1.1O ) 1E00: 42 * (DATE = 8/04/81) 1E00: 43 * 1E00: 44 * SOURCE FILES: SOSLDR.SRC, SOSLDR.A.SRC, SOSLDR.B.SRC, SOSLDR.C.SRC, 1E00: 45 * SOSLDR.D.SRC, SOSLDR.E.SRC, SOSLDR.F.SRC 1E00: 46 * 1E00: 47 * FUNCTION: 1E00: 48 * MOVES AND INITIALIZES SOS KERNEL, READS INTERPRETER FROM DISK, READS CHARACTER SET TABLE, 1E00: 49 * KEYBOARD TABLE AND DRIVERS FROM DISK, INITIALIZES ALL DRIVERS AND THEN JUMPS TO INTERPRETER 1E00: 50 * ENTRY POINT. 1E00: 51 * 1E00: 52 * CALLED BY: 1E00: 53 * SOSBOOT 7.0 WITH KERNEL FILE LOADED AT $I:1E00.9FFF(MAX) 1E00: 54 * WHERE: $I=INTERPRETER BANK (HIGHEST BANK IN SYSTEM) 1E00: 55 * 1E00: 56 * CALLS: 1E00: 57 * INTERPRETER ENTRY POINT (FIRST BYTE OF INTERPRETER CODE) Apple /// SOS Operating System Source Code Listing | Version 1.3 | Apple Computer | 1982 Assembly Listing Produced by Paul R. Santa-Maria | August 2006 | Page 4 of 456 01 SOSLDR.SRC SOS 1.1 SOS LOADER AUGUST-2006 PAGE 3 1E00: 58 * 1E00: 59 * DOCUMENTS: 1E00: 60 * SOS ERS APPENDICES - XX/XX/81 1E00: 61 * APPLE III I/O SYSTEM PROGRAMMERS GUIDE - DEC-15-80 1E00: 62 * 1E00: 63 * CONSTRAINTS: 1E00: 64 * INTERPRETER FILE: READ INTO BANK 0 BEGINNING AT $80:LDREND+$400(=BUFSIZE). 1E00: 65 * INTERPRETER CODE DOES NOT CONTAIN RELOCATION INFORMATION. 1E00: 66 * MAX = 38K ($I:2000..B7FF) 1E00: 67 * MIN = .25K ($I:B700..B7FF) 1E00: 68 * 1E00: 69 * DRIVER FILE: READ INTO BANK 0 BEGINNING AT $80:LDREND+$400(=BUFSIZE). 1E00: 70 * DRIVER MODULES ARE RELOCATED AND MOVED TO THE HIGHEST AVAILABLE 32K BANK USING 1E00: 71 * A "FIRST FIT" ALGORITHM. MODULES ARE REMOVED FROM THE FILE BEGINNING AT THE BACK 1E00: 72 * AND WORKING TOWARD THE FRONT. A DRIVER MODULE CANNOT SPAN A BANK BOUNDARY. 1E00: 73 * 1E00: 74 * DRIVER FILE: MAX = 60K (APPROX) DRIVER MODULE: MAX = 32K-1 1E00: 75 * MIN = .25K MIN < .25K 1E00: 76 * 1E00: 77 * 1E00: 78 * DATA STRUCTURES: 1E00: 79 * SOS.KERNEL FILE FORMAT 1E00: 80 * SOS.INTERP FILE FORMAT 1E00: 81 * SOS.DRIVER FILE FORMAT 1E00: 82 * 1E00: 83 **************************************************************************************************** Apple /// SOS Operating System Source Code Listing | Version 1.3 | Apple Computer | 1982 Assembly Listing Produced by Paul R. Santa-Maria | August 2006 | Page 5 of 456 01 SOSLDR.SRC SOS 1.1 SOS LOADER AUGUST-2006 PAGE 4 1E00: 85 **************************************************************************************************** 1E00: 86 * 1E00: 87 * NOTATION: 1E00: 88 * 1E00: 89 * A, X, Y ::= 6502 REGISTERS 1E00: 90 * 1E00: 91 * C, OV ::= CARRY, OVERFLOW FLAGS IN 6502 STATUS (P) REGISTER 1E00: 92 * E, Z, B ::= ENVIRONMENT, ZERO PAGE, BANK REGISTERS (SYSTEM CONTROL REGISTERS) 1E00: 93 * 1E00: 94 * (1.I.S.R:W.P.R.R) ::= ENVIRONMENT REGISTER FLAGS. FROM LEFT TO RIGHT BITS 7..0 1E00: 95 * (1MHZ, I/O ENABLE, SCREEN ENABLE, RESET ENABLE, 1E00: 96 * WRITE PROTECT, PRIMARY STACK, ROM1, ROM ENABLE) 1E00: 97 * 1E00: 98 * "POSITIVE LOGIC" ::= ALL LOGIC USED IS POSITIVE LOGIC. FOR EXAMPLE, C="NO DRIVERS LEFT" 1E00: 99 * INDICATES THAT NO DRIVERS ARE LEFT WHEN CARRY = SET, AND THAT ONE OR 1E00: 100 * MORE DRIVERS ARE LEFT WHEN CARRY = CLEAR. 1E00: 101 * 1E00: 102 * TRUE,FALSE ::= TRUE = SET = ON, WHILE FALSE = CLEAR = OFF. 1E00: 103 * 1E00: 104 **************************************************************************************************** 1E00: 105 * 1E00: 106 * ABBREVIATIONS: 1E00: 107 * 1E00: 108 * DIB ::= DEVICE INFORMATION BLOCK. DEFINES A UNIQUE DEVICE THAT CAN BE LINKED 1E00: 109 * INTO THE SYSTEM DEVICE TABLE. EACH DRIVER MODULE CONTAINS ONE OR MORE 1E00: 110 * DIBS (DEVICES) EACH OF WHICH CAN BE "ACTIVE" OR "INACTIVE". 1E00: 111 * 1E00: 112 * ADIB ::= "ACTIVE DIB" 1E00: 113 * 1E00: 114 * <VARNAME>.P ::= POINTER. A 3 BYTE ZERO PAGE POINTER. DON'T FORGET THE X BYTE! 1E00: 115 * 1E00: 116 * SDT ::= SYSTEM DEVICE TABLE. CONTAINS THE ENTRY POINT AND DIB ADDRESS OF EACH 1E00: 117 * DEVICE CONFIGURED INTO THE SYSTEM, (USED BY THE DEVICE MANAGER). 1E00: 118 **************************************************************************************************** 1E00: 119 * 1E00: 120 CHN SOSLDR.A.SRC Apple /// SOS Operating System Source Code Listing | Version 1.3 | Apple Computer | 1982 Assembly Listing Produced by Paul R. Santa-Maria | August 2006 | Page 6 of 456 02 SOSLDR.A.SRC SOS 1.1 SOS LOADER AUGUST-2006 PAGE 5 1E00: 2 ************************************************************************************************************** 1E00: 3 * 1E00: 4 * $1E00 +---------------+ 1E00: 5 * ! SOSLDR !<-ENTRY SOS MEMORY MAP 1E00: 6 * $1FFF +---------------+ ----- (128K APPLE ///) 1E00: 7 * 1E00: 8 * BANK 0 BANK 1 BANK 2 1E00: 9 * $2000 +---------------+ +---------------+ +---------------+ 1E00: 10 * ! ! ! ! ! ! 1E00: 11 * ! ! ! ! ! SOSLDR ! 1E00: 12 * ! ! ! ! ! & ! 1E00: 13 * ! ! ! ! ! INIT MODULE ! 1E00: 14 * ! ! ! ! ! ! 1E00: 15 * ! ! ! ! ! - - - - - - - ! 1E00: 16 * ! ! ! ! ! GLOBALS ! 1E00: 17 * ! ! ! ! ! - - - - - - - ! 1E00: 18 * ! ! ! ! ! ! 1E00: 19 * ! ! ! ! ! ! 1E00: 20 * ! ! ! ! ! ! ! 1E00: 21 * ! ! ! ! ! ! ! 1E00: 22 * ! ! ! ! ! ! ! 1E00: 23 * ! ! ! ! ! ! ! 1E00: 24 * ! ! ! ! ! ! ! 1E00: 25 * ! ! ! ! ! ! ! 1E00: 26 * ! ! ! ! ! ! KERNEL ! 1E00: 27 * ! ! ! ! ! ! ! 1E00: 28 * ! ! ! ! ! ! ! 1E00: 29 * ! ! ! ! ! ! ! 1E00: 30 * ! ! ! ! ! ! ! 1E00: 31 * ! ! ! ! ! ! ! 1E00: 32 * ! ! ! ! ! ! ! 1E00: 33 * ! ! ! ! ! ! ! 1E00: 34 * ! ! ! ! ! ! ! 1E00: 35 * ! ! ! ! ! ! ! 1E00: 36 * ! ! ! ! ! !-- EOF --! 1E00: 37 * ! ! ! ! ! ! ! 1E00: 38 * ! ! ! ! ! ! ! 1E00: 39 * ! ! ! ! ! ! ! 1E00: 40 * ! ! ! ! ! ! ! 1E00: 41 * ! ! ! ! ! ! ! 1E00: 42 * $9FFF +---------------+ +---------------+ +---------------+ 1E00: 43 * 1E00: 44 * 1E00: 45 * $A000 +---------------+ 1E00: 46 * . ! SOSBOOT ! 1E00: 47 * . +---------------+ 1E00: 48 * 1E00: 49 * 1E00: 50 * FIGURE 1. SOS KERNEL FILE READ INTO $2:1E00..9FFF BY SOS BOOT IN BLOCKS 0,1. 1E00: 51 * SOS LOADER BEGINS EXECUTION AT THIS POINT. 1E00: 52 * 1E00: 53 * 1E00: 54 * 1E00: 55 * 1E00: 56 ************************************************************************************************************** Apple /// SOS Operating System Source Code Listing | Version 1.3 | Apple Computer | 1982 Assembly Listing Produced by Paul R. Santa-Maria | August 2006 | Page 7 of 456 02 SOSLDR.A.SRC SOS 1.1 SOS LOADER AUGUST-2006 PAGE 6 1E00: 58 ************************************************************************************************************** 1E00: 59 * 1E00: 60 * $1E00 +---------------+ 1E00: 61 * ! SOSLDR ! SOS MEMORY MAP 1E00: 62 * $1FFF +---------------+ (128K APPLE ///) 1E00: 63 * 1E00: 64 * BANK 0 BANK 1 BANK 2 1E00: 65 * $2000 +---------------+ +---------------+ +---------------+ 1E00: 66 * ! ! ! ! ! ! ! 1E00: 67 * ! SOSLDR ! ! ! ! ! 1E00: 68 * ! & ! ! ! ! ! 1E00: 69 * ! INIT MODULE ! ! ! ! ! 1E00: 70 * ! ! ! ! ! ! ! 1E00: 71 * LDREND ! - - - - - - - ! ! ! ! ! 1E00: 72 * ! FILE BUFFER ! ! ! ! ! 1E00: 73 * ! - - - - - - - ! ! ! ! ! 1E00: 74 * ! ! ! ! ! ! ! 1E00: 75 * ! ! ! ! ! ! ! 1E00: 76 * ! ! ! ! ! ! ! 1E00: 77 * ! ! ! ! ! ! ! 1E00: 78 * ! ! ! ! ! ! ! 1E00: 79 * ! ! ! ! ! ! ! 1E00: 80 * ! INTERPRETER ! ! INTERPRETER ! ! ! 1E00: 81 * ! FILE ! ! FILE ! ! ! 1E00: 82 * ! ! ! ! ! ! ! 1E00: 83 * ! ! ! ! ! ! ! 1E00: 84 * ! ! ! ! ! ! ! 1E00: 85 * ! ! ! ! ! ! ! 1E00: 86 * ! ! ! ! ! ! ! 1E00: 87 * ! ! ! ! ! ! ! 1E00: 88 * ! ! ! ! ! ! ! 1E00: 89 * ! ! ! ! ! ! ! 1E00: 90 * ! ! ! ! ! ! ! 1E00: 91 * ! ! ! ! ! ! ! 1E00: 92 * ! ! ! ! ! ! ! 1E00: 93 * ! ! ! ! ! ! ! 1E00: 94 * ! ! ! ! ! ! ! 1E00: 95 * ! ! ! ! ! ! ! 1E00: 96 * ! ! ! ! ! ! ! 1E00: 97 * ! ! !- - - EOF - - -! ! ! 1E00: 98 * $9FFF +---------------+ +---------------+ +---------------+ 1E00: 99 * 1E00: 100 * 1E00: 101 * 1E00: 102 * 1E00: 103 * FIGURE 2. SOS INTERPRETER FILE READ INTO BANKS 0 AND 1 1E00: 104 * USING EXTENDED ADDRESSING (X=$80). 1E00: 105 * 1E00: 106 * 1E00: 107 * 1E00: 108 * 1E00: 109 * 1E00: 110 ************************************************************************************************************** 1E00: 111 * 1E00: 112 CHN SOSLDR.B.SRC Apple /// SOS Operating System Source Code Listing | Version 1.3 | Apple Computer | 1982 Assembly Listing Produced by Paul R. Santa-Maria | August 2006 | Page 8 of 456 03 SOSLDR.B.SRC SOS 1.1 SOS LOADER AUGUST-2006 PAGE 7 1E00: 2 * 1E00: 3 ;******************************************************************************* 1E00: 4 ; 1E00: 5 ; $1E00 +---------------+ 1E00: 6 ; ! SOSLDR ! SOS MEMORY MAP 1E00: 7 ; $1FFF +---------------+ (128K APPLE ///) 1E00: 8 ; 1E00: 9 ; BANK 0 BANK 1 BANK 2 1E00: 10 ; $2000 +---------------+ +---------------+ +---------------+ 1E00: 11 ; ! ! ! ! ! ! 1E00: 12 ; ! SOSLDR ! ! ! ! ! 1E00: 13 ; ! & ! ! ! ! ! 1E00: 14 ; ! INIT MODULE ! ! ! ! ! 1E00: 15 ; ! ! ! ! ! ! 1E00: 16 ; ! - - - - - - - ! ! ! ! ! 1E00: 17 ; ! FILE BUFFER ! ! ! ! ! 1E00: 18 ; ! - - - - - - - ! ! ! ! ! 1E00: 19 ; ! ! ! ! ! ! 1E00: 20 ; ! ! ! ! ! ! ! 1E00: 21 ; ! ! ! ! ! ! ! 1E00: 22 ; ! ! ! ! ! ! ! 1E00: 23 ; ! ! ! ! ! ! ! 1E00: 24 ; ! ! ! ! ! ! ! 1E00: 25 ; ! ! ! ! ! ! ! 1E00: 26 ; ! ! ! ! ! ! ! 1E00: 27 ; ! ! ! ! ! ! ! 1E00: 28 ; ! ! ! ! ! ! ! 1E00: 29 ; ! ! ! ! ! ! ! 1E00: 30 ; ! ! ! ! ! ! ! 1E00: 31 ; ! ! ! ! ! ! - - - - - - ! 1E00: 32 ; ! DRIVER ! ! DRIVER ! ! ! 1E00: 33 ; ! FILE ! ! FILE ! ! ! 1E00: 34 ; ! ! ! ! ! ! ! 1E00: 35 ; ! ! ! ! ! ! ! 1E00: 36 ; ! ! ! ! ! ! INTERPRETER ! 1E00: 37 ; ! ! ! ! ! ! CODE ! 1E00: 38 ; ! ! ! ! ! ! ! 1E00: 39 ; ! ! ! ! ! ! ! 1E00: 40 ; ! ! ! ! ! ! ! 1E00: 41 ; ! ! ! ! ! ! ! 1E00: 42 ; ! ! !- - - EOF - - -! ! ! 1E00: 43 ; $9FFF +---------------+ +---------------+ +---------------+ 1E00: 44 ; 1E00: 45 ; 1E00: 46 ; 1E00: 47 ; 1E00: 48 ; FIGURE 3. SOS DRIVER FILE READ INTO BANKS 0 AND 1 1E00: 49 ; USING EXTENDED ADDRESSING (X=$80). 1E00: 50 ; 1E00: 51 ; 1E00: 52 ; 1E00: 53 ; 1E00: 54 ;******************************************************************************* 1E00: 55 ;!BITROT Apple /// SOS Operating System Source Code Listing | Version 1.3 | Apple Computer | 1982 Assembly Listing Produced by Paul R. Santa-Maria | August 2006 | Page 9 of 456 03 SOSLDR.B.SRC SOS 1.1 SOS LOADER AUGUST-2006 PAGE 8 1E00: 57 ;!BITROT 1E00: 58 ; ! ! ! ! ! ! ! 1E00: 59 ; $9FFF +---------------+ +---------------+ ! +---------------+ 1E00: 60 ; ! 1E00: 61 ; ! 1E00: 62 ; ! (SYSTEM DEVICE TABLE) 1E00: 63 ; ! 1E00: 64 ; FIGURE 4. SOS LOADER FINISHED. JUMP TO DIB ADR BANK UNIT 1E00: 65 ; FIRST BYTE OF INTERPRETER'S CODE. !-----!-----!-----!-----! 1E00: 66 ; ! ! ! ! ! 1E00: 67 ; ! ! ! ! ! 1E00: 68 ; ! ! ! ! ! 1E00: 69 ; ! ! ! ! ! 1E00: 70 ; !-----!-----!-----!-----! 1E00: 71 ; 1E00: 72 ; 1E00: 73 ; 1E00: 74 ;******************************************************************************* 1E00: 75 CHN SOSLDR.C.SRC ;BITROT Apple /// SOS Operating System Source Code Listing | Version 1.3 | Apple Computer | 1982 Assembly Listing Produced by Paul R. Santa-Maria | August 2006 | Page 10 of 456

Description:
Apple /// SOS Operating System Source Code Listing | Version 1.3 | Apple Computer | 1982 Assembly Listing Produced by Paul R. Santa-Maria | August 2006
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.