blob: c54496fa967a128ce17f5d08a2e85c9eec010e65 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
; Zilog eZ80 ANSI C Compiler Release 3.4
; -optsize -nomodsect -peephole -globalopt -localcse
; -const=ROM
FILE "..\FCLOSE.C"
.assume ADL=1
SEGMENT CODE
; 1 #include <stdio.h>
; 2 #include <fileioc.h>
; 3
; 4 int fclose(FILE *stream) {
_fclose:
LD HL,-1
CALL __frameset
; 5 ti_var_t slot = stream->slot;
LD IY,(IX+6)
LD A,(IY+0)
LD (IX+-1),A
; 6 __stdio_files[slot].slot = 0;
UEXT HL
LD L,A
LD BC,___stdio_files
ADD HL,BC
LD IY,HL
LD (IY+0),0
; 7 return ti_Close(slot);
LD C,(IX+-1)
LD B,0
PUSH BC
CALL _ti_Close
POP BC
; 8 }
LD SP,IX
POP IX
RET
;**************************** _fclose ***************************
;Name Addr/Register Size Type
;_ti_Close IMPORT ----- function
;___stdio_files IMPORT 5 variable
;slot IX-1 1 variable
;stream IX+6 3 parameter
; Stack Frame Size: 10 (bytes)
; Spill Code: 0 (instruction)
XREF ___stdio_files:ROM
XREF _ti_Close:ROM
XREF __frameset:ROM
XDEF _fclose
END
|