annotate level1/modules/scf.asm @ 2879:531841047512 lwtools-port

boot_scsi.asm: Fix SCSI ID when booting from SCSI Due to a typo it would probe for SCSI ID 4 instead of default 0 (or 8 for HDBDOS/SuperDriver).
author Tormod Volden <debian.tormod@gmail.com>
date Sun, 24 Nov 2013 16:08:53 +0100
parents f91dc5c378f6
children 5a5cff419c0b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1 ********************************************************************
2392
ce8e20d715e4 Updated edition
boisy
parents: 2390
diff changeset
2 * SCF - NitrOS-9 Sequential Character File Manager
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
3 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
4 * $Id$
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
5 *
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
6 * This contains an added SetStat call to allow placing prearranged data
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
7 * into the keyboard buffer of ANY SCF related device.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
8 *
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
9 * Usage:
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
10 *
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
11 * Entry: X = Pointer to the string
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
12 * Y = Length of the string
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
13 * A = Path number
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
14 * B = SS.Fill ($A0) (syscall SETSTAT function call number)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
15 * NOTE: If high bit of Y is set, no carriage return will be appended to
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
16 * the read buffer (used in Shellplus V2.2 history)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
17 *
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
18 * This also includes Kevin Darlings SCF Editor patches.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
19 *
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 201
diff changeset
20 * Edt/Rev YYYY/MM/DD Modified by
10957d54bf16 Made all modules rev 0
boisy
parents: 201
diff changeset
21 * Comment
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
22 * ------------------------------------------------------------------
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
23 * 1993/04/20 ???
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
24 * V1.09:
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
25 * - Speeded up L05CC (write char to device) routine by a few cycles
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
26 * - Slightly optimized Insert char.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
27 * - Move branch table so Read & ReadLn are 1 cycle faster each; fixed
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
28 * SS.Fill so size is truncated @ 256 bytes.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
29 * - Added NO CR option to SS.Fill (for use with modified Shellplus V2.2
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
30 * command history).
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
31 *
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
32 * 1993/04/21 ???
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
33 * Slight speedup to some of ReadLn parsing, TFM's in Open/Close.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
34 * - More optimization to read/write driver calls
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
35 * - Got rid of branch table @ L05E3 for speed
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
36 *
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
37 * 1993/05/21 ???
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
38 * V1.10:
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
39 * Added Boisy Pitre's patch for non-sharable devices.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
40 * - Saved 4 cycles in routine @ L042B
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
41 * - Modified Boisy's routine to not pshs/puls B (saves 2 cycles).
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
42 * - Changed buffer prefill of CR's to save 1 byte.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
43 *
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
44 * 1993/07/27 ???
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
45 * V1.11:
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
46 * Changed a BRA to a LBRA to a straight LBRA in L0322.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
47 * - Optimized path option character routine @ L032C
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
48 *
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
49 * 1993/08/03 ???
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
50 * Modified vector table @ L033F to save 1 cycle on PD.PSC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
51 * - Sped up uppercase conversion checks for ReadLn & WritLn
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
52 * - Changed 2 BRA's to L02F9 to do an LBRA straight to L05F8 (ReadLn loop)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
53 * - Moved L0565 routine so Reprint line, Insert & Delete char (on ReadLn)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
54 * are 1 cycle faster / char printed
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
55 * - Changed 2 references to L0420 to go straight to L0565
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
56 * - Sped up ReadLn loop by 2 or 3 cycles per char read
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
57 *
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
58 * 1993/09/21 ???
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
59 * V1.12:
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
60 * Sped up L0435 by 1 or 2 cycles (depending on branch)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
61 * - Changed LDD ,S to TFR X,D (saves 1 cycle) @ L04F1 (Write & WritLn)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
62 * - Modified L04F1 to use W without TFR (+1 byte, -3 cycles) (Write)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
63 *
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
64 * 1993/11/09 ???
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
65 * Took LDX #0/LDU PD.BUF,y from L03B5 & merged in @ L028A, L02EF & L0381.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
66 * Also changed BEQ @ L03A5 to skip re-loading X with 0.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
67 *
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
68 * 1993/11/10 ???
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
69 * Moved L04B2 routine to allow a couple of BSR's instead of LBSR's In READ.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
70 * - Moved driver call right into READ loop (should save 25 cycles/char read)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
71 * - Moved driver call right into L0565 (should save 12 cycles/char written on echo,
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
72 * line editing, etc.)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
73 *
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
74 * 1993/11/26 ???
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
75 * Moved L02FE (ReadLn parsing) to end where ReadLn routine is moved L03E2
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
76 * so Read loop would be optimized for it (read char from driver) instead of
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
77 * L042B (write filled buffer to caller).
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
78 * Changed LDA #C$NULL to CLRA.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
79 *
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
80 * 1993/12/01 ???
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
81 * Modified device write call (L056F) to preserve Y as well, to cut down on
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
82 * PSHS/PULS.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
83 * - Changed L03E2 & L03DA to exit immediately if PD.DEV or PD.DV2 (depending
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
84 * on which routine) is empty (eliminated redundant LEAX ,X).
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
85 *
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
86 * 1994/05/31 ???
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
87 * Attempted mode to L03F1 to eliminate LDW #D$READ, changed:
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
88 * LDX V$DRIV,x
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
89 * ADDW M$Exec,x
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
90 * JSR w,x
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
91 * to:
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
92 * LDW V$DRIV,x
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
93 * ADDW M$Exec,w
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
94 * JSR D$READ,w
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
95 * Did same to L05C9 & L056F (should speed up each by 1 cycle)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
96 *
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
97 * 1994/06/07 ???
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
98 * Attempted to modify all M$Exec calls to use new V$DRIVEX (REQUIRES NEW IOMAN)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
99 * - L01FA (Get/SetStat), L03F1 (Read), L05C9 (Write), L056F (Write)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
100 * - Changed L046A to use LDB V.BUSY,x...CMPB ,s...TFR B,A
2370
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
101 *
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
102 * 1994/06/08 ???
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
103 * Changed TST <PD.EKO,y in read loop (L02BC) to LDB PD.EKO,y
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
104 * - Changed LEAX 1,X to LDB #1/ABX @ L02C4
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
105 * - Changed LEAX >L033F,pc @ L032C to use < (8 bit) version
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
106 * - Modified L02E5 to use D instead of X, allowing TSTA, and faster exit on 0 byte
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
107 * just BRAnching to L0453
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
108 *
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
109 * 1994/06/09 ???
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
110 * Changed LEAX 1,X to LDB #1/ABX @ L053D, L05F8, L0312, L0351, L03B8
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
111 * - Changed to L0573: All TST's changed to LDB's
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
112 * - Changed Open/Create init to use LEAX,PC instead of BSR/PULS X
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
113 * - Changed TST PD.CNT,y to LDA PD.CNT,y @ close
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
114 * - Eliminated L010D, changed references to it to go to L0129
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
115 * - Eliminated useless LEAX ,X @ L0182, and changed BEQ @ L0182 to go to L012A
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
116 * instead of L0129 (speeds CLOSE by 5 or 10 cycles)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
117 * - Moved L06B9 into L012B, eliminate BSR/RTS, plus
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
118 * - Changed TST V.TYPE,x to LDB V.TYPE,x
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
119 * - Moved L0624 to just before L05F8 to eliminate BRA L05F8 (ReadLn)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
120 * - Changed TST PD.EKO,y @ L0413 to LDB PD.EKO,y
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
121 * - Moved L0413-L0423 routines to later in code to allow short branches
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
122 * - As result of above, changed 6 LBxx to Bxx
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
123 * - Changed TST PD.MIN,y @ L04BB to LDA PD.MIN,y
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
124 * - Changed TST PD.RAW,y/TST PD.UPC,y @ L0523 to LDB's
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
125 * - Changed TST PD.ALF,y @ L052A to LDB
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
126 * - L053D: Moved TST PD.RAW,y to before LDA -1,u to speed up WRITE, changed it to LDB
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
127 *
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
128 * 1994/06/10 ???
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
129 * Changed TST PD.ALF,y to LDB @ L052A
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
130 * - Changed CLR V.WAKE,u to CLRA/STA V.WAKE,u @ L03F1 (Read)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
131 * - Changed CLR V.BUSY,u to CLRA/STA V.BUSY,u @ L045D
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
132 * - Changed CLR PD.MIN,y to CLRA/STA PD.MIN,y, moved before LDA P$ID,x @ L04A7
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
133 * - Changed CLR PD.RAW,y @ L04BB to STA PD.RAW, since A already 0 to get there
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
134 * - Changed CLR V.PAUS,u to CLRA/STA V.PAUS,u @ L05A2
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
135 * - Changed TST PD.RAW,y to LDA PD.RAW,y @ L05A2
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
136 * - Changed TST PD.ALF,y to LDA PD.ALF,y @ L05A2
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
137 * - Changed CLR V.WAKE,u to CLRB/STB V.WAKE,u @ L05C9
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
138 * - Changed CLR V.WAKE,u to CLRB/STB V.WAKE,u @ L056F
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
139 * - Changed TST PD.UPC,y to LDB PD.UPC,y @ L0322
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
140 * - Changed TST PD.DLO,y/TST PD.EKO,y to LDB's @ L03A5
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
141 *
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
142 * 1994/06/16 ???
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
143 * Changed TST PD.UPC,y to LDB PD.UPC,y @ L0322
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
144 * - Changed TST PD.BSO,y to LDB PD.BSO,y @ L03BF
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
145 * - Changed TST PD.EKO,y to LDB PD.EKO,y @ L03BF
2386
e454c42a134b More fixes
boisy
parents: 2385
diff changeset
146 *
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
147 * 2002/10/11 Boisy G. Pitre
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
148 * Merged NitrOS-9 and TuneUp versions for single-source maintenance. Note that
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
149 * the 6809 version of TuneUp never seemed to call GrfDrv directly to do fast screen
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
150 * writes (see note around g.done label).
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
151 *
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
152 * 16r2 2002/05/16 Boisy G. Pitre
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
153 * Removed pshs/puls of b from sharable code segment for non-NitrOS-9 because it was
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
154 * not needed.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
155 *
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
156 * 16r3 2002/08/16 Boisy G. Pitre
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
157 * Now uses V$DRIVEX.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
158 *
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
159 * 16r4 2004/07/12 Boisy G. Pitre
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
160 * 6809 version now calls the FAST TEXT entry point of GrfDrv.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
161 *
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
162 * 17 2010/01/15 Boisy G. Pitre
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
163 * Fix for bug described in Artifact 2932883 on SF
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
164 * Also added Level 1 conditionals for eventual backporting
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
165
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
166 *
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
167 * 17 2010/01/15 Boisy G. Pitre
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
168 * Handling of device exclusivity using the SHARE. bit has been rearchitected.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
169 * The '93 patch looked at the mode bytes in the descriptor and driver and
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
170 * determined that if both were set, then only one path would be allowed to
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
171 * be opened on the device at a time.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
172 * I now believe this is wrong.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
173 * The mode bytes in the device driver and descriptor are capability bytes.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
174 * They advertise what the device is capable of doing (READ, WRITE, etc) so
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
175 * the mode bytes alone do not convey action, but merely what is possible.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
176 * When the user calls I$Open on a device, he passes the desired mode byte
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
177 * in RegA and IOMan checks to make sure that all bits in that register are
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
178 * set in the mode bytes of the driver and descriptor. So once we get into
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
179 * the Open call of this file manager, we know that all set bits in RegA are
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
180 * also set in the mode bytes of the driver and descriptor.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
181 *
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
182 * For SHARE., what we SHOULD be doing is checking the number of open paths
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
183 * on the device. If the SHARE. bit is set in RegA, then we check if a path
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
184 * is already open and if so, return the E$DevBsy error.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
185 * Likewise, if SHARE. is not set in RegA, we check the path at the head of
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
186 * the open path list, and if ITS mode byte has the SHARE. bit set, we exit
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
187 * with E$DevBsy too. The idea is that if the SHARE. bit is set on the newly
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
188 * opened path or an existing path, then there can "be only one."
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
189 *
2392
ce8e20d715e4 Updated edition
boisy
parents: 2390
diff changeset
190 * 18 2010/01/23 Boisy G. Pitre
ce8e20d715e4 Updated edition
boisy
parents: 2390
diff changeset
191 * SCF has successfully been backported to NitrOS-9 Level 1.
2386
e454c42a134b More fixes
boisy
parents: 2385
diff changeset
192 * SCF now returns on carry set after calling SS.Open. Prior to this
e454c42a134b More fixes
boisy
parents: 2385
diff changeset
193 * change, SS.ComSt would be called right after SS.Open even if SS.Open
e454c42a134b More fixes
boisy
parents: 2385
diff changeset
194 * failed. This caused misery with the scdwn driver wildcard feature.
2392
ce8e20d715e4 Updated edition
boisy
parents: 2390
diff changeset
195 *
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
196
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
197 nam SCF
2392
ce8e20d715e4 Updated edition
boisy
parents: 2390
diff changeset
198 ttl NitrOS-9 Sequential Character File Manager
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
199
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
200 IFP1
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
201 use defsfile
2682
f91dc5c378f6 Remove references to include scfdefs
William Astle <lost@l-w.ca>
parents: 2624
diff changeset
202 ; use scfdefs
2624
b8c7b7fbf3c9 Major changes:
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2394
diff changeset
203 IFGT Level-1
b8c7b7fbf3c9 Major changes:
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2394
diff changeset
204 use cocovtio.d
b8c7b7fbf3c9 Major changes:
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2394
diff changeset
205 ENDC
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
206 ENDC
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
207
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
208 tylg set FlMgr+Objct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
209 atrv set ReEnt+rev
2392
ce8e20d715e4 Updated edition
boisy
parents: 2390
diff changeset
210 rev set 0
ce8e20d715e4 Updated edition
boisy
parents: 2390
diff changeset
211 edition equ 18
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
212
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
213 mod eom,SCFName,tylg,atrv,SCFEnt,0
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
214
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
215 SCFName fcs /SCF/
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
216 fcb edition
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
217
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
218
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
219 * Default input buffer setting for SCF devices when Opened/Created
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
220 * 123456789!123456789!1234567890
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
221 *msg fcc 'by B.Nobel,C.Boyle,W.Gale-1993'
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
222 msg fcc 'www.nitros9.org'
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
223 msgsize equ *-msg Size of default input buffer message
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
224 fcb C$CR 2nd CR for buffer pad fill
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
225 blksize equ 256-msgsize Size of blank space after it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
226
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
227 * Return bad pathname error
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
228 opbpnam puls y
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
229 bpnam comb Set carry for error
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
230 ldb #E$BPNam Get error code
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
231 oerr rts Return to caller
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
232
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
233 * I$Create/I$Open entry point
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
234 * Entry: Y= Path dsc. ptr
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
235 open ldx PD.DEV,y Get device table pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
236 stx PD.TBL,y Save it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
237 ldu PD.RGS,y Get callers register stack pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
238 pshs y Save path descriptor pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
239 ldx R$X,u Get pointer to device pathname
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
240 os9 F$PrsNam Parse it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
241 bcs opbpnam Error, exit
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
242 tsta End of pathname?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
243 bmi open1 Yes, go on
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
244 leax ,y Point to actual device name
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
245 os9 F$PrsNam Parse it again
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
246 bcc opbpnam Return to caller with bad path name if more
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
247 open1 sty R$X,u Save updated name pointer to caller
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
248 puls y Restore path descriptor pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
249 ldd #256 Get size of input buffer in bytes
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
250 os9 F$SRqMem Allocate it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
251 bcs oerr Can't allocate it return with error
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
252 stu PD.BUF,y Save buffer address to path descriptor
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
253 leax <msg,pc Get ptr to init string
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
254
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
255 IFNE H6309
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
256
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
257 ldw #msgsize get size of default message
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
258 tfm x+,u+ Copy it into buffer (leaves X pointing to 2nd CR)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
259 ldw #blksize Size of rest of buffer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
260 tfm x,u+ Fill rest of buffer with CR's
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
261
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
262 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
263
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
264 CopyMsg lda ,x+
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
265 sta ,u+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
266 decb
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
267 cmpa #C$CR
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
268 bne CopyMsg
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
269 CopyCR sta ,u+
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
270 decb
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
271 bne CopyCR
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
272
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
273 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
274
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
275 ldu PD.DEV,y Get device table entry address
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
276 beq bpnam Doesn't exist, exit with bad pathname error
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
277 ldx V$STAT,u Get devices' static storage address
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
278 lda PD.PAG,y Get devices page length
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
279 sta V.LINE,x Save it to devices static storage
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
280 ldx V$DESC,u Get descriptor address
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
281 ldd PD.D2P,y Get offset to device name (duplicate from dev dsc)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
282 beq L00CF None, skip ahead
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
283
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
284 IFNE H6309
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
285
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
286 addr d,x Point to device name in descriptor
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
287 lda PD.MOD,y Get device mode (Read/Write/Update)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
288 lsrd ??? (swap Read/Write bits around in A?)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
289
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
290 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
291
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
292 leax d,x
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
293 lda PD.MOD,y Get device mode (Read/Write/Update)
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
294 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
295 rorb
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
296
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
297 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
298
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
299 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
300 rolb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
301 rola
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
302 rorb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
303 rola
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
304 IFGT Level-1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
305 pshs y Save path descriptor pointer temporarily
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
306 ldy <D.Proc Get current process pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
307 ldu <D.SysPrc Get system process descriptor pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
308 stu <D.Proc Make system current process
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
309 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
310 os9 I$Attach Attempt to attach to device name in device desc.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
311 IFGT Level-1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
312 sty <D.Proc Restore old current process pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
313 puls y Restore path descriptor pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
314 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
315 bcs OpenErr Couldn't attach to device, detach & exit with error
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
316 stu PD.DV2,y Save new output (echo) device table pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
317 * ldu PD.DEV,y Get device table pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
318 L00CF ldu V$STAT,u Point to it's static storage
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
319
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
320 IFNE H6309
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
321
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
322 clrd
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
323
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
324 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
325
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
326 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
327 clrb
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
328
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
329 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
330
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
331 std PD.PLP,y Clear out path descriptor list pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
332 sta PD.PST,y Clear path status: Carrier not lost
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
333 pshs d Save 0 on stack
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
334 ldx V.PDLHd,u Get path descriptor list header pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
335 * 05/25/93 mod - Boisy Pitre's non-sharable device patches
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
336 * 01/15/10 mod - Boisy Pitre redoes his non-sharable device patch
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
337 beq Yespath No paths open, so we know we can open it
2370
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
338 * IOMan has already vetted the mode byte of the driver and the descriptor
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
339 * and compared it to REGA of I$Open (now in PD.MOD of this current path).
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
340 * here we know there is at least one path open for this device.
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
341 * in order to properly support SHARE. (device exclusivity), we get the
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
342 * mode byte for the path we are opening and see if the SHARE. bit is set.
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
343 * if so, then we return error since we cannot have exclusivity to the device.
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
344 IFNE H6309
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
345 tim #SHARE.,PD.MOD,y
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
346 ELSE
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
347 lda PD.MOD,y
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
348 bita #SHARE.
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
349 ENDC
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
350 bne NoShare
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
351 * we now know that the path's mode doesn't have the SHARE. bit set, so
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
352 * we need to look at the mode of the path in the list header pointer to
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
353 * see if ITS SHARE. bit is set (meaning it wants exclusive access to the
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
354 * port). If so we bail out
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
355 IFNE H6309
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
356 tim #SHARE.,PD.MOD,x
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
357 ELSE
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
358 lda PD.MOD,x
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
359 bita #SHARE.
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
360 ENDC
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
361 beq CkCar Check carrier status
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
362 NoShare leas 2,s Eat extra stack (including good path count)
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
363 comb
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
364 ldb #E$DevBsy Non-sharable device busy error
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
365 bra OpenErr Go detach device & exit with error
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
366
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
367 Yespath sty V.PDLHd,u Save path descriptor ptr
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
368 bra L00F8 Go open the path
2361
4d7f6d8bbe89 Added comments
boisy
parents: 2347
diff changeset
369
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
370 L00E6 tfr d,x Change to PD.PLP path descriptor
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
371 CkCar ldb PD.PST,x Get Carrier status
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
372 bne L00EF Carrier was lost, don't update count
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
373 inc 1,s Carrier not lost, bump up count of good paths
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
374 L00EF ldd PD.PLP,x Get path descriptor list pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
375 bne L00E6 There is one, go make it the current one
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
376 sty PD.PLP,x Save path descriptor ptr as path dsc. list ptr
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
377 L00F8 lda #SS.Open Internal open call
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
378 pshs a Save it on the stack
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
379 inc 2,s Bump counter of good paths up by 1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
380 lbsr L025B Do the SS.Open call to the driver
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
381 lda 2,s Get counter of good paths
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
382 leas 3,s Eat stack
2385
cd29118ee172 Fixed SCF to allow it to return if SS.Open errored out.
boisy
parents: 2370
diff changeset
383 * NEW: return with error if SS.Open return error
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
384 bcs L010F +++BGP+++
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
385 deca Bump down good path count
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
386 bne L0129 If more still open, exit without error
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
387 blo L010F If negative, something went wrong
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
388 lbra L0250 Set parity/baud & return
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
389
2370
403de20e5891 Added SHARE. support (needed for DWNet)
boisy
parents: 2361
diff changeset
390 * we come here if there was an error in Open (after I$Attach and F$SRqMem!)
2394
2244c43efe0e Updated
boisy
parents: 2393
diff changeset
391 L010F bsr RemoveFromPDList Error, go clear stuff out
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
392 OpenErr pshs b,cc Preserve error status
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
393 bsr L0136 Detach device
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
394 puls pc,b,cc Restore error status & return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
395
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
396 * I$Close entry point
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
397 close pshs cc Preserve interrupt status
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
398 orcc #IntMasks Disable interrupts
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
399 ldx PD.DEV,y Get device table pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
400 bsr L0182 Check it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
401 ldx PD.DV2,y Get output device table pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
402 bsr L0182 Check it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
403 puls cc Restore interrupts
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
404 lda PD.CNT,y Any open images?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
405 beq L012B No, go on
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
406 L0129 clra Clear carry
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
407 L012A rts Return
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
408
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
409 * Detach device & return buffer memory
2394
2244c43efe0e Updated
boisy
parents: 2393
diff changeset
410 L012B bsr RemoveFromPDList
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
411 lda #SS.Close Get setstat code for close
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
412 ldx PD.DEV,y get pointer to device table
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
413 ldx V$STAT,x get static mem ptr
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
414 ldb V.TYPE,x Get device type \ WON'T THIS SCREW UP WITH
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
415 bmi L0136 Window, skip ahead / MARK OR SPACE PARITY???
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
416 pshs x,a Save close code & X for SS.Close calling routine
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
417 lbsr L025B Not window, go call driver's SS.Close routine
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
418 leas 3,s Purge stack
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
419 L0136 ldu PD.DV2,y Get output device pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
420 beq L013D Nothing there, go on
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
421 os9 I$Detach Detach it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
422 L013D ldu PD.BUF,y Get buffer pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
423 beq L0147 None defined go on
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
424 ldd #256 Get buffer size
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
425 os9 F$SRtMem Return buffer memory to system
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
426 L0147 clra Clear carry
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
427 rts Return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
428
2394
2244c43efe0e Updated
boisy
parents: 2393
diff changeset
429 * Remove path descriptor from device path descriptor linked list
2244c43efe0e Updated
boisy
parents: 2393
diff changeset
430 * Entry: Y = path descriptor
2244c43efe0e Updated
boisy
parents: 2393
diff changeset
431 RemoveFromPDList
2244c43efe0e Updated
boisy
parents: 2393
diff changeset
432 ldx #1
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
433 pshs cc,d,x,y,u
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
434 ldu PD.DEV,y Get device table pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
435 beq L017B None, skip ahead
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
436 ldu V$STAT,u Get static storage pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
437 beq L017B None, skip ahead
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
438 ldx V.PDLHd,u Get path descriptor list header
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
439 beq L017B None, skip ahead
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
440 ldd PD.PLP,y Get path descriptor list pointer
2394
2244c43efe0e Updated
boisy
parents: 2393
diff changeset
441 cmpy V.PDLHd,u is the passed path descriptor the same?
2244c43efe0e Updated
boisy
parents: 2393
diff changeset
442 bne L0172 branch if not
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
443 std V.PDLHd,u
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
444 bne L017B
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
445 clr 4,s Clear LSB of X on stack
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
446 bra L017B Return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
447
2394
2244c43efe0e Updated
boisy
parents: 2393
diff changeset
448 * D = path descriptor to store
2244c43efe0e Updated
boisy
parents: 2393
diff changeset
449 L016D ldx PD.PLP,x advance to next path descriptor in list
2244c43efe0e Updated
boisy
parents: 2393
diff changeset
450 beq L0180 branch if at end of linked list
2244c43efe0e Updated
boisy
parents: 2393
diff changeset
451 L0172 cmpy PD.PLP,x is the passed path descriptor the same?
2244c43efe0e Updated
boisy
parents: 2393
diff changeset
452 bne L016D branch if not
2244c43efe0e Updated
boisy
parents: 2393
diff changeset
453 std PD.PLP,x store
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
454 IFNE H6309
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
455 L017B clrd
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
456 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
457 L017B clra
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
458 clrb
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
459 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
460 std PD.PLP,y
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
461 L0180 puls cc,d,x,y,u,pc
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
462
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
463
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
464 * Check path number?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
465 * Entry: X=Ptr to device table (just LDX'd)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
466 * Y=Path dsc. ptr
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
467 L0182 beq L012A No device table, return to caller
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
468 ldx V$STAT,x Get static storage pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
469 ldb PD.PD,y Get system path number from path dsc.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
470 lda PD.CPR,y Get ID # of process currently using path
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
471 pshs d,x,y Save everything
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
472 cmpa V.LPRC,x Current process same as last process using path?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
473 bne L01CA No, return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
474 IFGT Level-1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
475 ldx <D.Proc Get current process pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
476 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
477 ldx >D.Proc Get current process pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
478 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
479 leax P$Path,x Point to local path table
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
480 clra Start path # = 0 (Std In)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
481 L0198 cmpb a,x Same path as one is process' local path list?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
482 beq L01CA Yes, return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
483 inca Move to next path
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
484 cmpa #NumPaths Done all paths?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
485 blo L0198 No, keep going
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
486 pshs y Preserve path descriptor pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
487
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
488 IFNE H6309
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
489
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
490 lda #SS.Relea Release signals SetStat
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
491 ldf #D$PSTA Get Setstat offset
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
492
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
493 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
494
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
495 ldd #SS.Relea*256+D$PSTA
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
496
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
497 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
498
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
499 bsr L01FA Execute driver setstat routine
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
500 puls y Restore path pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
501 IFGT Level-1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
502 ldx <D.Proc Get current process pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
503 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
504 ldx >D.Proc Get current process pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
505 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
506 lda P$PID,x Get parent process ID
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
507 sta ,s Save it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
508 IFGT Level-1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
509 os9 F$GProcP Get pointer to parent process descriptor
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
510 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
511 ldx <D.PrcDBT
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
512 os9 F$Find64
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
513 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
514 leax P$Path,y Point to local path table
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
515 ldb 1,s Get path number
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
516 clra Get starting path number
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
517 L01B9 cmpb a,x Same path?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
518 beq L01C4 Yes, go on
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
519 inca Move to next path
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
520 cmpa #NumPaths Done all paths?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
521 blo L01B9 No, keep checking
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
522 clr ,s Clear process ID
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
523 L01C4 lda ,s Get process ID
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
524 ldx 2,s Get static storage pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
525 sta V.LPRC,x Store it as last process
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
526 L01CA puls d,x,y,pc Restore & return
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
527
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
528 * I$GetStt entry point
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
529 getstt lda PD.PST,y Path status ok?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
530 lbne L04C6 No, terminate process
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
531 ldx PD.RGS,y Get register stack pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
532 lda R$B,x Get function code
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
533 bne L01F8 If not SS.Opt, go on
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
534 * SS.Opt Getstat
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
535 pshs a,x,y Preserve registers
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
536 lda #SS.ComSt Get code for Comstat
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
537 sta R$B,x Save it in callers B
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
538 ldu R$Y,x Preserve callers Y
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
539 pshs u
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
540 bsr L01F8 Send it to driver
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
541 puls u Restore callers Y
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
542 puls a,x,y Restore registers
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
543 sta R$B,x Do SS.OPT
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
544 ldd R$Y,x Get com stat
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
545 stu R$Y,x Put original callers Y back
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
546 bcs L01F6 Return if error
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
547 std PD.PAR,y Update path descriptor
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
548 L01F6 clrb Clear carry
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
549 L01F7 rts Return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
550
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
551 * Execute device driver Get/Set Status routine
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
552 * Entry: A=GetStat/SetStat code
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
553
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
554 IFNE H6309
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
555
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
556 L01F8 ldf #D$GSTA Get Getstat driver entry offset
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
557 L01FA ldx PD.DEV,y Get device table pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
558 ldu V$STAT,x Get static storage pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
559 IFGT Level-1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
560 ldx V$DRIVEX,x get execution pointer of driver
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
561 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
562 pshs d
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
563 ldx V$DRIV,x get driver module
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
564 ldd M$EXEC,x
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
565 leax d,x
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
566 puls d
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
567 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
568 pshs y,u Preserve registers
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
569 jsr f,x Execute driver
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
570 puls y,u,pc Restore & return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
571
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
572 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
573
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
574 L01F8 ldb #D$GSTA
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
575 L01FA ldx PD.DEV,y
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
576 ldu V$STAT,x
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
577 IFGT Level-1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
578 ldx V$DRIVEX,x
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
579 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
580 pshs d
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
581 ldx V$DRIV,x get driver module
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
582 ldd M$EXEC,x
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
583 leax d,x
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
584 puls d
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
585 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
586 pshs u,y
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
587 LC486 jsr b,x
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
588 puls y,u,pc
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
589
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
590 ENDC
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
591
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
592
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
593 * I$SetStt entry point
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
594 setstt lbsr L04A2
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
595 L0212 bsr L021B Check codes
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
596 pshs cc,b Preserve registers
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
597 lbsr L0453 Wait for device
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
598 puls cc,b,pc Restore & return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
599
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
600 putkey cmpa #SS.Fill Buffer preload?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
601 bne L01FA No, go execute driver setstat
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
602 IFEQ H6309
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
603 pshs u,y,x
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
604 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
605 IFGT Level-1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
606 ldx <D.Proc Get current process pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
607 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
608 ldx >D.Proc Get current process pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
609 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
610 lda R$Y,u Get flag byte for CR/NO CR
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
611 pshs a Save it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
612 IFGT Level-1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
613 lda P$Task,x Get task number
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
614 ldb <D.SysTsk Get system task
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
615 IFNE H6309
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
616 ldx R$X,u Get pointer to data to move
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
617 ldf R$Y+1,u Get number of bytes (max size of 256 bytes)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
618 ldu PD.BUF,y Get input buffer pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
619 clre High byte of Y
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
620 tfr w,y Move size into proper register for F$Move
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
621 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
622 pshs d
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
623 clra
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
624 ldb R$Y+1,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
625 ldx R$X,u
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
626 ldu PD.BUF,y
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
627 tfr d,y
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
628 puls d
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
629 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
630 * X=Source ptr from caller, Y=# bytes to move, U=Input buffer ptr
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
631 os9 F$Move Move it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
632 bcs putkey1 Exit if error
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
633 tfr y,d Move number of bytes to D
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
634 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
635 loop
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
636 lda ,x+
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
637 sta ,u+
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
638 leay -1,y
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
639 bne loop
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
640 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
641 lda ,s Get CR flag
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
642 bmi putkey1 Don't want CR appended, exit
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
643 lda #C$CR Get code for carriage return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
644 sta b,u Put it in buffer to terminate string
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
645 IFNE H6309
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
646 putkey1 puls a,pc Eat stack & return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
647 L021B ldf #D$PSTA Get driver entry offset for setstat
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
648 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
649 putkey1 puls a,x,y,u,pc Eat stack & return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
650 L021B ldb #D$PSTA Get driver entry offset for setstat
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
651 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
652 lda R$B,u Get function code from caller
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
653 bne putkey Not SS.OPT, go check buffer load
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
654 * SS.OPT SETSTAT
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
655 ldx PD.PAU,y Get current pause & page
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
656 IFGT Level-1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
657 pshs y,x Preserve Path pointer & pause/page
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
658 ldx <D.Proc Get current process pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
659 lda P$Task,x Get task number
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
660 ldb <D.SysTsk Get system task number
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
661 ldx R$X,u Get callers destination pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
662 leau PD.OPT,y Point to path options
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
663 ldy #OPTCNT Get option length
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
664 os9 F$Move Move it to caller
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
665 puls y,x Restore Path pointer & page/pause status
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
666 bcs L01F7 Return if error from move
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
667 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
668 pshs x,y
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
669 ldx R$X,u
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
670 leay PD.OPT,y
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
671 ldb #OPTCNT
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
672 optloop
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
673 lda ,x+
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
674 sta ,y+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
675 decb
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
676 bne optloop
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
677 puls x,y
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
678 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
679 IFEQ H6309
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
680 pshs x
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
681 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
682 ldd PD.PAU,y Get new page/pause status
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
683 IFNE H6309
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
684 cmpr d,x Same as old?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
685 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
686 cmpd ,s++
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
687 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
688 beq L0250 Yes, go on
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
689 ldu PD.DEV,y Get device table pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
690 ldu V$STAT,u Get static storage pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
691 beq L0250 Go on if none
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
692 stb V.LINE,u Update new line count
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
693 L0250 ldx PD.PAR,y Get parity/baud
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
694 lda #SS.ComSt Get code for ComSt
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
695 pshs a,x Preserve them
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
696 bsr L025B Update parity & baud
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
697 puls a,x,pc Restore & return
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
698
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
699 * Update path Parity & baud
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
700 L025B pshs x,y,u Preserve everything
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
701 ldx PD.RGS,y Get callers register pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
702 ldu R$Y,x Get his Y
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
703 lda R$B,x Get his B
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
704 pshs a,x,y,u Preserve it all
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
705 ldd $10,s Get current parity/baud
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
706 std R$Y,x Put it in callers Y
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
707 lda $0F,s Get function code
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
708 sta R$B,x Put it in callers B
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
709 IFEQ H6309
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
710 ldb #$0C
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
711 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
712 lbsr L04A7 Wait for device to be ready
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
713 lbsr L0212 Send it to driver
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
714 puls a,x,y,u Restore callers registers
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
715 stu R$Y,x Put back his Y
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
716 sta R$B,x Put back his B
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
717 bcc L0282 Return if no error
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
718 cmpb #E$UnkSvc Unknown service request?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
719 beq L0282 Yes, return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
720 coma Set carry
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
721 L0282 puls x,y,u,pc Restore & return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
722
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
723 * I$Read entry point
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
724 read lbsr L04A2 Go wait for device to be ready for us
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
725 bcc L028A No error, go on
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
726 L0289 rts Return with error
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
727 L028A inc PD.RAW,y Make sure we do Raw read
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
728 ldx R$Y,u Get number of characters to read
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
729 beq L02DC Return if zero
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
730 pshs x Save character count
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
731 ldx #0
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
732 ldu PD.BUF,y Get buffer address
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
733 bsr L03E2 Read 1 character from device
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
734 bcs L02A4 Return if error
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
735 tsta Character read zero?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
736 beq L02C4 Yes, go try again
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
737 cmpa PD.EOF,y End of file character?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
738 bne L02BC No, keep checking
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
739 L02A2 ldb #E$EOF Get EOF error code
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
740 L02A4 leas 2,s Purge stack
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
741 pshs b Save error code
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
742 bsr L02D5 Return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
743 comb Set carry
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
744 puls b,pc Restore & return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
745
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
746 ******************************
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
747 *
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
748 * SCF file manager entry point
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
749 *
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
750 * Entry: Y = Path descriptor pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
751 * U = Callers register stack pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
752 *
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
753
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
754 SCFEnt lbra open Create path
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
755 lbra open Open path
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
756 lbra bpnam Makdir
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
757 lbra bpnam Chgdir
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
758 lbra L0129 Delete (return no error)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
759 lbra L0129 Seek (return no error)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
760 bra read Read character
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
761 nop
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
762 lbra write Write character
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
763 lbra readln ReadLn
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
764 lbra writln WriteLn
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
765 lbra getstt Get Status
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
766 lbra setstt Set Status
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
767 lbra close Close path
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
768
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
769 * MAIN READ LOOP (no editing)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
770 L02AD tfr x,d move character count to D
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
771 tstb past buffer end?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
772 bne L02B7 no, go get character from device
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
773 * Not often used: only when buffer is full
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
774 bsr L042B move buffer to caller's buffer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
775 ldu PD.BUF,y reset buffer pointer back to start
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
776 * Main char by char read loop
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
777 L02B7 bsr L03E2 get a character from device
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
778 bcs L02A4 exit if error
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
779 L02BC ldb PD.EKO,y echo turned on?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
780 beq L02C4 no, don't write it to device
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
781 lbsr L0565 send it to device write
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
782 L02C4 ldb #1 Bump up char count
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
783 abx
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
784 sta ,u+ save character in local buffer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
785 beq L02CF go try again if it was a null
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
786 cmpa PD.EOR,y end of record charcter?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
787 beq L02D3 yes, return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
788 L02CF cmpx ,s done read?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
789 blo L02AD no, keep going till we are
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
790
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
791 L02D3 leas 2,s purge stack
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
792 L02D5 bsr L042B move local buffer to caller
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
793 ldu PD.RGS,y get register stack pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
794 stx R$Y,u save number of characters read
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
795 L02DC bra L0453 update path descriptor and return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
796
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
797 * Read character from device
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
798 L03E2 pshs u,y,x Preserve regs
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
799 ldx PD.DEV,y Get device table pointer for input
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
800 beq L0401 None, exit
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
801 ldu PD.DV2,y Get device table pointer for echoed output
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
802 beq L03F1 No echoed output device, skip ahead
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
803 L03EA ldu V$STAT,u Get device static storage ptr for echo device
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
804 ldb PD.PAG,y Get lines per page
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
805 stb V.Line,u Store it in device static
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
806 L03F1 tfr u,d Yes, move echo device' static storage to D
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
807 ldu V$STAT,x Get static storage ptr for input
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
808 std V.DEV2,u Save echo device's static storage into input device
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
809 clra
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
810 sta V.WAKE,u Flag input device to be awake
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
811 IFGT Level-1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
812 ldx V$DRIVEX,x Get driver execution pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
813 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
814 pshs d
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
815 ldx V$DRIV,x get driver module
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
816 ldd M$EXEC,x
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
817 leax d,x
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
818 puls d
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
819 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
820 jsr D$READ,x Execute READ routine in driver
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
821 L0401 puls pc,u,y,x Restore regs & return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
822
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
823 * Move buffer to caller
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
824 * Entry: Y=Path dsc. ptr
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
825 * X=# chars to move
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
826 L042B pshs y,x Preserve path dsc. ptr & char. count
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
827 ldd ,s Get # bytes to move
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
828 beq L0451 Exit if none
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
829 tstb Uneven # bytes (not even page of 256)?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
830 bne L0435 Yes, go on
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
831 deca >256, so bump MSB down
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
832 L0435 clrb Force to even page
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
833 ldu PD.RGS,y Get callers register stack pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
834 ldu R$X,u Get ptr to caller's buffer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
835 IFNE H6309
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
836 addr d,u Offset to even page into buffer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
837 clre Clear MSB of count
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
838 ldf 1,s LSB of count on even page?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
839 bne L0442 No, go on
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
840 ince Make it even 256
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
841 L0442
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
842 IFGT Level-1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
843 lda <D.SysTsk Get source task number
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
844 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
845 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
846 leau d,u
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
847 clra
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
848 ldb 1,s
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
849 bne L0442 No, go on
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
850 inca
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
851 L0442 pshs d
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
852 IFGT Level-1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
853 lda <D.SysTsk Get source task number
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
854 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
855 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
856 IFGT Level-1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
857 ldx <D.Proc Get destination task number
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
858 ldb P$Task,x
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
859 ldx PD.BUF,y Get buffer pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
860 IFNE H6309
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
861 tfr w,y Put count into proper register
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
862 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
863 puls y
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
864 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
865 os9 F$Move Move it to caller
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
866 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
867 ldx PD.BUF,y Get buffer pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
868 puls y
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
869 pshs u
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
870 L0443
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
871 lda ,x+
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
872 sta ,u+
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
873 leay -1,y
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
874 bne L0443
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
875 puls u
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
876 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
877 L0451 puls pc,y,x Restore & return
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
878
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
879 * I$ReadLn entry point
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
880 readln bsr L04A2 Go wait for device to be ready for us
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
881 bcc L02E5 No error, continue
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
882 rts Error, exit with it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
883 L02E5 ldd R$Y,u Get character count
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
884 beq L0453 If none, mark device as un-busy
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
885 tsta Past 256 bytes?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
886 beq L02EF No, go on
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
887 ldd #$0100 Get new character count
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
888 L02EF pshs d Save character count
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
889 ldd #$FFFF Get maximum character count
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
890 std PD.MAX,y Store it in path descriptor
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
891 ldx #0 Set character count so far to 0
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
892 ldu PD.BUF,y Get buffer ptr
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
893 lbra L05F8 Go process readln
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
894
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
895 * Wait for device - Clears out V.BUSY if either Default or output devices are
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
896 * no longer busy
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
897 * Modifies X and A
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
898 L0453
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
899 IFGT Level-1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
900 ldx <D.Proc Get current process
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
901 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
902 ldx >D.Proc Get current process
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
903 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
904 lda P$ID,x Get it's process ID
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
905 ldx PD.DEV,y Get device table pointer from our path dsc.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
906 bsr L045D Check if it's busy
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
907 ldx PD.DV2,y Get output device table pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
908 L045D beq L0467 Doesn't exist, exit
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
909 ldx V$STAT,x Get static storage pointer for our device
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
910 cmpa V.BUSY,x Same process as current process?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
911 bne L0467 No, device busy return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
912 clra
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
913 sta V.BUSY,x Yes, mark device as free for use
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
914 L0467 rts Return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
915
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
916 L0468 pshs x,a Preserve device table entry pointer & process ID
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
917 L046A ldx V$STAT,x Get device static storage address
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
918 ldb V.BUSY,x Get active process ID
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
919 beq L048A No active process, device not busy go reserve it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
920 cmpb ,s Is it our own process?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
921 beq L049F Yes, return without error
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
922 bsr L0453 Go wait for device to no longer be busy
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
923 tfr b,a Get process # busy using device
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
924 os9 F$IOQu Put our process into the IO Queue
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
925 inc PD.MIN,y Mark device as not mine
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
926 IFGT Level-1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
927 ldx <D.Proc Get current process
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
928 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
929 ldx >D.Proc Get current process
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
930 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
931 ldb P$Signal,x Get signal code
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
932 lda ,s Get our process id # again for L046A
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
933 beq L046A No signal go try again
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
934 coma Set carry
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
935 puls x,a,pc Restore device table ptr (eat a) & return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
936
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
937 * Mark device as busy;copy pause/interrupt/quit/xon/xoff chars into static mem
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
938 L048A sta V.BUSY,x Make it as process # busy on this device
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
939 sta V.LPRC,x Save it as the last process to use device
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
940 lda PD.PSC,y Get pause character from path dsc.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
941 sta V.PCHR,x Save copy in static storage (faster later)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
942 ldd PD.INT,y Get keyboard interrupt & quit chars
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
943 std V.INTR,x Save copies in static mem
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
944 ldd PD.XON,y Get XON/XOFF chars
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
945 std V.XON,x Save them in static mem too
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
946 L049F clra No error & return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
947 puls pc,x,a Restore A=Process #,X=Dev table entry ptr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
948
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
949 * Wait for device?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
950 L04A2 lda PD.PST,y Get path status (carrier)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
951 bne L04C4 If carrier was lost, hang up process
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
952 L04A7
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
953 IFGT Level-1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
954 ldx <D.Proc Get current process ID
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
955 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
956 ldx >D.Proc Get current process ID
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
957 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
958 clra
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
959 sta PD.MIN,y Flag device is mine
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
960 lda P$ID,x Get process ID #
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
961 ldx PD.DEV,y Get device table pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
962 bsr L0468 Busy?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
963 bcs L04C1 No, return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
964 ldx PD.DV2,y Get output device table pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
965 beq L04BB Go on if it doesn't exist
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
966 bsr L0468 Busy?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
967 bcs L04C1 No, return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
968 L04BB lda PD.MIN,y Device mine?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
969 bne L04A2 No, go wait for it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
970 sta PD.RAW,y Mark device with editing
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
971 L04C1 ldu PD.RGS,y Get register stack pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
972 rts Return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
973
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
974 * Hangup process
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
975 L04C4 leas 2,s Purge return address
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
976 L04C6 ldb #E$HangUp Get hangup error code
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
977 cmpa #S$Abort Termination signal (or carrier lost)?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
978 blo L04D3 Yes, increment status flag & return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
979 lda PD.CPR,y Get current process ID # using path
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
980 ldb #S$Kill Get kill signal
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
981 os9 F$Send Send it to process
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
982 L04D3 inc PD.PST,y Set path status
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
983 orcc #Carry Set carry
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
984 rts Return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
985
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
986 * I$WritLn entry point
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
987 writln bsr L04A2 Go wait for device to be ready for us
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
988 bra L04E1 Go write
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
989
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
990 * I$Write entry point
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
991 write bsr L04A2 Go wait for device to be ready for us
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
992 inc PD.RAW,y Mark device for raw write
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
993 L04E1 ldx R$Y,u Get number of characters to write
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
994 lbeq L055A Zero so return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
995 pshs x Save character count
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
996 ldx #$0000 Get write data offset
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
997 bra L04F1 Go write data
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
998
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
999 L04EC tfr u,d Move current position in PD.BUF to D
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1000 tstb At 256 (end of PD.BUF)?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1001 bne L0523 No, keep writing from current PD.BUF
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1002
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1003 * Get new block of data to write into [PD.BUF]
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1004 * Only allows up to 32 bytes at a time, and puts them in the last 32 bytes of
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1005 * the 256 byte [PD.BUF] buffer. This way, can use TFR U,D/TSTB to see if fin-
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1006 * inshed
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1007 L04F1 pshs y,x Save write offset & path descriptor pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1008 tfr x,d Move data offset to D
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1009 ldu PD.RGS,y Get register stack pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1010 ldx R$X,u Get pointer to users's WRITE string
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1011 IFNE H6309
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1012 addr d,x Point to where we are in it now
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1013 ldw R$Y,u Get # chars of original write
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1014 subr d,w Calculate # chars we have left to write
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1015 cmpw #64 More than 64?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1016 bls L0508 No, go on
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1017 ldw #64 Max size per chunk=64
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1018 L0508 ldd PD.BUF,y Get buffer ptr
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1019 inca Point to PD.BUF+256 (1 byte past end
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1020 subr w,d Subtract data size
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1021 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1022 leax d,x
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1023 ldd R$Y,u
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1024 subd ,s
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1025 cmpd #$0020
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1026 bls L0508
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1027 ldd #$0020
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1028 L0508 pshs d
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1029 ldd PD.BUF,y
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1030 inca
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1031 subd ,s
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1032 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1033 tfr d,u Move it to U
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1034 lda #C$CR Put a carriage return 1 byte before start
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1035 sta -1,u of write portion of buffer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1036 IFGT Level-1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1037 ldy <D.Proc Get current process pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1038 lda P$Task,y Get the task number
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1039 ldb <D.SysTsk Get system task number
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1040 IFNE H6309
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1041 tfr w,y Get number of bytes to move
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1042 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1043 puls y
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1044 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1045 os9 F$Move Move data to buffer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1046 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1047 puls y
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1048 pshs u
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1049 L0509 lda ,x+
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1050 sta ,u+
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1051 leay -1,y
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1052 bne L0509
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1053 puls u
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1054 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1055 puls y,x Restore path descriptor pointer and data offset
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1056
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1057 * at this point, we have
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1058 * 0,s = end address of characters to write
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1059 * X = number of characters written
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1060 * Y = PD pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1061 * U = pointer to data buffer to write
2393
08b60a5995d0 More optimizations for Level 1
boisy
parents: 2392
diff changeset
1062 * Level 2: Use callcode $06 to call grfdrv (old DWProtSW from previous versions,
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1063 * now unused by GrfDrv
2393
08b60a5995d0 More optimizations for Level 1
boisy
parents: 2392
diff changeset
1064 L0523
08b60a5995d0 More optimizations for Level 1
boisy
parents: 2392
diff changeset
1065 IFGT Level-1
08b60a5995d0 More optimizations for Level 1
boisy
parents: 2392
diff changeset
1066 ldb PD.PAR,y get device parity: bit 7 set = window
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1067 cmpb #$80 is it even potentially a CoWin window?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1068 bne L0524 no, skip the rest of the crap
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1069
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1070 clrb set to no uppercase conversion
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1071 lda PD.RAW,y get raw output flag
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1072 bne g.raw if non-zero, we do raw writes: no conversion
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1073 ldb PD.UPC,y get uppercase conversion flag: 1 = do uppercase
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1074
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1075 g.raw pshs b,x,y,u save length, PD, data buffer pointers
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1076
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1077 lbsr get.wptr get window table ptr into Y
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1078 bcs no.wptr do old method on error
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1079
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1080 * now we find out the number of non-control characters to write...
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1081 g.fast lda 5,s grab page number
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1082 inca go to the next page
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1083 clrb at the top of it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1084 subd 5,s take out number of bytes left to write
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1085 pshs b max. number of characters
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1086
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1087 clrb always <256 characters to write
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1088 g.loop lda ,u+ get a character
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1089 cmpa #$20 is it a control character?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1090 blo g.done yes, we're done this stint
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1091 tst 1,s get uppercase conversion flag
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1092 beq g.loop1 don't convert
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1093 lbsr L0403 do a lower-uppercase conversion, if necessary
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1094 sta -1,u save again
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1095
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1096 g.loop1 incb done one more character
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1097 cmpb ,s done as many as we can?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1098 bne g.loop
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1099
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1100 g.done leas 1,s kill max. count of characters to use
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1101 cmpb #1 one or fewer characters?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1102 bls no.wptr yes, go use old method
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1103
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1104 * IFEQ H6309
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1105 * Note: this was present in the TuneUp version of SCF, and seems to
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1106 * never allow grfdrv to be called directly, so did fast text screens
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1107 * ever work in TuneUp??? - BGP
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1108 * bra no.wptr
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1109 * ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1110
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1111 * now we call grfdrv...
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1112 ldu 5,s get start pointer again
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1113 abx done B more characters...
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1114 stx 1,s save on-stack
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1115 lbsr call.grf go call grfdrv: no error possible on return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1116 leau b,u go up B characters in U, too
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1117 stu 5,s save old U, too
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1118 puls b,x,y,u restore registers
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1119 bra L0544 do end-buffer checks and continue
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1120
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1121 no.wptr puls b,x,y,u restore all registers
2393
08b60a5995d0 More optimizations for Level 1
boisy
parents: 2392
diff changeset
1122 ENDC
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1123
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1124 L0524 lda ,u+ Get character to write
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1125 ldb PD.RAW,y Raw mode?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1126 bne L053D Yes, go write it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1127 ldb PD.UPC,y Force uppercase?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1128 beq L052A No, continue
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1129 bsr L0403 Make it uppercase
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1130 L052A cmpa #C$LF Is it a Line feed?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1131 bne L053D No, go print it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1132 lda #C$CR Get code for carriage return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1133 ldb PD.ALF,y Auto Line feed?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1134 bne L053D Yes, go print carriage return first
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1135 bsr L0573 Print carriage return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1136 bcs L055D If error, go wait for device
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1137 lda #C$LF Now, print the line feed
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1138
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1139 * Write character to device (call driver)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1140 L053D bsr L0573 Go write it to device
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1141 bcs L055D If error, go wait for device
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1142 ldb #1 Bump up # chars we have written
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1143 abx
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1144 L0544 cmpx ,s Done whole WRITE call?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1145 bhs L0554 Yes, go save # chars written & exit
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1146 ldb PD.RAW,y Raw mode?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1147 lbne L04EC Yes, keep writing
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1148 lda -1,u Get the char we wrote
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1149 lbeq L04EC NUL, keep writing
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1150 cmpa PD.EOR,y End of record?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1151 lbne L04EC No, keep writing
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1152 L0554 leas 2,s Eof record, stop & Eat end of buffer ptr???
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1153 L0556 ldu PD.RGS,y Get callers register pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1154 stx R$Y,u Save character count to callers Y
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1155 L055A lbra L0453 Mark device write clear and return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1156
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1157 * Check for forced uppercase
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1158 L0403 cmpa #'a Less then 'a'?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1159 blo L0412 Yes, leave it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1160 cmpa #'z Higher than 'z'?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1161 bhi L0412 Yes, leave it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1162 suba #$20 Make it uppercase
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1163 L0412 rts Return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1164
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1165 L055D leas 2,s Purge stack
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1166 pshs b,cc Preserve registers
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1167 bsr L0556 Wait for device
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1168 puls pc,b,cc Restore & return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1169
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1170 * Check for end of page (part of send char to driver)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1171 L0573 pshs u,y,x,a Preserve registers
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1172 ldx PD.DEV,y Get device table pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1173 cmpa #C$CR Carriage return?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1174 bne L056F No, go print it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1175 ldu V$STAT,x Get pointer to device stactic storage
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1176 ldb V.PAUS,u Pause request?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1177 bne L0590 Yes, go pause device
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1178 ldb PD.RAW,y Raw output mode?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1179 bne L05A2 Yes, go on
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1180 ldb PD.PAU,y End of page pause enabled?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1181 beq L05A2 No, go on
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1182 dec V.LINE,u Subtract a line
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1183 bne L05A2 Not done, go on
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1184 ldb #$ff do a immediate pause request
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1185 stb V.PAUS,u
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1186 bra L059A Go read next character
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1187
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1188 L03DA pshs u,y,x Preserve registers
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1189 ldx PD.DV2,y Get output device table pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1190 beq NoOut None, exit
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1191 ldu PD.DEV,y Get device table pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1192 lbra L03EA Process & return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1193
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1194 NoOut puls pc,u,y,x No output device so exit
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1195
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1196 * Wait for pause release
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1197 L0590 bsr L03DA Read next character
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1198 bcs L059A Error, try again
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1199 cmpa PD.PSC,y Pause char?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1200 bne L0590 No, try again
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1201
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1202 L059A bsr L03DA Reset line count and read a character
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1203 cmpa PD.PSC,y Pause character?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1204 beq L059A Yes, go read again
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1205
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1206 * Process Carriage return - do auto linefeed & Null's if necessary
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1207 * Entry: A=CHR$($0D)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1208 L05A2 ldu V$STAT,x Get static storage pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1209 clra
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1210 sta V.PAUS,u Clear pause request
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1211 lda #C$CR Carriage return (in cases from pause)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1212 bsr L05C9 Send it to driver
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1213 lda PD.RAW,y Raw mode?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1214 bne L05C7 Yes, return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1215 ldb PD.NUL,y Get end of line null count
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1216 pshs b Save it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1217 lda PD.ALF,y Auto line feed enabled?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1218 beq L05BE No, go on
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1219 lda #C$LF Get line feed code
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1220 L05BA bsr L05C9 Execute driver write routine
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1221 bcs L05C5 Error, purge stack and return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1222 L05BE clra Get null character
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1223 dec ,s Done null count?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1224 bpl L05BA No, go send it to driver
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1225 clra Clear carry
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1226 L05C5 leas 1,s Purge stack
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1227 L05C7 puls pc,u,y,x,a Restore & return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1228
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1229 * Execute device driver write routine
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1230 * Entry: A=Character to write
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1231 * Execute device driver
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1232 * Entry: W=Entry offset (for type of function, ex. Write, Read)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1233 * A=Code to send to driver
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1234 L05C9 ldu V$STAT,x Get device static storage pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1235 pshs y,x Preserve registers
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1236 clrb
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1237 stb V.WAKE,u Wake it up
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1238 IFGT Level-1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1239 ldx V$DRIVEX,x Get driver execution pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1240 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1241 pshs d
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1242 ldx V$DRIV,x get driver module
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1243 ldd M$EXEC,x
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1244 leax d,x
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1245 puls d
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1246 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1247 jsr D$WRIT,x Execute driver
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1248 puls pc,y,x Restore & return
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1249
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1250 * Send character to driver
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1251 L0565 pshs u,y,x,a Preserve registers
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1252 ldx PD.DV2,y Get output device table pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1253 beq L0571 Return if none
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1254 cmpa #C$CR Carriage return?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1255 beq L05A2 Yes, go process it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1256 L056F ldu V$STAT,x Get device static storage pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1257 clrb
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1258 stb V.WAKE,u Wake it up
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1259 IFGT Level-1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1260 ldx V$DRIVEX,x Get driver execution pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1261 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1262 pshs d
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1263 ldx V$DRIV,x get driver module
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1264 ldd M$EXEC,x
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1265 leax d,x
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1266 puls d
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1267 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1268 jsr D$WRIT,x Execute driver
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1269 L0571 puls pc,u,y,x,a Restore & return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1270
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1271 * Check for printable character
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1272 L0413 ldb PD.EKO,y Echo turned on?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1273 beq NoEcho No, return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1274 L0418 cmpa #C$SPAC CHR$(32) or higher?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1275 bhs L0565 Yes, go send to driver
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1276 cmpa #C$CR Carriage return?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1277 bne L0423 No, change it to a period
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1278 bra L0565 Anything else output to driver
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1279
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1280 NoEcho rts
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1281
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1282 L0423 pshs a Save code
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1283 lda #'. Get code for period
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1284 bsr L0565 Output it to device
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1285 puls pc,a Restore & return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1286
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1287 L0624 bsr L0418 check if it's printable and send it to driver
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1288 * Process ReadLn
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1289 L05F8 lbsr L03E2 get a character from device
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1290 lbcs L0370 return if error
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1291 tsta usable character?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1292 lbeq L02FE no, check path descriptor special characters
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1293 ldb PD.RPR,y get reprint line code
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1294 cmpb #C$RPRT cntrl D?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1295 lbeq L02FE yes, check path descriptor special characters
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1296 cmpa PD.RPR,y reprint line?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1297 bne L0629 no, Check line editor keys
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1298 cmpx PD.MAX,y character count at maximum?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1299 beq L05F8 yes, go read next character
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1300 ldb #1 Bump char count up by 1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1301 abx
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1302 cmpx ,s done?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1303 bhs L0620 yes, exit
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1304 lda ,u+ get character read
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1305 beq L0624 null, go send it to driver
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1306 cmpa PD.EOR,y end of record character?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1307 bne L0624 no, go send it to driver
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1308 leau -1,u bump buffer pointer back 1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1309 L0620 leax -1,x bump character count back 1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1310 bra L05F8 go read next character
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1311
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1312 * Process print rest of line
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1313 L0629 cmpa #C$PLINE Print rest of line code?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1314 bne L0647 No, check insert
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1315 L062D pshs u Save buffer pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1316 lbsr L038B Go print rest of line
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1317 lda PD.BSE,y Get backspace echo character
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1318 L0634 cmpu ,s Beginning of buffer?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1319 beq L0642 Yes, exit
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1320 leau -1,u Bump buffer pointer back 1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1321 leax -1,x Bump character count back 1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1322 IFNE H6309
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1323 bsr L0565 Print it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1324 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1325 lbsr L0565 Print it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1326 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1327 bra L0634 Keep going
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1328 L0642 leas 2,s Purge buffer pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1329 bra L05F8 Return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1330
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1331 * Process Insert character (NOTE:Currently destroys W)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1332 L0647 cmpa #C$INSERT Insert character code?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1333 bne L0664 No, check delete
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1334 IFNE H6309
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1335 pshs x,y Preserve x&y a moment
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1336 tfr u,w Dupe buffer pointer into w
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1337 ldf #$fe End of buffer -1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1338 tfr w,x Source copy address
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1339 incw Include char we are on & dest address is+1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1340 tfr w,y Destination copy address
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1341 subr u,w w=w-u (Size of copy)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1342 tfm x-,y- Move buffer up one
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1343 puls y,x Get back original y & x
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1344 lda #C$SPAC Get code for space
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1345 sta ,u Save it there
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1346 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1347 pshs u
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1348 tfr u,d
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1349 ldb #$FF
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1350 tfr d,u
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1351 L06DE lda ,-u
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1352 sta 1,u
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1353 cmpu ,s
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1354 bne L06DE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1355 lda #C$SPAC
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1356 sta ,u
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
1357 leas 2,s
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1358 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1359 bra L062D Go print rest of line
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1360
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1361 * Process delete line
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1362 L0664 cmpa #C$DELETE Delete character code?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1363 bne L068B No, check end of line
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1364 pshs u Save buffer pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1365 lda ,u Get character there
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1366 cmpa PD.EOR,y End of record?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1367 beq L0687 Yes, don't bother to delete it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1368 L0671 lda 1,u Get character beside it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1369 cmpa PD.EOR,y This an end of record?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1370 beq L067C Yes, delete it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1371 sta ,u+ Bump character back
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1372 bra L0671 Go do next character
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1373 L067C lda #C$SPAC Get code for space
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1374 cmpa ,u Already there?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1375 bne L0685 No, put it in
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1376 lda PD.EOR,y Get end of record code
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1377 L0685 sta ,u Put it there
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1378 L0687 puls u Restore buffer pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1379 bra L062D Go print rest of line
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1380
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1381 * Delete rest of buffer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1382 L068B cmpa PD.EOR,y End of record code?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1383 bne L02FE No, check for special path dsc. chars
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1384 pshs u Save buffer pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1385 bra L069F Go erase rest of buffer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1386
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1387 L0696 pshs a Save code
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1388 lda #C$SPAC Get code for space
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1389 lbsr L0565 Print it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1390 puls a Restore code
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1391 L069F cmpa ,u+ End of record?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1392 bne L0696 No, go print a space
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1393 puls u Restore buffer pointer
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
1394
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1395 * Check character read against path descriptor
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1396 L02FE tsta Usable character?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1397 beq L030C No, go on
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1398 ldb #PD.BSP Get start point in path descriptor
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1399 L0303 cmpa b,y Match code in descriptor?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1400 beq L032C Yes, go process it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1401 incb Move to next one
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1402 cmpb #PD.QUT Done check?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1403 bls L0303 No, keep going
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1404 L030C cmpx PD.MAX,y Past maximum character count?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1405 bls L0312 No, go on
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1406 stx PD.MAX,y Update maximum character count
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1407 L0312 ldb #1 Add 1 char
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1408 abx
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1409 cmpx ,s Past requested amount?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1410 blo L0322 No, go on
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1411 lda PD.OVF,y Get overflow character
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1412 lbsr L0565 Send it to driver
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1413 leax -1,x Subtract a character
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1414 lbra L05F8 Go try again
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1415
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1416 L0322 ldb PD.UPC,y Force uppercase?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1417 beq L0328 No, put char in buffer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1418 lbsr L0403 Make character uppercase
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1419 L0328 sta ,u+ Put character in buffer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1420 lbsr L0413 Check for printable
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1421 lbra L05F8 Go try again
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1422
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1423 * Process path option characters
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1424 L032C pshs x,pc Preserve character count & PC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1425 leax <L033F,pc Point to branch table
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1426 subb #PD.BSP Subtract off first code
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1427 lslb Account for 2 bytes a entry
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1428 abx Point to entry point
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1429 stx 2,s Save it in PC on stack
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1430 puls x Restore X
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1431 C8E3 jsr [,s++] Execute routine
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1432 lbra L05F8 Continue on
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1433
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1434 * Vector points for PD.BSP-PD.QUT
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1435 L033F bra L03BB Process PD.BSP
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1436 bra L03A5 Process PD.DEL
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1437 bra L0351 Process PD.EOR
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1438 bra L0366 Process PD.EOF
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1439 bra L0381 Process PD.RPR
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1440 bra L038B Process PD.DUP
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1441 rts PD.PSC we don't worry about
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1442 nop
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1443 bra L03A5 Process PD.INT
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1444 bra L03A5 Process PD.QUT
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1445
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1446 * Process PD.EOR character
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1447 L0351 leas 2,s Purge return address
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1448
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1449 sta ,u Save character in buffer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1450 lbsr L0413
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1451 ldu PD.RGS,y Get callers register stack pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1452 ldb #1 Bump up char count by 1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1453 abx
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1454 stx R$Y,u Store it in callers Y
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1455 lbsr L042B
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1456 leas 2,s
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1457 lbra L0453
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1458
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1459 * Process PD.EOF
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1460 L0366 leas 2,s Purge return address
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1461 leax ,x read anything?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1462 lbeq L02A2
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1463 bra L030C
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1464
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1465 L0370 pshs b
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
1466 lda #C$CR
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1467 sta ,u
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1468 lbsr L0565 Send it to the driver
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1469 puls b
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1470 lbra L02A4
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1471
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1472 * Process PD.RPR
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1473 L0381 lda PD.EOR,y Get end of record character
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1474 sta ,u Put it in buffer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1475 ldx #0
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1476 ldu PD.BUF,y Get buffer ptr
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1477 L0388 lbsr L0418 Send it to driver
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1478 L038B cmpx PD.MAX,y Character maximum?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1479 beq L03A2 Yes, return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1480 ldb #1 Bump char count up by 1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1481 abx
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1482 cmpx 2,s Done count?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1483 bhs L03A0 Yes, exit
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1484 lda ,u+ Get character from buffer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1485 beq L0388 Null, go send it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1486 cmpa PD.EOR,y Done line?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1487 bne L0388 No go send it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1488 leau -1,u Move back a character
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1489 L03A0 leax -1,x Move character count back
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1490 L03A2 rts Return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1491
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1492 L03A3 bsr L03BF
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1493 * PD.DEL/PD.QUT/PD.INT processing
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1494 L03A5 leax ,x Any characters?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1495 beq L03B8 No, reset buffer ptr
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1496 ldb PD.DLO,y Backspace over line?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1497 beq L03A3 Yes, go do it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1498 ldb PD.EKO,y Echo character?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1499 beq L03B5 No, zero out buffer pointers & return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1500 lda #C$CR Send CR to the driver
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1501 lbsr L0565 send it to driver
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1502 L03B5 ldx #0 zero out count
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1503 L03B8 ldu PD.BUF,y reset buffer pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1504 L03BA rts return
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
1505
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1506 * Process PD.BSP
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1507 L03BB leax ,x Any characters?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1508 beq L03A2 No, return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1509 L03BF leau -1,u Mover buffer pointer back 1 character
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1510 leax -1,x Move character count back 1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1511 ldb PD.EKO,y Echoing characters?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1512 beq L03BA No, return
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1513 ldb PD.BSO,y Which backspace method?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1514 beq L03D4 Use BSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1515 bsr L03D4 Do a BSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1516 lda #C$SPAC Get code for space
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1517 lbsr L0565 Send it to driver
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1518 L03D4 lda PD.BSE,y Get BSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1519 lbra L0565 Send it to driver
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
1520
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1521 IFGT Level-1
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1522 * check PD.DTP,y and update PD.WPTR,y if it's device type $10 (grfdrv)
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1523 get.wptr pshs x,u
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1524 ldu PD.DEV,y get device table entry
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1525 ldx V$DRIV,u get device driver module
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1526 ldd M$Name,x offset to name
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1527 ldd d,x
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1528 cmpd #"VT is it VTIO?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1529 bne no.fast no, don't do the fast stuff
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1530 ldd >WGlobal+G.GrfEnt does GrfDrv have an entry address?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1531 beq no.fast nope, don't bother calling it.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1532
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1533 ldu V$STAT,u and device static storage
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1534 tst V.ParmCnt,u are we busy getting more parameters?
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1535 bne no.fast yes, don't do buffered writes
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1536
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1537 * Get window table pointer & verify it: copied from CoWin and modified
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1538 ldb V.WinNum,u Get window # from device mem
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1539 lda #Wt.Siz Size of each entry
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1540 mul Calculate window table offset
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1541 addd #WinBase Point to specific window table entry
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1542 tfr d,y Move to y, the register we want
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1543 lda Wt.STbl,y Get MSB of scrn tbl ptr
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1544 bgt VerExit If $01-$7f, should be ok
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1545
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1546 * Return illegal window definition error
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1547 no.fast comb set carry: no error code, it's an internal routine
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1548 puls x,u,pc
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1549
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1550 VerExit clra No error
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1551 puls x,u,pc
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1552
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1553 call.grf pshs d,x,y,u save registers
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1554 ldx #$0180 where to put the text
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1555 IFNE H6309
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1556 pshs cc save old CC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1557 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1558 tfr cc,a
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1559 sta -2,x
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1560 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1561 orcc #IntMasks+Entire shut everything else off
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1562
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1563 IFNE H6309
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1564 clra make sure high byte=0
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1565 tfr d,w
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1566 tfm u+,x+ move the data into low memory
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1567 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1568 l@ lda ,u+
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1569 sta ,x+
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1570 decb
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1571 bne l@
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1572 ENDC
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1573
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1574 ldb #6 alpha put
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1575 stb >WGlobal+G.GfBusy flag grfdrv busy
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1576 IFNE H6309
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1577 lde ,s+ grab old CC off of the stack
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1578 lda 1,s get the number of characters to write
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1579 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1580 * ldb ,s+ grab old CC off of the stack
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1581 lda 1,s get the number of characters to write
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1582 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1583 * A = number of bytes at $0180 to write out...
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1584 bsr do.grf do the call
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1585 * ignore errors : none possible from this particular call
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1586 call.out puls d,x,y,u,pc and return
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1587
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1588 * this routine should always be called by a BSR, and grfdrv will use the
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1589 * PC saved on-stack to return to the calling routine.
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1590 * ALL REGISTERS WILL BE TRASHED
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1591 do.grf sts >WGlobal+G.GrfStk stack pointer for GrfDrv
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1592 lds <D.CCStk get new stack pointer
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1593 IFNE H6309
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1594 pshs dp,x,y,u,pc
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1595 pshsw
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1596 pshs cc,d save all registers
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1597 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1598 pshs dp,cc,d,x,y,u,pc
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1599 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1600
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1601 ldx >WGlobal+G.GrfEnt get GrfDrv entry address
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1602
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1603 stx R$PC,s save grfdrv entry address as PC on the stack
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1604 IFNE H6309
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1605 ste R$CC,s save CC onto CC on the stack
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1606 ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1607 stb R$B,s
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1608 ldb $017E
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1609 stb R$CC,s
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1610 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1611 jmp [>D.Flip1] flip to grfdrv and execute it
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1612 ENDC
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1613
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1614 * GrfDrv will execute function, and then call [D.Flip0] to return here. It
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1615 * will use an RTS to return to the code that called here in the first place
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1616 * Only SP, PC & CC are set up - ALL OTHER REGISTERS MAY BE MODIFIED
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1617
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1618 * ELSE
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1619 *
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1620 *call.grf pshs u,y,x,d
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1621 * tfr cc,a
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1622 * orcc #IntMasks+Entire
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1623 * ldx #$0180
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1624 * sta -2,x
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1625 *call.lp lda ,u+
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1626 * sta ,x+
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1627 * decb
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1628 * bne call.lp
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1629 * stb ,x
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1630 * lda 1,s
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1631 * bsr do.grf
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1632 * puls u,y,x,d,pc
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1633 *
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1634 *do.grf sts >$1007
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1635 * lds <D.CCStk
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1636 * ldu #$1100
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1637 * ldb #$3A
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1638 * stb >$1002
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1639 * stb >$017F
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1640 * pshs pc,u,y,x,dp,b,a,cc
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1641 * ldx >$106E
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1642 * stx R$PC,s
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1643 * ldb >$107E
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1644 * stb ,s
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1645 * jmp [>D.Flip1]
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1646 * ENDC
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1647
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1648 emod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1649 eom equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1650 end
2390
1ac410eb636e Level 2 SCF has been backported to Level 1 -- still needs testing but
boisy
parents: 2386
diff changeset
1651