MPW IIGS Assembler - Ver 1.1b1 06-Nov-90 Page 1 Copyright Apple Computer, Inc. 1987-1990 Loc SLoc Object Code Addr T M Source Statement ;******************************************************* ; ; Develop Code Samples. ; ; Written by Matt Gulick. Started October 16,1990 ; ;******************************************************* ;******************************************************* ; ; This file contains the code samples that are used in ; the Scanning From ProDOS article in DEVELOP. These ; code segments may be used freely by anyone. All ; code in this file assumes that we are running in an ; 8 bit Apple IIe. ; ;******************************************************* ;******************************************************* ; ; Revision History: ; ;******************************************************* ; Oct 16, 1990 File started. ; STRING PASCAL BLANKS OFF PAGESIZE 70 PRINT NOGEN PRINT NOMDIR MACHINE M65C02 MPW IIGS Assembler - Ver 1.1b1 06-Nov-90 Page 2 Copyright Apple Computer, Inc. 1987-1990 Loc SLoc Object Code Addr T M Source Statement ;******************************************************* ; ; CODE SAMPLE #1 ; ; This first code segment walks the slots starting at ; slot 7, looking first for a card of any kind. Once ; found, we check the ID bytes for a Smartport card. ; Once found we check the ID Type byte to see if it is ; a SCSI Card. If it passes all these tests, we then ; issue a Device $00 Status $00 call to further ensure ; that this is the Apple High-Speed SCSI Card. ; ;******************************************************* ; ; The following are Equates ; that will bee used in all ; the Sample Code Segments ; that follow. ; 0000 00C7 slot_7 equ $C7 0000 00C1 slot_1 equ $C1 0000 0042 My_ZPage equ $42 0000 C000 KBD equ $C000 ;Keyboard 0000 C00C CLR80VID equ $C00C ;Disable 80-column hardware 0000 C00D SET80VID equ $C00D ;Enable 80-column hardware 0000 C010 KBD_STRB equ $C010 ;Keyboard Strobe 0000 C018 RD80COL equ $C018 ;Read 80 Col. Mode 0000 C01A RDTEXT equ $C01A ;Read Text Mode 0000 C01B RDMIX equ $C01B ;Read Mix Mode 0000 C01C RDPAGE2 equ $C01C ;Read Page 2 setting 0000 C01D RDHIRES equ $C01D ;Read HiRes setting 0000 C050 TXTCLR equ $C050 ;Clear Text Mode 0000 C051 TXTSET equ $C051 ;Set Text Mode 0000 C052 MIXCLR equ $C052 ;Clear Mixed Mode 0000 C053 MIXSET equ $C053 ;Set Mixed Mode 0000 C054 TXTPAGE1 equ $C054 ;Set Text Page 1 0000 C055 TXTPAGE2 equ $C055 ;Set Text page 2 0000 C056 LORES equ $C056 ;Set LoRes Graphics 0000 C057 HIRES equ $C057 ;Set HiRes Graphics 0000 C05E CLRAN3 equ $C05E ;Clear annunciator 3 0000 C05F SETAN3 equ $C05F ;Set annunciator 3 0000 009B ESC equ $9B ;High bit set ASCII ESC Key 0000 0001 Blk_sig1 equ $01 0000 0003 Blk_sig2 equ $03 0000 0005 Blk_sig3 equ $05 0000 0007 SPort_sig equ $07 0000 00FB SPort_ID equ $FB 0000 0080 Ext_SPort equ %10000000 ;Bit 7 0000 0002 SCSI equ %00000010 ;Bit 2 0000 0000 No_Err equ $00 0000 0027 IO_Err equ $27 0000 0028 No_dev equ $28 ;******************************************************* EXPORT P8_Scanner 00000 0000 P8_Scanner PROC 00000 0000 ; 00000 0000 ; Main Code Segment. 00000 0000 ; 00000 0000 MPW IIGS Assembler - Ver 1.1b1 06-Nov-90 Page 3 Copyright Apple Computer, Inc. 1987-1990 Loc SLoc Object Code Addr T M Source Statement 00000 0000 20 FFFF 00018 6 jsr find_card 00003 0003 20 FFFF 000FA 6 jsr find_scanr 00006 0006 20 FFFF 0018E 6 jsr htone_filter 00009 0009 20 FFFF 001F5 6 jsr def_window 0000C 000C 20 FFFF 0027B 6 jsr start_scan 0000F 000F 20 FFFF 002CE 6 jsr get_data 00012 0012 20 FFFF 005C3 6 jsr display 00015 0015 90 E9 00000 2 bcc P8_Scanner 00017 0017 60 6 rts 00018 0018 00018 0018 ;******************************************************* 00018 0018 ; 00018 0018 ; CODE SAMPLE #1 00018 0018 ; 00018 0018 ; This first code segment walks the slots starting at 00018 0018 ; slot 7, looking first for a card of any kind. Once 00018 0018 ; found, we check the ID bytes for a Smartport card. 00018 0018 ; Once found we check the ID Type byte to see if it is 00018 0018 ; a SCSI Card. If it passes all these tests, we then 00018 0018 ; issue a Device $00 Status $00 call to further ensure 00018 0018 ; that this is the Apple High-Speed SCSI Card. 00018 0018 ; 00018 0018 ;******************************************************* 00018 0018 00018 0018 find_card 00018 0018 ; 00018 0018 ; Save the current Zero 00018 0018 ; Page values before 00018 0018 ; using them. 00018 0018 ; 00018 0018 A5 42 3 lda