swiven.s
上传用户:andy_li
上传日期:2007-01-06
资源大小:1019k
文件大小:4k
源码类别:

压缩解压

开发平台:

MultiPlatform

  1. ; SWI veneers used by Zip/Unzip
  2. ;
  3. r0 RN 0
  4. r1 RN 1
  5. r2 RN 2
  6. r3 RN 3
  7. r4 RN 4
  8. r5 RN 5
  9. r6 RN 6
  10. r7 RN 7
  11. r8 RN 8
  12. r9 RN 9
  13. r10 RN 10
  14. r11 RN 11
  15. r12 RN 12
  16. sp RN 13
  17. lr RN 14
  18. pc RN 15
  19. sl RN 10
  20. fp RN 11
  21. ip RN 12
  22. XOS_Bit EQU &020000
  23. OS_GBPB EQU &00000C
  24. OS_File EQU &000008
  25. OS_FSControl EQU &000029
  26. OS_CLI EQU &000005
  27. OS_ReadC EQU &000004
  28. OS_ReadVarVal EQU &000023
  29. DDEUtils_Prefix EQU &042580
  30. Territory_ReadCurrentTimeZone EQU &043048
  31. MACRO
  32. STARTCODE $name
  33. EXPORT $name
  34. $name
  35. MEND
  36. AREA |C$$code|, CODE, READONLY
  37. ; os_error *SWI_OS_FSControl_26(char *source, char *dest, int actionmask);
  38. STARTCODE SWI_OS_FSControl_26
  39. MOV ip, lr
  40. MOV r3, r2
  41. MOV r2, r1
  42. MOV r1, r0
  43. MOV r0, #26
  44. SWI OS_FSControl + XOS_Bit
  45. MOVVC r0, #0
  46. MOVS pc, ip
  47. ; os_error *SWI_OS_FSControl_27(char *filename, int actionmask);
  48. STARTCODE SWI_OS_FSControl_27
  49. MOV ip, lr
  50. MOV r3, r1
  51. MOV r1, r0
  52. MOV r0, #27
  53. SWI OS_FSControl + XOS_Bit
  54. MOVVC r0, #0
  55. MOVS pc, ip
  56. ; os_error *SWI_OS_GBPB_9(char *dirname, void *buf, int *number,
  57. ;   int *offset, int size, char *match);
  58. STARTCODE SWI_OS_GBPB_9
  59. MOV ip, sp
  60. STMFD sp!, {r2-r6,lr}
  61. LDMIA ip, {r5,r6}
  62. LDR r4, [r3]
  63. LDR r3, [r2]
  64. MOV r2, r1
  65. MOV r1, r0
  66. MOV r0, #9
  67. SWI OS_GBPB + XOS_Bit
  68. LDMVSFD sp!, {r2-r6,pc}^
  69. MOV r0, #0
  70. LDMFD sp, {r5,r6}
  71. STR r3, [r5]
  72. STR r4, [r6]
  73. LDMFD sp!, {r2-r6,pc}^
  74. ; os_error *SWI_OS_File_1(char *filename, int loadaddr, int execaddr, int attrib);
  75. STARTCODE SWI_OS_File_1
  76. STMFD sp!, {r5,lr}
  77. MOV r5, r3
  78. MOV r3, r2
  79. MOV r2, r1
  80. MOV r1, r0
  81. MOV r0, #1
  82. SWI OS_File + XOS_Bit
  83. MOVVC r0, #0
  84. LDMFD sp!, {r5,pc}^
  85. ; os_error *SWI_OS_File_5(char *filename, int *objtype, int *loadaddr,
  86. ;   int *execaddr, int *length, int *attrib);
  87. STARTCODE SWI_OS_File_5
  88. STMFD sp!, {r1-r5,lr}
  89. MOV r1, r0
  90. MOV r0, #5
  91. SWI OS_File + XOS_Bit
  92. LDMVSFD sp!, {r1-r5,pc}^
  93. LDR lr, [sp]
  94. TEQ lr, #0
  95. STRNE r0, [lr]
  96. LDR lr, [sp, #4]
  97. TEQ lr ,#0
  98. STRNE r2, [lr]
  99. LDR lr, [sp, #8]
  100. TEQ lr, #0
  101. STRNE r3, [lr]
  102. LDR lr, [sp ,#24]
  103. TEQ lr, #0
  104. STRNE r4, [lr]
  105. LDR lr, [sp ,#28]
  106. TEQ lr, #0
  107. STRNE r5, [lr]
  108. MOV r0, #0
  109. LDMFD sp!, {r1-r5,pc}^
  110. ; os_error *SWI_OS_File_6(char *filename);
  111. STARTCODE SWI_OS_File_6
  112. STMFD sp!, {r4-r5,lr}
  113. MOV r1, r0
  114. MOV r0, #6
  115. SWI OS_File + XOS_Bit
  116. MOVVC r0, #0
  117. LDMFD sp!, {r4-r5,pc}^
  118. ; os_error *SWI_OS_File_7(char *filename, int loadaddr, int execaddr, int size);
  119. STARTCODE SWI_OS_File_7
  120. STMFD sp!, {r4-r5,lr}
  121. MOV r5, r3
  122. MOV r4, #0
  123. MOV r3, r2
  124. MOV r2, r1
  125. MOV r1, r0
  126. MOV r0, #7
  127. SWI OS_File + XOS_Bit
  128. MOVVC r0, #0
  129. LDMFD sp!, {r4-r5,pc}^
  130. ; os_error *SWI_OS_File_8(char *dirname);
  131. STARTCODE SWI_OS_File_8
  132. STMFD sp!, {r4,lr}
  133. MOV r1, r0
  134. MOV r4, #0
  135. MOV r0, #8
  136. SWI OS_File + XOS_Bit
  137. MOVVC r0, #0
  138. LDMFD sp!, {r4,pc}^
  139. ; os_error *SWI_OS_File_18(char *filename, int filetype);
  140. STARTCODE SWI_OS_File_18
  141. STMFD sp!, {r4-r5,lr}
  142. MOV r2, r1
  143. MOV r1, r0
  144. MOV r0, #18
  145. SWI OS_File + XOS_Bit
  146. MOVVC r0, #0
  147. LDMFD sp!, {r4-r5,pc}^
  148. ; os_error *SWI_OS_CLI(char *cmd);
  149. STARTCODE SWI_OS_CLI
  150. MOV ip, lr
  151. SWI OS_CLI + XOS_Bit
  152. MOVVC r0, #0
  153. MOVS pc, ip
  154. ; int SWI_OS_ReadC(void);
  155. STARTCODE SWI_OS_ReadC
  156. MOV ip, lr
  157. SWI OS_ReadC + XOS_Bit
  158. MOVS pc, ip
  159. ; os_error *SWI_OS_ReadVarVal(char *var, char *buf, int len, int *bytesused);
  160. STARTCODE SWI_OS_ReadVarVal
  161. STMFD sp!, {r4,lr}
  162. MOV ip, r3
  163. MOV r3, #0
  164. MOV r4, #0
  165. SWI OS_ReadVarVal + XOS_Bit
  166. LDMVSFD sp!, {r4,pc}^
  167. TEQ ip, #0
  168. STRNE r2, [ip]
  169. MOV r0, #0
  170. LDMFD sp!, {r4,pc}^
  171. ; os_error *SWI_OS_FSControl_54(char *buffer, int dir, char *fsname, int *size);
  172. STARTCODE SWI_OS_FSControl_54
  173. STMFD sp!, {r3-r6,lr}
  174. LDR r5, [r3]
  175. MOV r3, r2
  176. MOV r2, r1
  177. MOV r1, r0
  178. MOV r0, #54
  179. SWI OS_FSControl + XOS_Bit
  180. LDMVSFD sp!, {r3-r6,pc}^
  181. MOV r0, #0
  182. LDMFD sp!, {r3}
  183. STR r5, [r3]
  184. LDMFD sp!, {r4-r6,pc}^
  185. ; os_error *SWI_OS_FSControl_37(char *pathname, char *buffer, int *size);
  186. STARTCODE SWI_OS_FSControl_37
  187. STMFD sp!, {r2,r3-r5,lr}
  188. LDR r5, [r2]
  189. MOV r3, #0
  190. MOV r4, #0
  191. MOV r2, r1
  192. MOV r1, r0
  193. MOV r0, #37
  194. SWI OS_FSControl + XOS_Bit
  195. LDMVSFD sp!, {r2,r3-r5,pc}^
  196. MOV r0, #0
  197. LDMFD sp!, {r2}
  198. STR r5, [r2]
  199. LDMFD sp!, {r3-r5,pc}^
  200. ; os_error *SWI_DDEUtils_Prefix(char *dir);
  201. STARTCODE SWI_DDEUtils_Prefix
  202. MOV ip, lr
  203. SWI DDEUtils_Prefix + XOS_Bit
  204. MOVVC r0, #0
  205. MOVS pc, ip
  206. ; int SWI_Read_Timezone(void);
  207. STARTCODE SWI_Read_Timezone
  208. MOV ip, lr
  209. SWI Territory_ReadCurrentTimeZone + XOS_Bit
  210. MOVVC r0, r1
  211. MOVVS r0, #0
  212. MOVS pc, ip
  213. END