- Dec 9, 2000
- 16,528
- 4
- 0
I'm trying to start using arrays in assembly language. I have to look at a string, and look at each character in the string, and if it is capital, make it a lower case.
movl $0,%ecx
for: movl %ecx,%edi
cmpl length,%ecx
jge end
cmpb $65, string(,%edi,1)
jl next
cmpb $90, string(,%edi,1)
jg next
movb string(,%edi,1), %al
addb $32, %al
movb %al, string(,%edi,1)
addl $1, %ecx
jmp for
why doesn't that work?
			
			movl $0,%ecx
for: movl %ecx,%edi
cmpl length,%ecx
jge end
cmpb $65, string(,%edi,1)
jl next
cmpb $90, string(,%edi,1)
jg next
movb string(,%edi,1), %al
addb $32, %al
movb %al, string(,%edi,1)
addl $1, %ecx
jmp for
why doesn't that work?
 
				
		 
			 
 
		 
 
		 
 
		 
 
		 
 
		
 Facebook
Facebook Twitter
Twitter