home *** CD-ROM | disk | FTP | other *** search
Modula Implementation | 1996-02-22 | 4.1 KB | 102 lines | [TEXT/3PRM] |
- implementation module standard_file;
-
- import mac_types;
-
- SFGetFile :: !(!Int,!Int) !{#Char} !Int !Int !{#Char} !Int !{#Char} !Toolbox -> (!Bool,!Bool,!Int,!Int,!Int,!{#Char},!Toolbox);
- SFGetFile hv prompt fileFilter numTypes typeList dlgHook string64 tb
- = (good,copy,fType,vRefNum,version,fName,NewToolbox);
- where{
- (good,copy,fType,vRefNum,version,fName) = SFGetFile1 hv prompt fileFilter numTypes typeList dlgHook string64 tb};
-
- SFGetFile1 :: !(!Int,!Int) !{#Char} !Int !Int !{#Char} !Int !{#Char} !Toolbox -> (!Bool,!Bool,!Int,!Int,!Int,!{#Char});
- SFGetFile1 (h,v) prompt fileFilter numTypes typeList dlgHook string64 t
- = code (h=D5,v=D4,prompt=A2,fileFilter=D3,numTypes=D2,typeList=A1,dlgHook=D1,
- string64=A0,t=U)(good=D4,copy=D3,fType=D2,vRefNum=D1,version=D0,fName=A0)
- {
- instruction 0x4FEF 0xFFB6 || lea -74(sp),sp
- instruction 0x3F05 || move d5,-(sp)
- instruction 0x3F04 || move d4,-(sp)
- instruction 0x486A 0x0007 || pea 7(a2)
- instruction 0x2F03 || move.l d3,-(sp)
- instruction 0x3F02 || move d2,-(sp)
- instruction 0x4869 0x0008 || pea 8(a1)
- instruction 0x2F01 || move.l d1,-(sp)
- instruction 0x2A08 || move.l a0,d5
- instruction 0x486F 0x0016 || pea 22(sp)
- instruction 0x3F3C 0x0002 || move #2,-(sp)
- instruction 0xA9EA || _Pack3
- instruction 0x7801 || moveq #1,d4
- instruction 0xC817 || and.b (sp),d4
- instruction 0x4484 || neg.l d4
- instruction 0x7601 || moveq #1,d3
- instruction 0xC62F 0x0001 || and.b 1(sp),d3
- instruction 0x4483 || neg.l d3
- instruction 0x548F || addq.l #2,sp
- instruction 0x241F || move.l (sp)+,d2
- instruction 0x321F || move (sp)+,d1
- instruction 0x48C1 || ext.l d1
- instruction 0x301F || move (sp)+,d0
- instruction 0x48C0 || ext.l d0
- instruction 0x224F || move.l sp,a1
- instruction 0x2045 || move.l d5,a0
- instruction 0x2445 || move.l d5,a2
- instruction 0x42A8 0x0004 || clr.l 4(a0)
- instruction 0x5E88 || addq.l #7,a0
- instruction 0x7A00 || moveq #0,d5
- instruction 0x1A19 || move.b (a1)+,d5
- instruction 0x10C5 || move.b d5,(a0)+
- instruction 0x6002 || bra.s l4
- instruction 0x10D9 || l3: move.b (a1)+,(a0)+
- instruction 0x51CD 0xFFFC || l4: dbra d5,l3
- instruction 0x4FEF 0x0040 || lea 64(sp),sp
- instruction 0x204A || move.l a2,a0
- };
-
- SFPutFile :: !(!Int,!Int) !{#Char} !{#Char} !Int !{#Char} !Toolbox -> (!Bool,!Bool,!Int,!Int,!Int,!{#Char},!Toolbox);
- SFPutFile hv prompt origName dlgHook string64 tb
- = (good,copy,fType,vRefNum,version,fName,NewToolbox);
- where{
- (good,copy,fType,vRefNum,version,fName) = SFPutFile1 hv prompt origName dlgHook string64 tb};
-
- SFPutFile1 :: !(!Int,!Int) !{#Char} !{#Char} !Int !{#Char} !Toolbox -> (!Bool,!Bool,!Int,!Int,!Int,!{#Char});
- SFPutFile1 (h,v) prompt origName dlgHook string64 t
- = code (h=D3,v=D2,prompt=A2,origName=A1,dlgHook=D1,string64=A0,t=U)
- (good=D4,copy=D3,fType=D2,vRefNum=D1,version=D0,fName=A0)
- {
- instruction 0x4FEF 0xFFB6 || lea -74(sp),sp
- instruction 0x3F03 || move d3,-(sp)
- instruction 0x3F02 || move d2,-(sp)
- instruction 0x486A 0x0007 || pea 7(a2)
- instruction 0x4869 0x0007 || pea 7(a1)
- instruction 0x2F01 || move.l d1,-(sp)
- instruction 0x2A08 || move.l a0,d5
- instruction 0x486F 0x0010 || pea 16(sp)
- instruction 0x3F3C 0x0001 || move #1,-(sp)
- instruction 0xA9EA || _Pack3
- instruction 0x7801 || moveq #1,d4
- instruction 0xC817 || and.b (sp),d4
- instruction 0x4484 || neg.l d4
- instruction 0x7601 || moveq #1,d3
- instruction 0xC62F 0x0001 || and.b 1(sp),d3
- instruction 0x4483 || neg.l d3
- instruction 0x548F || addq.l #2,sp
- instruction 0x241F || move.l (sp)+,d2
- instruction 0x321F || move (sp)+,d1
- instruction 0x48C1 || ext.l d1
- instruction 0x301F || move (sp)+,d0
- instruction 0x48C0 || ext.l d0
- instruction 0x224F || move.l sp,a1
- instruction 0x2045 || move.l d5,a0
- instruction 0x2445 || move.l d5,a2
- instruction 0x42A8 0x0004 || clr.l 4(a0)
- instruction 0x5E88 || addq.l #7,a0
- instruction 0x7A00 || moveq #0,d5
- instruction 0x1A19 || move.b (a1)+,d5
- instruction 0x10C5 || move.b d5,(a0)+
- instruction 0x6002 || bra.s l4
- instruction 0x10D9 || l3: move.b (a1)+,(a0)+
- instruction 0x51CD 0xFFFC || l4: dbra d5,l3
- instruction 0x4FEF 0x0040 || lea 64(sp),sp
- instruction 0x204A || move.l a2,a0
- };
-