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