comparison os9/level1/pdisk.asm @ 31:bd2b07db8917 cocoos9lv2v3

CoCoOS9 version
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 14 Jul 2018 15:16:13 +0900
parents
children 7c5379eb406e
comparison
equal deleted inserted replaced
30:7b1b25ff010a 31:bd2b07db8917
1 *********************************************
2 * Rdisk
3 * A driver for a Ram disk!
4 * Modified for os9l1 emulator by Soren Roug 2001
5 *
6
7 nam Pdisk
8 ttl A Device Driver for a RAM Disk
9
10 ifp1
11 use os9defs
12 use rbfdefs
13 endc
14
15 ***********************
16 * Edition History
17
18 * # date Comments
19 * -- -------- ----------------------------------------------
20
21 Revision equ 1
22 NumDrvs set 2 Number of drives
23
24 org Drvbeg
25 rmb NumDrvs*DrvMem
26 RAMSTA equ .
27
28 mod RAMEND,RAMNAM,Drivr+Objct,Reent+Revision,RAMENT,RAMSTA
29 fcb $FF mode byte
30
31 RAMNAM fcs /Pdisk/
32
33 RAMENT lbra INIT
34 lbra READ
35 lbra WRITE
36 lbra GETSTA
37 lbra PUTSTA
38 lbra TERM
39
40 *****************************
41 * INIT
42 * Set up the v09 disk
43
44 INIT ldb #NumDrvs Set no drives to 2
45 * Setup drive tables
46 stb V.NDRV,u save it
47 lda #$FF
48 leax DRVBEG,u point to drive table start
49 L0111 sta DD.TOT+1,x
50 sta <V.TRAK,x
51 leax <DRVMEM,x
52 decb
53 bne L0111
54 clrb
55 INITXIT rts
56
57 SETUPDT lda <PD.DRV,y Get the drive number
58 ldu V.PORT,u
59 sta 1,u drive number
60 stb 2,u msb of lsn
61 tfr x,d
62 sta 3,u
63 stb 4,u
64 ldd PD.BUF,y
65 sta 5,u buffer address
66 stb 6,u
67 rts
68
69 *****************************
70 * READ
71 * read a sector from disk
72 * Entry: U = Static Storage
73 * Y = Path Descriptor
74 * B = MSB of LSN
75 * X = LSB's of LSN
76 * Exit: 256 byte sector in PD.BUF buffer
77 *
78 READ bsr SETUPDT
79 lda #$81
80 sta ,u // perform io
81 ldb ,u // return status
82 rts
83
84 *****************************
85 * WRITE
86 * Write a sector to disk
87 * Entry: U = Static Storage
88 * Y = Path Descriptor
89 * B = MSB of LSN
90 * X = LSB's of LSN
91 * PD.Buf = Sector to write
92 *
93 WRITE bsr SETUPDT
94 lda #$55
95 sta ,u // perform io
96 ldb ,u // return status
97 WRIT99 rts
98
99 **************************
100 * GETSTA
101 * get device status
102 *
103 GETSTA
104 Unknown comb
105 clrb
106 rts
107
108 **************************
109 * PUTSTA
110 * Set device Status
111 *
112 PUTSTA
113 PUTSTA90 clrb
114 rts
115
116 *****************************
117 * TERM
118 * terminate Driver
119 *
120 TERM clrb
121 rts
122
123 emod
124 RAMEND equ *
125