有 ~我改完了~一直忘了貼上來~qq~
語法:
INCLUDE Irvine32.inc
.data
prompt BYTE "Enter your name: ",0Dh,0Ah,0 ;定義對話串
MAX = 80 ;max chars to read
stringIn BYTE MAX+1 DUP (?) ;room for null
.code
main PROC
mov edx, OFFSET prompt ;顯示對話
call WriteString ;印出edx裡面的字串
call crlf ;空一行
mov edx, OFFSET stringIn
mov ecx, MAX ;buffer size - 1
call ReadString
mov ecx, 0
mov esi, 0
mov ecx, LENGTHOF stringIn
mov esi, OFFSET stringIn
L1:
mov al, byte ptr[esi]
;判斷是不是小寫
BT eax, 5
jc L2 ;如果是小寫就跳到L2
jmp L3 ;如果不是就跳到L3
L2:
AND byte ptr[esi], 11011111b ;小->大
inc esi
jmp L1
L3:
OR byte ptr[esi], 00100000b ;大->小
inc esi
next:
loop L1
call Writestring
call Crlf ;空一行
exit
main ENDP
END main