返回列表 发帖
填坑,汇编递归版
  1. Include masm32rt.inc
  2. .const
  3. CrLf db 0DH,0AH,0
  4. .data?
  5. Input db 20 dup (?)
  6. .code
  7. recursion Proc Uses Ebx Eax Ecx lpStr:dword
  8. Mov Ebx,lpStr
  9. .If Byte Ptr [Ebx+1] != NULL
  10. Mov Al,Byte Ptr [Ebx]
  11. Xor Ecx,Ecx
  12. .Repeat
  13. XChg Al,[Ebx+Ecx]
  14. Mov Byte Ptr [Ebx],Al
  15. Inc Ebx
  16. Invoke recursion,Ebx
  17. Dec Ebx
  18. XChg Al,[Ebx+Ecx]
  19. Mov Byte Ptr [Ebx],Al
  20. Inc Ecx
  21. .Until Byte Ptr [Ebx+Ecx] == NULL
  22. .Else
  23. Invoke StdOut,Offset Input
  24. Invoke StdOut,Offset CrLf
  25. .EndIf
  26. Ret
  27. recursion Endp
  28. Start:
  29. Invoke ArgClC,1,Offset Input
  30. Invoke recursion,Offset Input
  31. Invoke ExitProcess,NULL
  32. End Start
  33. End
复制代码
2

评分人数

    • happy886rr: 快两年了,激动。技术 + 1
    • 523066680: 每个字母都懂,组合起来就……系列技术 + 1

TOP

返回列表