设为首页收藏本站淘宝杂货铺

从F到0 - From F to 0

 找回密码
 注册已关闭
搜索
查看: 4058|回复: 8
收起左侧

MASM整数型/小数型/逻辑型/子程序指针/文本型/字节集数组的(倒序/翻转/反转/颠倒)处理

[复制链接]
发表于 2020-4-6 08:28:38 | 显示全部楼层 |阅读模式
本帖最后由 EAX 于 2020-4-6 08:28 编辑


1.png
* 数组:5{5,4,3,2,1}
* 数组:5{5.000000,4.000000,3.000000,2.000000,1.000000}
* 数组:5{假,真,假,真,真}
* 数组:5{(子程序地址:2296400),(子程序地址:2296419),(子程序地址:2296438),(子程序地址:2296457),(子程序地址:2296476)}
* 数组:5{(子程序地址:2296476),(子程序地址:2296457),(子程序地址:2296438),(子程序地址:2296419),(子程序地址:2296400)}
* 数组:5{“文本5”,“文本4”,“文本3”,“文本2”,“文本1”}
* 数组:5{字节集:1{0},字节集:2{0,0},字节集:3{0,0,0},字节集:4{0,0,0,0},字节集:5{0,0,0,0,0}}
* 数组:5{字节集:5{0,0,0,0,0},字节集:4{0,0,0,0},字节集:3{0,0,0},字节集:2{0,0},字节集:1{0}}


  1. .版本 2
  2. .支持库 spec

  3. .程序集 程序集1

  4. .子程序 _启动子程序, 整数型


  5. _临时子程序 ()
  6. 返回 (0)

  7. .子程序 _临时子程序
  8. .局部变量 数组A, 整数型, , "0"
  9. .局部变量 数组B, 小数型, , "0"
  10. .局部变量 数组C, 逻辑型, , "0"
  11. .局部变量 数组D, 子程序指针, , "0"
  12. .局部变量 数组E, 文本型, , "0"
  13. .局部变量 数组F, 字节集, , "5"
  14. .局部变量 计数, 整数型


  15. 数组A = { 1, 2, 3, 4, 5 }
  16. 整数型数组_倒序 (数组A)
  17. 调试输出 (数组A)
  18. 数组B = { 1, 2, 3, 4, 5 }
  19. 小数型数组_倒序 (数组B)
  20. 调试输出 (数组B)
  21. 数组C = { 真, 真, 假, 真, 假 }
  22. 逻辑型数组_倒序 (数组C)
  23. 调试输出 (数组C)
  24. 数组D = { &A, &B, &C, &D, &E }
  25. 调试输出 (数组D)
  26. 子程序指针数组_倒序 (数组D)
  27. 调试输出 (数组D)

  28. 数组E = { “文本1”, “文本2”, “文本3”, “文本4”, “文本5” }
  29. 文本型数组_倒序 (数组E)
  30. 调试输出 (数组E)
  31. .计次循环首 (5, 计数)
  32.     数组F [计数] = 取空白字节集 (计数)
  33. .计次循环尾 ()
  34. 调试输出 (数组F)
  35. 字节集数组_倒序 (数组F)
  36. 调试输出 (数组F)


  37. .子程序 整数型数组_倒序, , 公开
  38. .参数 数组变量, 整数型, 参考 数组

  39. 置入代码 ({ 80, 83, 81, 82, 86, 87, 139, 69, 8, 11, 192, 117, 2, 235, 47, 139, 0, 11, 192, 117, 2, 235, 39, 139, 120, 4, 11, 192, 117, 2, 235, 30, 131, 192, 8, 139, 215, 209, 234, 51, 246, 79, 235, 14, 139, 28, 176, 139, 12, 184, 137, 12, 176, 137, 28, 184, 79, 70, 59, 242, 114, 238, 95, 94, 90, 89, 91, 88 })
  40. ' push eax
  41. ' push ebx
  42. ' push ecx
  43. ' push edx
  44. ' push esi
  45. ' push edi
  46. ' mov eax,[ebp+8]
  47. ' .if !eax
  48. ' jmp ASM_END
  49. ' .endif
  50. ' mov eax,[eax]
  51. ' .if !eax
  52. ' jmp ASM_END
  53. ' .endif
  54. ' mov edi,[eax+4]
  55. ' .if !eax
  56. ' jmp ASM_END
  57. ' .endif
  58. ' add eax,8
  59. ' mov edx,edi
  60. ' shr edx,1
  61. ' xor esi,esi
  62. ' dec edi
  63. ' .while esi < edx
  64. ' mov ebx,[eax+esi*4]
  65. ' mov ecx,[eax+edi*4]
  66. ' mov [eax+esi*4],ecx
  67. ' mov [eax+edi*4],ebx
  68. ' dec edi
  69. ' inc esi
  70. ' .endw
  71. ' ASM_END:
  72. ' pop edi
  73. ' pop esi
  74. ' pop edx
  75. ' pop ecx
  76. ' pop ebx
  77. ' pop eax


  78. .子程序 小数型数组_倒序, , 公开
  79. .参数 数组变量, 小数型, 参考 数组

  80. 置入代码 ({ 80, 83, 81, 82, 86, 87, 139, 69, 8, 11, 192, 117, 2, 235, 47, 139, 0, 11, 192, 117, 2, 235, 39, 139, 120, 4, 11, 192, 117, 2, 235, 30, 131, 192, 8, 139, 215, 209, 234, 51, 246, 79, 235, 14, 139, 28, 176, 139, 12, 184, 137, 12, 176, 137, 28, 184, 79, 70, 59, 242, 114, 238, 95, 94, 90, 89, 91, 88 })
  81. ' push eax
  82. ' push ebx
  83. ' push ecx
  84. ' push edx
  85. ' push esi
  86. ' push edi
  87. ' mov eax,[ebp+8]
  88. ' .if !eax
  89. ' jmp ASM_END
  90. ' .endif
  91. ' mov eax,[eax]
  92. ' .if !eax
  93. ' jmp ASM_END
  94. ' .endif
  95. ' mov edi,[eax+4]
  96. ' .if !eax
  97. ' jmp ASM_END
  98. ' .endif
  99. ' add eax,8
  100. ' mov edx,edi
  101. ' shr edx,1
  102. ' xor esi,esi
  103. ' dec edi
  104. ' .while esi < edx
  105. ' mov ebx,[eax+esi*4]
  106. ' mov ecx,[eax+edi*4]
  107. ' mov [eax+esi*4],ecx
  108. ' mov [eax+edi*4],ebx
  109. ' dec edi
  110. ' inc esi
  111. ' .endw
  112. ' ASM_END:
  113. ' pop edi
  114. ' pop esi
  115. ' pop edx
  116. ' pop ecx
  117. ' pop ebx
  118. ' pop eax


  119. .子程序 逻辑型数组_倒序, , 公开
  120. .参数 数组变量, 逻辑型, 参考 数组

  121. 置入代码 ({ 80, 83, 81, 82, 86, 87, 139, 69, 8, 11, 192, 117, 2, 235, 47, 139, 0, 11, 192, 117, 2, 235, 39, 139, 120, 4, 11, 192, 117, 2, 235, 30, 131, 192, 8, 139, 215, 209, 234, 51, 246, 79, 235, 14, 139, 28, 176, 139, 12, 184, 137, 12, 176, 137, 28, 184, 79, 70, 59, 242, 114, 238, 95, 94, 90, 89, 91, 88 })
  122. ' push eax
  123. ' push ebx
  124. ' push ecx
  125. ' push edx
  126. ' push esi
  127. ' push edi
  128. ' mov eax,[ebp+8]
  129. ' .if !eax
  130. ' jmp ASM_END
  131. ' .endif
  132. ' mov eax,[eax]
  133. ' .if !eax
  134. ' jmp ASM_END
  135. ' .endif
  136. ' mov edi,[eax+4]
  137. ' .if !eax
  138. ' jmp ASM_END
  139. ' .endif
  140. ' add eax,8
  141. ' mov edx,edi
  142. ' shr edx,1
  143. ' xor esi,esi
  144. ' dec edi
  145. ' .while esi < edx
  146. ' mov ebx,[eax+esi*4]
  147. ' mov ecx,[eax+edi*4]
  148. ' mov [eax+esi*4],ecx
  149. ' mov [eax+edi*4],ebx
  150. ' dec edi
  151. ' inc esi
  152. ' .endw
  153. ' ASM_END:
  154. ' pop edi
  155. ' pop esi
  156. ' pop edx
  157. ' pop ecx
  158. ' pop ebx
  159. ' pop eax


  160. .子程序 子程序指针数组_倒序, , 公开
  161. .参数 数组变量, 子程序指针, 参考 数组

  162. 置入代码 ({ 80, 83, 81, 82, 86, 87, 139, 69, 8, 11, 192, 117, 2, 235, 47, 139, 0, 11, 192, 117, 2, 235, 39, 139, 120, 4, 11, 192, 117, 2, 235, 30, 131, 192, 8, 139, 215, 209, 234, 51, 246, 79, 235, 14, 139, 28, 176, 139, 12, 184, 137, 12, 176, 137, 28, 184, 79, 70, 59, 242, 114, 238, 95, 94, 90, 89, 91, 88 })
  163. ' push eax
  164. ' push ebx
  165. ' push ecx
  166. ' push edx
  167. ' push esi
  168. ' push edi
  169. ' mov eax,[ebp+8]
  170. ' .if !eax
  171. ' jmp ASM_END
  172. ' .endif
  173. ' mov eax,[eax]
  174. ' .if !eax
  175. ' jmp ASM_END
  176. ' .endif
  177. ' mov edi,[eax+4]
  178. ' .if !eax
  179. ' jmp ASM_END
  180. ' .endif
  181. ' add eax,8
  182. ' mov edx,edi
  183. ' shr edx,1
  184. ' xor esi,esi
  185. ' dec edi
  186. ' .while esi < edx
  187. ' mov ebx,[eax+esi*4]
  188. ' mov ecx,[eax+edi*4]
  189. ' mov [eax+esi*4],ecx
  190. ' mov [eax+edi*4],ebx
  191. ' dec edi
  192. ' inc esi
  193. ' .endw
  194. ' ASM_END:
  195. ' pop edi
  196. ' pop esi
  197. ' pop edx
  198. ' pop ecx
  199. ' pop ebx
  200. ' pop eax


  201. .子程序 文本型数组_倒序, , 公开
  202. .参数 数组变量, 文本型, 参考 数组

  203. 置入代码 ({ 80, 83, 81, 82, 86, 87, 139, 69, 8, 11, 192, 117, 2, 235, 47, 139, 0, 11, 192, 117, 2, 235, 39, 139, 120, 4, 11, 192, 117, 2, 235, 30, 131, 192, 8, 139, 215, 209, 234, 51, 246, 79, 235, 14, 139, 28, 176, 139, 12, 184, 137, 12, 176, 137, 28, 184, 79, 70, 59, 242, 114, 238, 95, 94, 90, 89, 91, 88 })
  204. ' push eax
  205. ' push ebx
  206. ' push ecx
  207. ' push edx
  208. ' push esi
  209. ' push edi
  210. ' mov eax,[ebp+8]
  211. ' .if !eax
  212. ' jmp ASM_END
  213. ' .endif
  214. ' mov eax,[eax]
  215. ' .if !eax
  216. ' jmp ASM_END
  217. ' .endif
  218. ' mov edi,[eax+4]
  219. ' .if !eax
  220. ' jmp ASM_END
  221. ' .endif
  222. ' add eax,8
  223. ' mov edx,edi
  224. ' shr edx,1
  225. ' xor esi,esi
  226. ' dec edi
  227. ' .while esi < edx
  228. ' mov ebx,[eax+esi*4]
  229. ' mov ecx,[eax+edi*4]
  230. ' mov [eax+esi*4],ecx
  231. ' mov [eax+edi*4],ebx
  232. ' dec edi
  233. ' inc esi
  234. ' .endw
  235. ' ASM_END:
  236. ' pop edi
  237. ' pop esi
  238. ' pop edx
  239. ' pop ecx
  240. ' pop ebx
  241. ' pop eax


  242. .子程序 字节集数组_倒序, , 公开
  243. .参数 数组变量, 字节集, 参考 数组

  244. 置入代码 ({ 80, 83, 81, 82, 86, 87, 139, 69, 8, 11, 192, 117, 2, 235, 47, 139, 0, 11, 192, 117, 2, 235, 39, 139, 120, 4, 11, 192, 117, 2, 235, 30, 131, 192, 8, 139, 215, 209, 234, 51, 246, 79, 235, 14, 139, 28, 176, 139, 12, 184, 137, 12, 176, 137, 28, 184, 79, 70, 59, 242, 114, 238, 95, 94, 90, 89, 91, 88 })
  245. ' push eax
  246. ' push ebx
  247. ' push ecx
  248. ' push edx
  249. ' push esi
  250. ' push edi
  251. ' mov eax,[ebp+8]
  252. ' .if !eax
  253. ' jmp ASM_END
  254. ' .endif
  255. ' mov eax,[eax]
  256. ' .if !eax
  257. ' jmp ASM_END
  258. ' .endif
  259. ' mov edi,[eax+4]
  260. ' .if !eax
  261. ' jmp ASM_END
  262. ' .endif
  263. ' add eax,8
  264. ' mov edx,edi
  265. ' shr edx,1
  266. ' xor esi,esi
  267. ' dec edi
  268. ' .while esi < edx
  269. ' mov ebx,[eax+esi*4]
  270. ' mov ecx,[eax+edi*4]
  271. ' mov [eax+esi*4],ecx
  272. ' mov [eax+edi*4],ebx
  273. ' dec edi
  274. ' inc esi
  275. ' .endw
  276. ' ASM_END:
  277. ' pop edi
  278. ' pop esi
  279. ' pop edx
  280. ' pop ecx
  281. ' pop ebx
  282. ' pop eax


  283. .子程序 A



  284. .子程序 B



  285. .子程序 C



  286. .子程序 D



  287. .子程序 E


复制代码

相关帖子

发表于 2020-4-9 15:48:27 | 显示全部楼层
开开心心 发表于 2020-4-8 16:02
搞什么鬼回复可见

我那知道,前几个都没隐藏
您需要登录后才可以回帖 登录 | 注册已关闭

本版积分规则

QQ|手机版|Archiver|从F到0 ( 蒙ICP备17002595号-1 )
蒙公网安备15010402000325号

腾讯云安全认证

GMT+8, 2024-4-26 21:06 , Processed in 0.764044 second(s), 22 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表