org 0x100
SEGMENT .CODE
mov ah,0x9
mov dx, Msg1
int 0x21
;string input
mov ah,0xA
mov dx,buff
int 0x21
mov ax,0
mov al,[buff+1]; length
;string UPPERCASE
mov cl, al
mov si, buff
cld
loop1:
lodsb;
cmp al, 'a'
jnb upper
loop loop1
;output
mov ah,0x9
mov dx, buff
int 0x21
exit:
mov ah, 0x8
int 0x21
int 0x20
upper:
sub al,32
jmp loop1
SEGMENT .DATA
Msg1 db 'Press string: $'
buff db 254,0
此代碼不起作用。 我認爲問題出在jnb upper
。 這個程序應該把小寫字母變成大寫字母。asm程序不起作用(nasm)
你的問題是什麼?你只是簡單地描述一些代碼,並假設性能不佳。 – Oded 2010-05-08 16:46:41
我不知道爲什麼我的程序無法正常工作。 – GLeBaTi 2010-05-08 16:49:06
我想他想將小寫字母轉換爲大寫字母。 – nc3b 2010-05-08 16:50:15