mirror of
https://github.com/ksherlock/wdc-utils.git
synced 2024-06-08 14:29:27 +00:00
fix stdio test some more.
This commit is contained in:
parent
47130d0e67
commit
91d7f60bff
|
@ -5,6 +5,11 @@
|
||||||
void main(void) {
|
void main(void) {
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
|
#asm
|
||||||
|
phk
|
||||||
|
plb
|
||||||
|
#endasm
|
||||||
|
|
||||||
fputs("hello, world\n", stdout);
|
fputs("hello, world\n", stdout);
|
||||||
|
|
||||||
fp = fopen("file.txt", "wb");
|
fp = fopen("file.txt", "wb");
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
Tue Jan 17 2017 23:13 Page 1
|
Tue Jan 17 2017 23:24 Page 1
|
||||||
|
|
||||||
|
|
||||||
***************************************
|
***************************************
|
||||||
|
@ -31,456 +31,468 @@
|
||||||
22 00:0007: 5B tcd
|
22 00:0007: 5B tcd
|
||||||
23 ; FILE *fp;
|
23 ; FILE *fp;
|
||||||
24 ;
|
24 ;
|
||||||
25 ; fputs("hello, world\n", stdout);
|
25 ; #asm
|
||||||
26 00000000 fp_1 set 0
|
26 00000000 fp_1 set 0
|
||||||
27 00:0008: A9 xx xx lda #<~~_iob+20
|
27 ; phk
|
||||||
28 00:000B: 85 01 sta <R0
|
28 ; plb
|
||||||
29 xref _BEG_DATA
|
29 ; #endasm
|
||||||
30 00:000D: A9 xx xx lda #_BEG_DATA>>16
|
30 asmstart
|
||||||
31 00:0010: 85 03 sta <R0+2
|
31 00:0008: 4B phk
|
||||||
32 00:0012: D4 03 pei <R0+2
|
32 00:0009: AB plb
|
||||||
33 00:0014: D4 01 pei <R0
|
33 asmend
|
||||||
34 00:0016: F4 xx xx pea #^L1
|
34 ;
|
||||||
35 00:0019: F4 xx xx pea #<L1
|
35 ; fputs("hello, world\n", stdout);
|
||||||
36 00:001C: 22 xx xx xx jsl ~~fputs
|
36 00:000A: A9 xx xx lda #<~~_iob+20
|
||||||
37 ;
|
37 00:000D: 85 01 sta <R0
|
||||||
38 ; fp = fopen("file.txt", "wb");
|
38 xref _BEG_DATA
|
||||||
39 00:0020: F4 xx xx pea #^L1+23
|
39 00:000F: A9 xx xx lda #_BEG_DATA>>16
|
||||||
40 00:0023: F4 xx xx pea #<L1+23
|
40 00:0012: 85 03 sta <R0+2
|
||||||
41 00:0026: F4 xx xx pea #^L1+14
|
41 00:0014: D4 03 pei <R0+2
|
||||||
42 00:0029: F4 xx xx pea #<L1+14
|
42 00:0016: D4 01 pei <R0
|
||||||
43 00:002C: 22 xx xx xx jsl ~~fopen
|
43 00:0018: F4 xx xx pea #^L1
|
||||||
44 00:0030: 85 05 sta <L3+fp_1
|
44 00:001B: F4 xx xx pea #<L1
|
||||||
45 00:0032: 86 07 stx <L3+fp_1+2
|
45 00:001E: 22 xx xx xx jsl ~~fputs
|
||||||
46 ; fclose(fp);
|
46 ;
|
||||||
47 00:0034: D4 07 pei <L3+fp_1+2
|
47 ; fp = fopen("file.txt", "wb");
|
||||||
48 00:0036: D4 05 pei <L3+fp_1
|
48 00:0022: F4 xx xx pea #^L1+23
|
||||||
49 00:0038: 22 xx xx xx jsl ~~fclose
|
49 00:0025: F4 xx xx pea #<L1+23
|
||||||
50 ;}
|
50 00:0028: F4 xx xx pea #^L1+14
|
||||||
51 L4:
|
51 00:002B: F4 xx xx pea #<L1+14
|
||||||
52 00:003C: 2B pld
|
52 00:002E: 22 xx xx xx jsl ~~fopen
|
||||||
Tue Jan 17 2017 23:13 Page 2
|
Tue Jan 17 2017 23:24 Page 2
|
||||||
|
|
||||||
|
|
||||||
53 00:003D: 3B tsc
|
53 00:0032: 85 05 sta <L3+fp_1
|
||||||
54 00:003E: 18 clc
|
54 00:0034: 86 07 stx <L3+fp_1+2
|
||||||
55 00:003F: 69 08 00 adc #L2
|
55 ; fclose(fp);
|
||||||
56 00:0042: 1B tcs
|
56 00:0036: D4 07 pei <L3+fp_1+2
|
||||||
57 00:0043: 6B rtl
|
57 00:0038: D4 05 pei <L3+fp_1
|
||||||
58 00000008 L2 equ 8
|
58 00:003A: 22 xx xx xx jsl ~~fclose
|
||||||
59 00000005 L3 equ 5
|
59 ;}
|
||||||
60 ends
|
60 L4:
|
||||||
61 efunc
|
61 00:003E: 2B pld
|
||||||
62 data
|
62 00:003F: 3B tsc
|
||||||
63 L1:
|
63 00:0040: 18 clc
|
||||||
64 00:0000: 68 65 6C 6C db $68,$65,$6C,$6C,$6F,$2C,$20,$77,$6F,$72,
|
64 00:0041: 69 08 00 adc #L2
|
||||||
|
65 00:0044: 1B tcs
|
||||||
|
66 00:0045: 6B rtl
|
||||||
|
67 00000008 L2 equ 8
|
||||||
|
68 00000005 L3 equ 5
|
||||||
|
69 ends
|
||||||
|
70 efunc
|
||||||
|
71 data
|
||||||
|
72 L1:
|
||||||
|
73 00:0000: 68 65 6C 6C db $68,$65,$6C,$6C,$6F,$2C,$20,$77,$6F,$72,
|
||||||
$6C,$64,$0A,$00,$66
|
$6C,$64,$0A,$00,$66
|
||||||
00:0004: 6F 2C 20 77
|
00:0004: 6F 2C 20 77
|
||||||
00:0008: 6F 72 6C 64
|
00:0008: 6F 72 6C 64
|
||||||
00:000C: 0A 00 66
|
00:000C: 0A 00 66
|
||||||
65 00:000F: 69 6C 65 2E db $69,$6C,$65,$2E,$74,$78,$74,$00,$77,$62,
|
74 00:000F: 69 6C 65 2E db $69,$6C,$65,$2E,$74,$78,$74,$00,$77,$62,
|
||||||
$00
|
$00
|
||||||
00:0013: 74 78 74 00
|
00:0013: 74 78 74 00
|
||||||
00:0017: 77 62 00
|
00:0017: 77 62 00
|
||||||
66 00:001A: ends
|
75 00:001A: ends
|
||||||
67 ;
|
76 ;
|
||||||
68 ;// these stubs are not provided in the library bu
|
77 ;// these stubs are not provided in the library bu
|
||||||
t could call gs/os.
|
t could call gs/os.
|
||||||
69 ;
|
78 ;
|
||||||
70 ;int open(const char *name, int mode) {
|
79 ;int open(const char *name, int mode) {
|
||||||
71 code
|
80 code
|
||||||
72 xdef ~~open
|
81 xdef ~~open
|
||||||
73 func
|
82 func
|
||||||
74 ~~open:
|
83 ~~open:
|
||||||
75 longa on
|
84 longa on
|
||||||
76 longi on
|
85 longi on
|
||||||
77 00:0044: 3B tsc
|
86 00:0046: 3B tsc
|
||||||
78 00:0045: 38 sec
|
87 00:0047: 38 sec
|
||||||
79 00:0046: E9 00 00 sbc #L6
|
88 00:0048: E9 00 00 sbc #L6
|
||||||
80 00:0049: 1B tcs
|
89 00:004B: 1B tcs
|
||||||
81 00:004A: 0B phd
|
90 00:004C: 0B phd
|
||||||
82 00:004B: 5B tcd
|
91 00:004D: 5B tcd
|
||||||
83 00000004 name_0 set 4
|
92 00000004 name_0 set 4
|
||||||
84 00000008 mode_0 set 8
|
93 00000008 mode_0 set 8
|
||||||
85 ; return -1;
|
94 ; return -1;
|
||||||
86 00:004C: A9 FF FF lda #$ffff
|
95 00:004E: A9 FF FF lda #$ffff
|
||||||
87 L8:
|
96 L8:
|
||||||
88 00:004F: A8 tay
|
97 00:0051: A8 tay
|
||||||
89 00:0050: A5 02 lda <L6+2
|
98 00:0052: A5 02 lda <L6+2
|
||||||
90 00:0052: 85 08 sta <L6+2+6
|
99 00:0054: 85 08 sta <L6+2+6
|
||||||
91 00:0054: A5 01 lda <L6+1
|
100 00:0056: A5 01 lda <L6+1
|
||||||
92 00:0056: 85 07 sta <L6+1+6
|
101 00:0058: 85 07 sta <L6+1+6
|
||||||
93 00:0058: 2B pld
|
102 00:005A: 2B pld
|
||||||
94 00:0059: 3B tsc
|
Tue Jan 17 2017 23:24 Page 3
|
||||||
95 00:005A: 18 clc
|
|
||||||
96 00:005B: 69 06 00 adc #L6+6
|
|
||||||
97 00:005E: 1B tcs
|
|
||||||
98 00:005F: 98 tya
|
|
||||||
99 00:0060: 6B rtl
|
|
||||||
100 ;}
|
|
||||||
101 00000000 L6 equ 0
|
|
||||||
102 00000001 L7 equ 1
|
|
||||||
Tue Jan 17 2017 23:13 Page 3
|
|
||||||
|
|
||||||
|
|
||||||
103 ends
|
103 00:005B: 3B tsc
|
||||||
104 efunc
|
104 00:005C: 18 clc
|
||||||
105 ;
|
105 00:005D: 69 06 00 adc #L6+6
|
||||||
106 ;int close(int fd) {
|
106 00:0060: 1B tcs
|
||||||
107 code
|
107 00:0061: 98 tya
|
||||||
108 xdef ~~close
|
108 00:0062: 6B rtl
|
||||||
109 func
|
109 ;}
|
||||||
110 ~~close:
|
110 00000000 L6 equ 0
|
||||||
111 longa on
|
111 00000001 L7 equ 1
|
||||||
112 longi on
|
112 ends
|
||||||
113 00:0061: 3B tsc
|
113 efunc
|
||||||
114 00:0062: 38 sec
|
114 ;
|
||||||
115 00:0063: E9 00 00 sbc #L9
|
115 ;int close(int fd) {
|
||||||
116 00:0066: 1B tcs
|
116 code
|
||||||
117 00:0067: 0B phd
|
117 xdef ~~close
|
||||||
118 00:0068: 5B tcd
|
118 func
|
||||||
119 00000004 fd_0 set 4
|
119 ~~close:
|
||||||
120 ; return -1;
|
120 longa on
|
||||||
121 00:0069: A9 FF FF lda #$ffff
|
121 longi on
|
||||||
122 L11:
|
122 00:0063: 3B tsc
|
||||||
123 00:006C: A8 tay
|
123 00:0064: 38 sec
|
||||||
124 00:006D: A5 02 lda <L9+2
|
124 00:0065: E9 00 00 sbc #L9
|
||||||
125 00:006F: 85 04 sta <L9+2+2
|
125 00:0068: 1B tcs
|
||||||
126 00:0071: A5 01 lda <L9+1
|
126 00:0069: 0B phd
|
||||||
127 00:0073: 85 03 sta <L9+1+2
|
127 00:006A: 5B tcd
|
||||||
128 00:0075: 2B pld
|
128 00000004 fd_0 set 4
|
||||||
129 00:0076: 3B tsc
|
129 ; return -1;
|
||||||
130 00:0077: 18 clc
|
130 00:006B: A9 FF FF lda #$ffff
|
||||||
131 00:0078: 69 02 00 adc #L9+2
|
131 L11:
|
||||||
132 00:007B: 1B tcs
|
132 00:006E: A8 tay
|
||||||
133 00:007C: 98 tya
|
133 00:006F: A5 02 lda <L9+2
|
||||||
134 00:007D: 6B rtl
|
134 00:0071: 85 04 sta <L9+2+2
|
||||||
135 ;}
|
135 00:0073: A5 01 lda <L9+1
|
||||||
136 00000000 L9 equ 0
|
136 00:0075: 85 03 sta <L9+1+2
|
||||||
137 00000001 L10 equ 1
|
137 00:0077: 2B pld
|
||||||
138 ends
|
138 00:0078: 3B tsc
|
||||||
139 efunc
|
139 00:0079: 18 clc
|
||||||
140 ;
|
140 00:007A: 69 02 00 adc #L9+2
|
||||||
141 ;size_t read(int fd, void *buffer, size_t count) {
|
141 00:007D: 1B tcs
|
||||||
142 code
|
142 00:007E: 98 tya
|
||||||
143 xdef ~~read
|
143 00:007F: 6B rtl
|
||||||
144 func
|
144 ;}
|
||||||
145 ~~read:
|
145 00000000 L9 equ 0
|
||||||
146 longa on
|
146 00000001 L10 equ 1
|
||||||
147 longi on
|
147 ends
|
||||||
148 00:007E: 3B tsc
|
148 efunc
|
||||||
149 00:007F: 38 sec
|
149 ;
|
||||||
150 00:0080: E9 00 00 sbc #L12
|
150 ;size_t read(int fd, void *buffer, size_t count) {
|
||||||
151 00:0083: 1B tcs
|
151 code
|
||||||
152 00:0084: 0B phd
|
152 xdef ~~read
|
||||||
153 00:0085: 5B tcd
|
153 func
|
||||||
154 00000004 fd_0 set 4
|
154 ~~read:
|
||||||
155 00000006 buffer_0 set 6
|
155 longa on
|
||||||
156 0000000A count_0 set 10
|
156 longi on
|
||||||
157 ; return -1;
|
157 00:0080: 3B tsc
|
||||||
158 00:0086: A9 FF FF lda #$ffff
|
158 00:0081: 38 sec
|
||||||
159 L14:
|
159 00:0082: E9 00 00 sbc #L12
|
||||||
160 00:0089: A8 tay
|
160 00:0085: 1B tcs
|
||||||
Tue Jan 17 2017 23:13 Page 4
|
Tue Jan 17 2017 23:24 Page 4
|
||||||
|
|
||||||
|
|
||||||
161 00:008A: A5 02 lda <L12+2
|
161 00:0086: 0B phd
|
||||||
162 00:008C: 85 0A sta <L12+2+8
|
162 00:0087: 5B tcd
|
||||||
163 00:008E: A5 01 lda <L12+1
|
163 00000004 fd_0 set 4
|
||||||
164 00:0090: 85 09 sta <L12+1+8
|
164 00000006 buffer_0 set 6
|
||||||
165 00:0092: 2B pld
|
165 0000000A count_0 set 10
|
||||||
166 00:0093: 3B tsc
|
166 ; return -1;
|
||||||
167 00:0094: 18 clc
|
167 00:0088: A9 FF FF lda #$ffff
|
||||||
168 00:0095: 69 08 00 adc #L12+8
|
168 L14:
|
||||||
169 00:0098: 1B tcs
|
169 00:008B: A8 tay
|
||||||
170 00:0099: 98 tya
|
170 00:008C: A5 02 lda <L12+2
|
||||||
171 00:009A: 6B rtl
|
171 00:008E: 85 0A sta <L12+2+8
|
||||||
172 ;}
|
172 00:0090: A5 01 lda <L12+1
|
||||||
173 00000000 L12 equ 0
|
173 00:0092: 85 09 sta <L12+1+8
|
||||||
174 00000001 L13 equ 1
|
174 00:0094: 2B pld
|
||||||
175 ends
|
175 00:0095: 3B tsc
|
||||||
176 efunc
|
176 00:0096: 18 clc
|
||||||
177 ;
|
177 00:0097: 69 08 00 adc #L12+8
|
||||||
178 ;size_t write(int fd, void *buffer, size_t count)
|
178 00:009A: 1B tcs
|
||||||
|
179 00:009B: 98 tya
|
||||||
|
180 00:009C: 6B rtl
|
||||||
|
181 ;}
|
||||||
|
182 00000000 L12 equ 0
|
||||||
|
183 00000001 L13 equ 1
|
||||||
|
184 ends
|
||||||
|
185 efunc
|
||||||
|
186 ;
|
||||||
|
187 ;size_t write(int fd, void *buffer, size_t count)
|
||||||
{
|
{
|
||||||
179 code
|
188 code
|
||||||
180 xdef ~~write
|
189 xdef ~~write
|
||||||
181 func
|
190 func
|
||||||
182 ~~write:
|
191 ~~write:
|
||||||
183 longa on
|
192 longa on
|
||||||
184 longi on
|
193 longi on
|
||||||
185 00:009B: 3B tsc
|
194 00:009D: 3B tsc
|
||||||
186 00:009C: 38 sec
|
195 00:009E: 38 sec
|
||||||
187 00:009D: E9 02 00 sbc #L15
|
196 00:009F: E9 02 00 sbc #L15
|
||||||
188 00:00A0: 1B tcs
|
197 00:00A2: 1B tcs
|
||||||
189 00:00A1: 0B phd
|
198 00:00A3: 0B phd
|
||||||
190 00:00A2: 5B tcd
|
199 00:00A4: 5B tcd
|
||||||
191 00000004 fd_0 set 4
|
200 00000004 fd_0 set 4
|
||||||
192 00000006 buffer_0 set 6
|
201 00000006 buffer_0 set 6
|
||||||
193 0000000A count_0 set 10
|
202 0000000A count_0 set 10
|
||||||
194 ; static struct {
|
203 ; static struct {
|
||||||
195 ; unsigned pCount;
|
204 ; unsigned pCount;
|
||||||
196 ; unsigned refNum;
|
205 ; unsigned refNum;
|
||||||
197 ; void *dataBuffer;
|
206 ; void *dataBuffer;
|
||||||
198 ; unsigned long requestCount;
|
207 ; unsigned long requestCount;
|
||||||
199 ; unsigned long transferCount;
|
208 ; unsigned long transferCount;
|
||||||
200 ; unsigned cachePriority;
|
209 ; unsigned cachePriority;
|
||||||
201 ; } dcb;
|
210 ; } dcb;
|
||||||
202 udata
|
211 udata
|
||||||
203 L10001:
|
212 L10001:
|
||||||
204 00:0000: ds 18
|
213 00:0000: ds 18
|
||||||
205 00:0012: ends
|
214 00:0012: ends
|
||||||
206 ;
|
215 ;
|
||||||
207 ; unsigned tool_error = 0x0043;
|
216 ; unsigned tool_error = 0x0043;
|
||||||
208 ;
|
217 ;
|
||||||
209 ; dcb.pCount = 4;
|
Tue Jan 17 2017 23:24 Page 5
|
||||||
210 00000000 tool_error_1 set 0
|
|
||||||
211 00:00A3: A9 43 00 lda #$43
|
|
||||||
212 00:00A6: 85 01 sta <L16+tool_error_1
|
|
||||||
213 00:00A8: A9 04 00 lda #$4
|
|
||||||
214 00:00AB: 8D xx xx sta |L10001
|
|
||||||
215 ; dcb.refNum = fd+1;
|
|
||||||
216 00:00AE: A5 06 lda <L15+fd_0
|
|
||||||
217 00:00B0: 1A ina
|
|
||||||
Tue Jan 17 2017 23:13 Page 5
|
|
||||||
|
|
||||||
|
|
||||||
218 00:00B1: 8D xx xx sta |L10001+2
|
218 ; dcb.pCount = 4;
|
||||||
219 ; dcb.dataBuffer = buffer;
|
219 00000000 tool_error_1 set 0
|
||||||
220 00:00B4: A5 08 lda <L15+buffer_0
|
220 00:00A5: A9 43 00 lda #$43
|
||||||
221 00:00B6: 8D xx xx sta |L10001+4
|
221 00:00A8: 85 01 sta <L16+tool_error_1
|
||||||
222 00:00B9: A5 0A lda <L15+buffer_0+2
|
222 00:00AA: A9 04 00 lda #$4
|
||||||
223 00:00BB: 8D xx xx sta |L10001+4+2
|
223 00:00AD: 8D xx xx sta |L10001
|
||||||
224 ; dcb.requestCount = count;
|
224 ; dcb.refNum = fd+1;
|
||||||
225 00:00BE: A5 0C lda <L15+count_0
|
225 00:00B0: A5 06 lda <L15+fd_0
|
||||||
226 00:00C0: 8D xx xx sta |L10001+8
|
226 00:00B2: 1A ina
|
||||||
227 00:00C3: 9C xx xx stz |L10001+8+2
|
227 00:00B3: 8D xx xx sta |L10001+2
|
||||||
228 ; #asm
|
228 ; dcb.dataBuffer = buffer;
|
||||||
229 ; pea #^%%dcb
|
229 00:00B6: A5 08 lda <L15+buffer_0
|
||||||
230 ; pea #%%dcb
|
230 00:00B8: 8D xx xx sta |L10001+4
|
||||||
231 ; pea #$2012
|
231 00:00BB: A5 0A lda <L15+buffer_0+2
|
||||||
232 ; jsl $e100b0
|
232 00:00BD: 8D xx xx sta |L10001+4+2
|
||||||
233 ; sta %%tool_error;
|
233 ; dcb.requestCount = count;
|
||||||
234 ; #endasm
|
234 00:00C0: A5 0C lda <L15+count_0
|
||||||
235 asmstart
|
235 00:00C2: 8D xx xx sta |L10001+8
|
||||||
236 00:00C6: F4 xx xx pea #^L10001
|
236 00:00C5: 9C xx xx stz |L10001+8+2
|
||||||
237 00:00C9: F4 xx xx pea #L10001
|
237 ; #asm
|
||||||
238 00:00CC: F4 12 20 pea #$2012
|
238 ; pea #^%%dcb
|
||||||
239 00:00CF: 22 B0 00 E1 jsl $e100b0
|
239 ; pea #%%dcb
|
||||||
240 00:00D3: 85 01 sta <L16+tool_error_1;
|
240 ; pea #$2012
|
||||||
241 asmend
|
241 ; jsl $e100b0
|
||||||
242 ; if (tool_error) return -1;
|
242 ; sta %%tool_error;
|
||||||
243 00:00D5: A5 01 lda <L16+tool_error_1
|
243 ; #endasm
|
||||||
244 00:00D7: D0 03 bne L17
|
244 asmstart
|
||||||
245 00:00D9: 82 15 00 brl L10002
|
245 00:00C8: F4 xx xx pea #^L10001
|
||||||
246 L17:
|
246 00:00CB: F4 xx xx pea #L10001
|
||||||
247 00:00DC: A9 FF FF lda #$ffff
|
247 00:00CE: F4 12 20 pea #$2012
|
||||||
248 L18:
|
248 00:00D1: 22 B0 00 E1 jsl $e100b0
|
||||||
249 00:00DF: A8 tay
|
249 00:00D5: 85 01 sta <L16+tool_error_1;
|
||||||
250 00:00E0: A5 04 lda <L15+2
|
250 asmend
|
||||||
251 00:00E2: 85 0C sta <L15+2+8
|
251 ; if (tool_error) return -1;
|
||||||
252 00:00E4: A5 03 lda <L15+1
|
252 00:00D7: A5 01 lda <L16+tool_error_1
|
||||||
253 00:00E6: 85 0B sta <L15+1+8
|
253 00:00D9: D0 03 bne L17
|
||||||
254 00:00E8: 2B pld
|
254 00:00DB: 82 15 00 brl L10002
|
||||||
255 00:00E9: 3B tsc
|
255 L17:
|
||||||
256 00:00EA: 18 clc
|
256 00:00DE: A9 FF FF lda #$ffff
|
||||||
257 00:00EB: 69 0A 00 adc #L15+8
|
257 L18:
|
||||||
258 00:00EE: 1B tcs
|
258 00:00E1: A8 tay
|
||||||
259 00:00EF: 98 tya
|
259 00:00E2: A5 04 lda <L15+2
|
||||||
260 00:00F0: 6B rtl
|
260 00:00E4: 85 0C sta <L15+2+8
|
||||||
261 ; return dcb.transferCount;
|
261 00:00E6: A5 03 lda <L15+1
|
||||||
262 L10002:
|
262 00:00E8: 85 0B sta <L15+1+8
|
||||||
263 00:00F1: AD xx xx lda |L10001+12
|
263 00:00EA: 2B pld
|
||||||
264 00:00F4: 82 E8 FF brl L18
|
264 00:00EB: 3B tsc
|
||||||
265 ;}
|
265 00:00EC: 18 clc
|
||||||
266 00000002 L15 equ 2
|
266 00:00ED: 69 0A 00 adc #L15+8
|
||||||
267 00000001 L16 equ 1
|
267 00:00F0: 1B tcs
|
||||||
268 ends
|
268 00:00F1: 98 tya
|
||||||
269 efunc
|
269 00:00F2: 6B rtl
|
||||||
270 ;
|
270 ; return dcb.transferCount;
|
||||||
271 ;long lseek(int fd, long offset, int whence) {
|
271 L10002:
|
||||||
272 code
|
272 00:00F3: AD xx xx lda |L10001+12
|
||||||
273 xdef ~~lseek
|
273 00:00F6: 82 E8 FF brl L18
|
||||||
274 func
|
274 ;}
|
||||||
275 ~~lseek:
|
275 00000002 L15 equ 2
|
||||||
Tue Jan 17 2017 23:13 Page 6
|
Tue Jan 17 2017 23:24 Page 6
|
||||||
|
|
||||||
|
|
||||||
276 longa on
|
276 00000001 L16 equ 1
|
||||||
277 longi on
|
277 ends
|
||||||
278 00:00F7: 3B tsc
|
278 efunc
|
||||||
279 00:00F8: 38 sec
|
279 ;
|
||||||
280 00:00F9: E9 00 00 sbc #L19
|
280 ;long lseek(int fd, long offset, int whence) {
|
||||||
281 00:00FC: 1B tcs
|
281 code
|
||||||
282 00:00FD: 0B phd
|
282 xdef ~~lseek
|
||||||
283 00:00FE: 5B tcd
|
283 func
|
||||||
284 00000004 fd_0 set 4
|
284 ~~lseek:
|
||||||
285 00000006 offset_0 set 6
|
285 longa on
|
||||||
286 0000000A whence_0 set 10
|
286 longi on
|
||||||
287 ; return -1;
|
287 00:00F9: 3B tsc
|
||||||
288 00:00FF: A9 FF FF lda #$ffff
|
288 00:00FA: 38 sec
|
||||||
289 00:0102: AA tax
|
289 00:00FB: E9 00 00 sbc #L19
|
||||||
290 00:0103: A9 FF FF lda #$ffff
|
290 00:00FE: 1B tcs
|
||||||
291 L21:
|
291 00:00FF: 0B phd
|
||||||
292 00:0106: A8 tay
|
292 00:0100: 5B tcd
|
||||||
293 00:0107: A5 02 lda <L19+2
|
293 00000004 fd_0 set 4
|
||||||
294 00:0109: 85 0A sta <L19+2+8
|
294 00000006 offset_0 set 6
|
||||||
295 00:010B: A5 01 lda <L19+1
|
295 0000000A whence_0 set 10
|
||||||
296 00:010D: 85 09 sta <L19+1+8
|
296 ; return -1;
|
||||||
297 00:010F: 2B pld
|
297 00:0101: A9 FF FF lda #$ffff
|
||||||
298 00:0110: 3B tsc
|
298 00:0104: AA tax
|
||||||
299 00:0111: 18 clc
|
299 00:0105: A9 FF FF lda #$ffff
|
||||||
300 00:0112: 69 08 00 adc #L19+8
|
300 L21:
|
||||||
301 00:0115: 1B tcs
|
301 00:0108: A8 tay
|
||||||
302 00:0116: 98 tya
|
302 00:0109: A5 02 lda <L19+2
|
||||||
303 00:0117: 6B rtl
|
303 00:010B: 85 0A sta <L19+2+8
|
||||||
304 ;}
|
304 00:010D: A5 01 lda <L19+1
|
||||||
305 00000000 L19 equ 0
|
305 00:010F: 85 09 sta <L19+1+8
|
||||||
306 00000001 L20 equ 1
|
306 00:0111: 2B pld
|
||||||
307 ends
|
307 00:0112: 3B tsc
|
||||||
308 efunc
|
308 00:0113: 18 clc
|
||||||
309 ;
|
309 00:0114: 69 08 00 adc #L19+8
|
||||||
310 ;int creat(const char *name, int mode) {
|
310 00:0117: 1B tcs
|
||||||
311 code
|
311 00:0118: 98 tya
|
||||||
312 xdef ~~creat
|
312 00:0119: 6B rtl
|
||||||
313 func
|
313 ;}
|
||||||
314 ~~creat:
|
314 00000000 L19 equ 0
|
||||||
315 longa on
|
315 00000001 L20 equ 1
|
||||||
316 longi on
|
316 ends
|
||||||
317 00:0118: 3B tsc
|
317 efunc
|
||||||
318 00:0119: 38 sec
|
318 ;
|
||||||
319 00:011A: E9 00 00 sbc #L22
|
319 ;int creat(const char *name, int mode) {
|
||||||
320 00:011D: 1B tcs
|
320 code
|
||||||
321 00:011E: 0B phd
|
321 xdef ~~creat
|
||||||
322 00:011F: 5B tcd
|
322 func
|
||||||
323 00000004 name_0 set 4
|
323 ~~creat:
|
||||||
324 00000008 mode_0 set 8
|
324 longa on
|
||||||
325 ; return -1;
|
325 longi on
|
||||||
326 00:0120: A9 FF FF lda #$ffff
|
326 00:011A: 3B tsc
|
||||||
327 L24:
|
327 00:011B: 38 sec
|
||||||
328 00:0123: A8 tay
|
328 00:011C: E9 00 00 sbc #L22
|
||||||
329 00:0124: A5 02 lda <L22+2
|
329 00:011F: 1B tcs
|
||||||
330 00:0126: 85 08 sta <L22+2+6
|
330 00:0120: 0B phd
|
||||||
331 00:0128: A5 01 lda <L22+1
|
331 00:0121: 5B tcd
|
||||||
332 00:012A: 85 07 sta <L22+1+6
|
332 00000004 name_0 set 4
|
||||||
333 00:012C: 2B pld
|
333 00000008 mode_0 set 8
|
||||||
Tue Jan 17 2017 23:13 Page 7
|
Tue Jan 17 2017 23:24 Page 7
|
||||||
|
|
||||||
|
|
||||||
334 00:012D: 3B tsc
|
334 ; return -1;
|
||||||
335 00:012E: 18 clc
|
335 00:0122: A9 FF FF lda #$ffff
|
||||||
336 00:012F: 69 06 00 adc #L22+6
|
336 L24:
|
||||||
337 00:0132: 1B tcs
|
337 00:0125: A8 tay
|
||||||
338 00:0133: 98 tya
|
338 00:0126: A5 02 lda <L22+2
|
||||||
339 00:0134: 6B rtl
|
339 00:0128: 85 08 sta <L22+2+6
|
||||||
340 ;}
|
340 00:012A: A5 01 lda <L22+1
|
||||||
341 00000000 L22 equ 0
|
341 00:012C: 85 07 sta <L22+1+6
|
||||||
342 00000001 L23 equ 1
|
342 00:012E: 2B pld
|
||||||
343 ends
|
343 00:012F: 3B tsc
|
||||||
344 efunc
|
344 00:0130: 18 clc
|
||||||
345 ;
|
345 00:0131: 69 06 00 adc #L22+6
|
||||||
346 ;int unlink(const char *name) {
|
346 00:0134: 1B tcs
|
||||||
347 code
|
347 00:0135: 98 tya
|
||||||
348 xdef ~~unlink
|
348 00:0136: 6B rtl
|
||||||
349 func
|
349 ;}
|
||||||
350 ~~unlink:
|
350 00000000 L22 equ 0
|
||||||
351 longa on
|
351 00000001 L23 equ 1
|
||||||
352 longi on
|
352 ends
|
||||||
353 00:0135: 3B tsc
|
353 efunc
|
||||||
354 00:0136: 38 sec
|
354 ;
|
||||||
355 00:0137: E9 00 00 sbc #L25
|
355 ;int unlink(const char *name) {
|
||||||
356 00:013A: 1B tcs
|
356 code
|
||||||
357 00:013B: 0B phd
|
357 xdef ~~unlink
|
||||||
358 00:013C: 5B tcd
|
358 func
|
||||||
359 00000004 name_0 set 4
|
359 ~~unlink:
|
||||||
360 ; return -1;
|
360 longa on
|
||||||
361 00:013D: A9 FF FF lda #$ffff
|
361 longi on
|
||||||
362 L27:
|
362 00:0137: 3B tsc
|
||||||
363 00:0140: A8 tay
|
363 00:0138: 38 sec
|
||||||
364 00:0141: A5 02 lda <L25+2
|
364 00:0139: E9 00 00 sbc #L25
|
||||||
365 00:0143: 85 06 sta <L25+2+4
|
365 00:013C: 1B tcs
|
||||||
366 00:0145: A5 01 lda <L25+1
|
366 00:013D: 0B phd
|
||||||
367 00:0147: 85 05 sta <L25+1+4
|
367 00:013E: 5B tcd
|
||||||
368 00:0149: 2B pld
|
368 00000004 name_0 set 4
|
||||||
369 00:014A: 3B tsc
|
369 ; return -1;
|
||||||
370 00:014B: 18 clc
|
370 00:013F: A9 FF FF lda #$ffff
|
||||||
371 00:014C: 69 04 00 adc #L25+4
|
371 L27:
|
||||||
372 00:014F: 1B tcs
|
372 00:0142: A8 tay
|
||||||
373 00:0150: 98 tya
|
373 00:0143: A5 02 lda <L25+2
|
||||||
374 00:0151: 6B rtl
|
374 00:0145: 85 06 sta <L25+2+4
|
||||||
375 ;}
|
375 00:0147: A5 01 lda <L25+1
|
||||||
376 00000000 L25 equ 0
|
376 00:0149: 85 05 sta <L25+1+4
|
||||||
377 00000001 L26 equ 1
|
377 00:014B: 2B pld
|
||||||
378 ends
|
378 00:014C: 3B tsc
|
||||||
379 efunc
|
379 00:014D: 18 clc
|
||||||
380 ;
|
380 00:014E: 69 04 00 adc #L25+4
|
||||||
381 ;int isatty(int fd) {
|
381 00:0151: 1B tcs
|
||||||
382 code
|
382 00:0152: 98 tya
|
||||||
383 xdef ~~isatty
|
383 00:0153: 6B rtl
|
||||||
384 func
|
384 ;}
|
||||||
385 ~~isatty:
|
385 00000000 L25 equ 0
|
||||||
386 longa on
|
386 00000001 L26 equ 1
|
||||||
387 longi on
|
387 ends
|
||||||
388 00:0152: 3B tsc
|
388 efunc
|
||||||
389 00:0153: 38 sec
|
389 ;
|
||||||
390 00:0154: E9 00 00 sbc #L28
|
390 ;int isatty(int fd) {
|
||||||
391 00:0157: 1B tcs
|
391 code
|
||||||
Tue Jan 17 2017 23:13 Page 8
|
Tue Jan 17 2017 23:24 Page 8
|
||||||
|
|
||||||
|
|
||||||
392 00:0158: 0B phd
|
392 xdef ~~isatty
|
||||||
393 00:0159: 5B tcd
|
393 func
|
||||||
394 00000004 fd_0 set 4
|
394 ~~isatty:
|
||||||
395 ; return -1;
|
395 longa on
|
||||||
396 00:015A: A9 FF FF lda #$ffff
|
396 longi on
|
||||||
397 L30:
|
397 00:0154: 3B tsc
|
||||||
398 00:015D: A8 tay
|
398 00:0155: 38 sec
|
||||||
399 00:015E: A5 02 lda <L28+2
|
399 00:0156: E9 00 00 sbc #L28
|
||||||
400 00:0160: 85 04 sta <L28+2+2
|
400 00:0159: 1B tcs
|
||||||
401 00:0162: A5 01 lda <L28+1
|
401 00:015A: 0B phd
|
||||||
402 00:0164: 85 03 sta <L28+1+2
|
402 00:015B: 5B tcd
|
||||||
403 00:0166: 2B pld
|
403 00000004 fd_0 set 4
|
||||||
404 00:0167: 3B tsc
|
404 ; return -1;
|
||||||
405 00:0168: 18 clc
|
405 00:015C: A9 FF FF lda #$ffff
|
||||||
406 00:0169: 69 02 00 adc #L28+2
|
406 L30:
|
||||||
407 00:016C: 1B tcs
|
407 00:015F: A8 tay
|
||||||
408 00:016D: 98 tya
|
408 00:0160: A5 02 lda <L28+2
|
||||||
409 00:016E: 6B rtl
|
409 00:0162: 85 04 sta <L28+2+2
|
||||||
410 ;}
|
410 00:0164: A5 01 lda <L28+1
|
||||||
411 00000000 L28 equ 0
|
411 00:0166: 85 03 sta <L28+1+2
|
||||||
412 00000001 L29 equ 1
|
412 00:0168: 2B pld
|
||||||
413 ends
|
413 00:0169: 3B tsc
|
||||||
414 efunc
|
414 00:016A: 18 clc
|
||||||
415 ;
|
415 00:016B: 69 02 00 adc #L28+2
|
||||||
416 ;
|
416 00:016E: 1B tcs
|
||||||
417 ;#pragma section udata=heap
|
417 00:016F: 98 tya
|
||||||
418 heap section
|
418 00:0170: 6B rtl
|
||||||
419 00:0000: ends
|
419 ;}
|
||||||
420 ;char __heap[8192];
|
420 00000000 L28 equ 0
|
||||||
421 ;void *heap_start = (void *)__heap;
|
421 00000001 L29 equ 1
|
||||||
422 data
|
422 ends
|
||||||
423 xdef ~~heap_start
|
423 efunc
|
||||||
424 ~~heap_start:
|
424 ;
|
||||||
425 00:001A: xx xx xx xx dl ~~__heap
|
425 ;
|
||||||
426 00:001E: ends
|
426 ;#pragma section udata=heap
|
||||||
427 ;void *heap_end = (void *)&__heap[8092];
|
427 heap section
|
||||||
428 data
|
428 00:0000: ends
|
||||||
429 xdef ~~heap_end
|
429 ;char __heap[8192];
|
||||||
430 ~~heap_end:
|
430 ;void *heap_start = (void *)__heap;
|
||||||
431 00:001E: xx xx xx xx dl ~~__heap+8092
|
431 data
|
||||||
432 00:0022: ends
|
432 xdef ~~heap_start
|
||||||
433 ;
|
433 ~~heap_start:
|
||||||
434 xref ~~fputs
|
434 00:001A: xx xx xx xx dl ~~__heap
|
||||||
435 xref ~~fopen
|
435 00:001E: ends
|
||||||
436 xref ~~fclose
|
436 ;void *heap_end = (void *)&__heap[8092];
|
||||||
437 heap
|
437 data
|
||||||
438 xdef ~~__heap
|
438 xdef ~~heap_end
|
||||||
439 ~~__heap
|
439 ~~heap_end:
|
||||||
440 00:0000: ds 8192
|
440 00:001E: xx xx xx xx dl ~~__heap+8092
|
||||||
441 00:2000: ends
|
441 00:0022: ends
|
||||||
442 xref ~~_iob
|
442 ;
|
||||||
443 end
|
443 xref ~~fputs
|
||||||
|
444 xref ~~fopen
|
||||||
|
445 xref ~~fclose
|
||||||
|
446 heap
|
||||||
|
447 xdef ~~__heap
|
||||||
|
448 ~~__heap
|
||||||
|
449 00:0000: ds 8192
|
||||||
|
Tue Jan 17 2017 23:24 Page 9
|
||||||
|
|
||||||
|
|
||||||
Lines assembled: 443
|
450 00:2000: ends
|
||||||
|
451 xref ~~_iob
|
||||||
|
452 end
|
||||||
|
|
||||||
|
|
||||||
|
Lines assembled: 452
|
||||||
Errors: 0
|
Errors: 0
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user