【发布时间】:2014-03-30 06:30:44
【问题描述】:
由于我对汇编还很陌生,所以如果用户在汇编中输入大写字母或反之亦然,我应该如何从小写转换为大写,我有几个问题。这是我目前所拥有的:
section .data
Enter db "Enter: "
Enter_Len equ $-Enter
Output db "Output: "
Output_Len equ $-Output
Thanks db "Thanks!"
Thanks_Len equ $-Thanks
Loop_Iter dd 0 ; Loop counter
section .bss
In_Buffer resb 2
In_Buffer_Len equ $-In_Buffer
section .text
global _start
_start:
; Print Enter message
mov eax, 4 ; sys_write
mov ebx, 1
mov ecx, Enter
mov edx, Enter_Len
int 80h
; Read input
mov eax, 3 ; sys_read
mov ebx, 0
mov ecx, In_Buffer
mov edx, In_Buffer_Len
int 80h
所以基本上,如果我是正确的,我的 edx 包含输入的字符串。现在出现了从小写转换为大写和从大写转换为小写的困境。由于我对此完全陌生,因此根本不知道该怎么做。任何帮助将不胜感激:)
【问题讨论】:
-
请注意,我编辑了您的帖子以修复代码格式。下次请使用空格而不是制表符。
-
@JimMischel - 对不起那个兄弟,没有意识到它搞砸了,我很抱歉。并感谢您的编辑! :)