easy asm program(nasm)

Posted by GLeBaTi on Stack Overflow See other posts from Stack Overflow or by GLeBaTi
Published on 2010-05-08T16:41:41Z Indexed on 2010/05/08 16:48 UTC
Read the original article Hit count: 264

Filed under:
|
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

this code perform poorly. I think that problem in "jnb upper". This program make small symbols into big symbols.

© Stack Overflow or respective owner

Related posts about nasm

Related posts about assembly