comparison os9/mc09/mclibos9.c @ 103:844305752064

no compile errors on mc09
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 27 Dec 2018 20:16:34 +0900
parents 09148bb27659
children 096b3fc7aa66
comparison
equal deleted inserted replaced
102:09148bb27659 103:844305752064
1 /* 1 /*
2 * os9 driver 2 * os9 driver
3 */ 3 */
4 4
5 #asm
6 ifp1
7 use defsfile
8 endc
9 #endasm
10 5
11 typedef struct { 6 typedef struct {
12 int fd; /* 0 */ 7 int fd; /* 0 */
13 int mode; /* 2 */ 8 int fmode; /* 2 */
14 int len; /* 4 */ 9 int len; /* 4 */
15 char *name; /* 6 */ 10 char *fname; /* 6 */
16 char *ptr; /* 8 */ 11 char *ptr; /* 8 */
17 char buff[256]; /* 10 */ 12 char buff[256]; /* 10 */
18 } FILE ; 13 } FILE ;
19 14
20 #define FCBSIZE (sizeof(FILE)) 15 #define FCBSIZE (sizeof(FILE))
154 pshs x,y,u 149 pshs x,y,u
155 ldx -4,u 150 ldx -4,u
156 lda 2,x mode 151 lda 2,x mode
157 ldb 3,x src attribute 152 ldb 3,x src attribute
158 leax 6,x name 153 leax 6,x name
159 os9 F$Create 154 os9 I$Create
160 bcc _LC0001 155 bcc _LC0003
161 ldx -4,u 156 ldx -4,u
162 clrb 157 clrb
163 std ,x 158 std ,x
164 bra _LC0002 159 bra _LC0004
165 _LC0001 160 _LC0003
166 ldx -4,u 161 ldx -4,u
167 clra 162 clra
168 stD 2,x err code 163 stD 2,x err code
169 ldd #-1 164 ldd #-1
170 std ,x 165 std ,x
171 _LC0002 166 _LC0004
172 puls x,y,u 167 puls x,y,u
173 #endasm 168 #endasm
174 if (fcbp->fd < 0 ) return NULL; 169 if (fcbp->fd < 0 ) return NULL;
175 fcbp->ptr = fcbp->buff; 170 fcbp->ptr = fcbp->buff;
176 fcbp->len = 0; 171 fcbp->len = 0;
235 lda 1,x file descriptor 230 lda 1,x file descriptor
236 leax 1,S 231 leax 1,S
237 clr ,s 232 clr ,s
238 ldy #1 233 ldy #1
239 os9 I$Read 234 os9 I$Read
240 bcc _LC0003 235 bcc _LC0005
241 ldd #-1 236 ldd #-1
242 std ,s 237 std ,s
243 _LC0003 238 _LC0005
244 puls d,x,y,u 239 puls d,x,y,u
245 #endasm 240 #endasm
246 } 241 }
247 242
248 putc(c,fcbp) 243 putc(c,fcbp)