I'm writing in AT&T syntax. This loop should check, if case is in range 61-7A ASCII (it means is this small letter) - if no, then convert it into space ' '.
change:
movb (%esi), %bh #move case temporary to bh register
cmp $0x61,%bh #compare 'a' ASCII and case from bh register
jge nothing #if ascii from bh is greater than 'a', jump to nothing
cmp $0x7A,%bh
jle nothing #same, if is in range 61-7A jump to nothing
movb $0x20,%bh #if wasn't in range, change to 20 ASCII (space)
nothing:
movb %bh, (%esi) #put case back into string
addl $1,%esi #move pointer to the next case
loop change
This is my loop. ESI is my pointer to string.
My problem is simple - this is not working, and I have no idea why.