rules.i 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. # Rules for optimizing BCC assembler output
  2. # Rules for inlining C library functions
  3. push word %[#|*]0%1
  4. call __htons
  5. inc sp
  6. inc sp
  7. =
  8. mov ax,#((%1 & $00FF) << 8) + ((%1 & $FF00) >> 8)
  9. mov ax,%[#|*]0%1
  10. push ax
  11. call __htons
  12. inc sp
  13. inc sp
  14. =
  15. mov ax,#((%1 & $00FF) << 8) + ((%1 & $FF00) >> 8)
  16. push %0[%1]
  17. call __htons
  18. inc sp
  19. inc sp
  20. =
  21. mov ax,%0[%1]
  22. xchg al,ah
  23. push ax
  24. call __htons
  25. inc sp
  26. inc sp
  27. =
  28. xchg al,ah
  29. push %[bx|cx|dx]1
  30. call __htons
  31. inc sp
  32. inc sp
  33. =
  34. mov ax,%1
  35. xchg al,ah
  36. call ___get_ds
  37. =
  38. mov ax,ds
  39. call ___get_es
  40. =
  41. mov ax,es
  42. call ___get_cs
  43. =
  44. mov ax,cs
  45. push word %[#|*]0%1
  46. call ___set_es
  47. inc sp
  48. inc sp
  49. =
  50. mov ax,%0%1
  51. mov es,ax
  52. mov ax,%[#|*]0%1
  53. push ax
  54. call ___set_es
  55. inc sp
  56. inc sp
  57. =
  58. mov ax,%0%1
  59. mov es,ax
  60. push %0[%1]
  61. call ___set_es
  62. inc sp
  63. inc sp
  64. =
  65. mov ax,%0[%1]
  66. mov es,ax
  67. push %[ax|bx|cx|dx]1
  68. call ___set_es
  69. inc sp
  70. inc sp
  71. =
  72. mov es,%1
  73. push word %[#|*]0%1
  74. call ___deek_es
  75. inc sp
  76. inc sp
  77. =
  78. seg es
  79. mov ax,[%1]
  80. mov ax,%[#|*]0%1
  81. push ax
  82. call ___deek_es
  83. inc sp
  84. inc sp
  85. =
  86. seg es
  87. mov ax,[%1]
  88. push %0[%1]
  89. call ___deek_es
  90. inc sp
  91. inc sp
  92. =
  93. mov bx,%0[%1]
  94. seg es
  95. mov ax,[bx]
  96. push bx
  97. call ___deek_es
  98. inc sp
  99. inc sp
  100. =
  101. seg es
  102. mov ax,[bx]
  103. push %[ax|cx|dx]1
  104. call ___deek_es
  105. inc sp
  106. inc sp
  107. =
  108. mov bx,%1
  109. seg es
  110. mov ax,[bx]
  111. push word %[#|*]0%1
  112. call ___peek_es
  113. inc sp
  114. inc sp
  115. =
  116. seg es
  117. mov al,[%1]
  118. xor ah,ah
  119. mov ax,%[#|*]0%1
  120. push ax
  121. call ___peek_es
  122. inc sp
  123. inc sp
  124. =
  125. seg es
  126. mov al,[%1]
  127. xor ah,ah
  128. push %0[%1]
  129. call ___peek_es
  130. inc sp
  131. inc sp
  132. =
  133. mov bx,%0[%1]
  134. seg es
  135. mov al,[bx]
  136. xor ah,ah
  137. push bx
  138. call ___peek_es
  139. inc sp
  140. inc sp
  141. =
  142. seg es
  143. mov al,[bx]
  144. xor ah,ah
  145. push %[ax|cx|dx]1
  146. call ___peek_es
  147. inc sp
  148. inc sp
  149. =
  150. mov bx,%1
  151. seg es
  152. mov al,[bx]
  153. xor ah,ah
  154. push word %[#|*]0%1
  155. call ___poke_es
  156. add sp,*4
  157. =
  158. pop ax
  159. seg es
  160. mov [%1],al
  161. mov ax,%[#|*]0%1
  162. push ax
  163. call ___poke_es
  164. add sp,*4
  165. =
  166. pop ax
  167. seg es
  168. mov [%1],al
  169. pmov ax,%[#|*]0%1
  170. push ax
  171. call ___poke_es
  172. add sp,*4
  173. =
  174. seg es
  175. mov [%1],al
  176. push %0[%1]
  177. call ___poke_es
  178. add sp,*4
  179. =
  180. mov bx,%0[%1]
  181. pop ax
  182. seg es
  183. mov [bx],al
  184. push bx
  185. call ___poke_es
  186. add sp,*4
  187. =
  188. pop ax
  189. seg es
  190. mov [bx],al
  191. push %[ax|cx|dx]1
  192. call ___poke_es
  193. add sp,*4
  194. =
  195. mov bx,%1
  196. pop ax
  197. seg es
  198. mov [bx],al
  199. push word %[#|*]0%1
  200. call ___doke_es
  201. add sp,*4
  202. =
  203. pop ax
  204. seg es
  205. mov [%1],ax
  206. mov ax,%[#|*]0%1
  207. push ax
  208. call ___doke_es
  209. add sp,*4
  210. =
  211. pop ax
  212. seg es
  213. mov [%1],ax
  214. pmov ax,%[#|*]0%1
  215. push ax
  216. call ___doke_es
  217. add sp,*4
  218. =
  219. seg es
  220. mov [%1],ax
  221. push %0[%1]
  222. call ___doke_es
  223. add sp,*4
  224. =
  225. mov bx,%0[%1]
  226. pop ax
  227. seg es
  228. mov [bx],ax
  229. push bx
  230. call ___doke_es
  231. add sp,*4
  232. =
  233. pop ax
  234. seg es
  235. mov [bx],ax
  236. push %[ax|cx|dx]1
  237. call ___doke_es
  238. add sp,*4
  239. =
  240. mov bx,%1
  241. pop ax
  242. seg es
  243. mov [bx],ax
  244. push ax
  245. mov bx,%1
  246. pop ax
  247. =
  248. mov bx,%1
  249. push %1
  250. pop ax
  251. =
  252. mov ax,%1
  253. mov ax,ax
  254. =
  255. !mov ax,ax