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

从F到0 - From F to 0

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

易语言MASM置入代码文本型数组,字节集数组的到大写与到小写/大小写字母转换(无返回值)

[复制链接]
发表于 2019-8-21 18:00:57 | 显示全部楼层 |阅读模式

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

  3. .程序集 程序集1

  4. .子程序 _启动子程序, 整数型, , 请在本子程序中放置易模块初始化代码


  5. _临时子程序 ()  ' 在初始化代码执行完毕后调用测试代码
  6. 返回 (0)  ' 可以根据您的需要返回任意数值

  7. .子程序 _临时子程序
  8. .局部变量 字节集数组, 字节集, , "5"
  9. .局部变量 文本型数组, 文本型, , "0"

  10. ' 本名称子程序用作测试程序用,仅在开发及调试环境中有效,编译发布程序前将被系统自动清空,请将所有用作测试的临时代码放在本子程序中。 ***注意不要修改本子程序的名称、参数及返回值类型。
  11. 字节集数组 [1] = 到字节集 (“Hello World!”)
  12. 字节集数组 [2] = 到字节集 (“abc123”)

  13. 字节集数组 [3] = 到字节集 (“中文测试”)
  14. 字节集数组 [5] = 到字节集 (“AbCdefghijklmnopqrstuvwxyz”)
  15. 字节集数组_到大写 (字节集数组)
  16. 调试输出 (到文本 (字节集数组 [1]))
  17. 调试输出 (到文本 (字节集数组 [2]))
  18. 调试输出 (到文本 (字节集数组 [3]))
  19. 调试输出 (到文本 (字节集数组 [4]))
  20. 调试输出 (到文本 (字节集数组 [5]))
  21. 字节集数组_到小写 (字节集数组)
  22. 调试输出 (到文本 (字节集数组 [1]))
  23. 调试输出 (到文本 (字节集数组 [2]))
  24. 调试输出 (到文本 (字节集数组 [3]))
  25. 调试输出 (到文本 (字节集数组 [4]))
  26. 调试输出 (到文本 (字节集数组 [5]))

  27. 文本型数组 = { “Hello World!”, “abc123”, “AbCdefghijklmnopqrstuvwxyz”, “”, “中文测试” }
  28. 调试输出 (文本型数组)
  29. 文本型数组_到大写 (文本型数组)
  30. 调试输出 (文本型数组)
  31. 文本型数组_到小写 (文本型数组)
  32. 调试输出 (文本型数组)



  33. .子程序 文本型数组_到大写, , 公开
  34. .参数 文本型数组, 文本型, 参考 数组

  35. 置入代码 ({ 96, 139, 69, 8, 11, 192, 117, 2, 235, 72, 139, 0, 11, 192, 117, 2, 235, 64, 139, 88, 4, 11, 219, 116, 8, 129, 251, 0, 0, 0, 128, 114, 2, 235, 47, 131, 192, 8, 51, 201, 235, 36, 139, 52, 136, 11, 246, 117, 2, 235, 26, 138, 22, 10, 210, 117, 2, 235, 18, 128, 250, 97, 114, 8, 128, 250, 122, 119, 3, 128, 234, 32, 136, 22, 70, 235, 230, 65, 59, 203, 114, 216, 97 })
  36. ' pushad
  37. ' mov eax,[ebp+8]
  38. ' .if !eax
  39. ' jmp ASM_END
  40. ' .endif
  41. ' mov eax,[eax]
  42. ' .if !eax
  43. ' jmp ASM_END
  44. ' .endif
  45. ' mov ebx,[eax+4]
  46. ' .if !ebx || ebx >= 80000000H
  47. ' jmp ASM_END
  48. ' .endif
  49. ' add eax,8
  50. ' xor ecx,ecx
  51. ' .while ecx < ebx
  52. ' mov esi,[eax+ecx*4]
  53. ' .if !esi
  54. ' jmp TEXT_LOOP_END
  55. ' .endif
  56. ' TEXT_LOOP:
  57. ' mov dl,[esi]
  58. ' .if !dl
  59. ' jmp TEXT_LOOP_END
  60. ' .endif
  61. ' .if dl >= 97 && dl <=122
  62. ' sub dl,32
  63. ' .endif
  64. ' mov [esi],dl
  65. ' inc esi
  66. ' JMP TEXT_LOOP
  67. ' TEXT_LOOP_END:
  68. ' inc ecx
  69. ' .endw
  70. ' ASM_END:
  71. ' popad


  72. .子程序 文本型数组_到小写, , 公开
  73. .参数 文本型数组, 文本型, 参考 数组

  74. 置入代码 ({ 96, 139, 69, 8, 11, 192, 117, 2, 235, 72, 139, 0, 11, 192, 117, 2, 235, 64, 139, 88, 4, 11, 219, 116, 8, 129, 251, 0, 0, 0, 128, 114, 2, 235, 47, 131, 192, 8, 51, 201, 235, 36, 139, 52, 136, 11, 246, 117, 2, 235, 26, 138, 22, 10, 210, 117, 2, 235, 18, 128, 250, 65, 114, 8, 128, 250, 90, 119, 3, 128, 194, 32, 136, 22, 70, 235, 230, 65, 59, 203, 114, 216, 97 })
  75. ' pushad
  76. ' mov eax,[ebp+8]
  77. ' .if !eax
  78. ' jmp ASM_END
  79. ' .endif
  80. ' mov eax,[eax]
  81. ' .if !eax
  82. ' jmp ASM_END
  83. ' .endif
  84. ' mov ebx,[eax+4]
  85. ' .if !ebx || ebx >= 80000000H
  86. ' jmp ASM_END
  87. ' .endif
  88. ' add eax,8
  89. ' xor ecx,ecx
  90. ' .while ecx < ebx
  91. ' mov esi,[eax+ecx*4]
  92. ' .if !esi
  93. ' jmp TEXT_LOOP_END
  94. ' .endif
  95. ' TEXT_LOOP:
  96. ' mov dl,[esi]
  97. ' .if !dl
  98. ' jmp TEXT_LOOP_END
  99. ' .endif
  100. ' .if dl >=65 && dl<=90
  101. ' add dl,32
  102. ' .endif
  103. ' mov [esi],dl
  104. ' inc esi
  105. ' JMP TEXT_LOOP
  106. ' TEXT_LOOP_END:
  107. ' inc ecx
  108. ' .endw
  109. ' ASM_END:
  110. ' popad


  111. .子程序 字节集数组_到大写, , 公开
  112. .参数 字节集数组, 字节集, 参考 数组

  113. 置入代码 ({ 96, 139, 85, 8, 11, 210, 117, 2, 235, 80, 139, 18, 11, 210, 117, 2, 235, 72, 139, 90, 4, 11, 219, 116, 8, 129, 251, 0, 0, 0, 128, 114, 2, 235, 55, 131, 194, 8, 51, 201, 235, 44, 139, 4, 138, 11, 192, 116, 36, 96, 139, 88, 4, 131, 192, 8, 51, 201, 235, 20, 138, 20, 1, 128, 250, 97, 114, 8, 128, 250, 122, 119, 3, 128, 234, 32, 136, 20, 1, 65, 59, 203, 114, 232, 97, 65, 59, 203, 114, 208, 97 })
  114. ' pushad
  115. ' mov edx,[ebp+8]
  116. ' .if !edx
  117. ' jmp  ASM_END
  118. ' .endif
  119. ' mov edx,[edx]
  120. ' .if !edx
  121. ' jmp  ASM_END
  122. ' .endif
  123. ' mov ebx,[edx+4]
  124. ' .if !ebx || ebx >= 80000000H
  125. ' jmp  ASM_END
  126. ' .endif
  127. ' add edx,8
  128. ' xor ecx,ecx
  129. ' .while ecx < ebx
  130. ' mov eax,[edx+ecx*4]
  131. ' .if eax
  132. ' pushad
  133. ' mov ebx,[eax+4]
  134. ' add eax,8
  135. ' xor ecx,ecx
  136. ' .while ecx < ebx
  137. ' mov dl,[eax+ecx]
  138. ' .if dl >= 97 && dl <=122
  139. ' sub dl,32
  140. ' .endif
  141. ' mov [eax+ecx],dl
  142. ' inc ecx
  143. ' .endw
  144. ' popad
  145. ' .endif
  146. ' inc ecx
  147. ' .endw
  148. ' ASM_END:
  149. ' popad


  150. .子程序 字节集数组_到小写, , 公开
  151. .参数 字节集数组, 字节集, 参考 数组

  152. 置入代码 ({ 96, 139, 85, 8, 11, 210, 117, 2, 235, 80, 139, 18, 11, 210, 117, 2, 235, 72, 139, 90, 4, 11, 219, 116, 8, 129, 251, 0, 0, 0, 128, 114, 2, 235, 55, 131, 194, 8, 51, 201, 235, 44, 139, 4, 138, 11, 192, 116, 36, 96, 139, 88, 4, 131, 192, 8, 51, 201, 235, 20, 138, 20, 1, 128, 250, 65, 114, 8, 128, 250, 90, 119, 3, 128, 194, 32, 136, 20, 1, 65, 59, 203, 114, 232, 97, 65, 59, 203, 114, 208, 97 })
  153. ' pushad
  154. ' mov edx,[ebp+8]
  155. ' .if !edx
  156. ' jmp  ASM_END
  157. ' .endif
  158. ' mov edx,[edx]
  159. ' .if !edx
  160. ' jmp  ASM_END
  161. ' .endif
  162. ' mov ebx,[edx+4]
  163. ' .if !ebx || ebx >= 80000000H
  164. ' jmp  ASM_END
  165. ' .endif
  166. ' add edx,8
  167. ' xor ecx,ecx
  168. ' .while ecx < ebx
  169. ' mov eax,[edx+ecx*4]
  170. ' .if eax
  171. ' pushad
  172. ' mov ebx,[eax+4]
  173. ' add eax,8
  174. ' xor ecx,ecx
  175. ' .while ecx < ebx
  176. ' mov dl,[eax+ecx]
  177. ' .if dl >=65 && dl<=90
  178. ' add dl,32
  179. ' .endif
  180. ' mov [eax+ecx],dl
  181. ' inc ecx
  182. ' .endw
  183. ' popad
  184. ' .endif
  185. ' inc ecx
  186. ' .endw
  187. ' ASM_END:
  188. ' popad

复制代码

相关帖子

您需要登录后才可以回帖 登录 | 注册已关闭

本版积分规则

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

腾讯云安全认证

GMT+8, 2024-4-16 17:18 , Processed in 0.491028 second(s), 20 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

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