![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Mar 2005
Posts: 2
Rep Power: 0
![]() |
Consider this bit of code which is part of a kinda itoa procedure, only the string is reversed:
#get a number from a parameter, this bit is identical to functional bits getting chars and strings movl (%esi), %eax addl $4, %esi #uses the %ecx-register for the string, adds a zero at the beginning for later reversal purposes movl $0, %ecx incl %ecx #the actual procedure loop: cmpl $0, (%eax) je done cdq #is this really necessary? doesn't seem to make any difference atm movl $10, %ebx # the divisor idivl %ebx addl $48, %edx movb (%edx), %bl movb %bl, (%ecx) incl %ecx jmp loop |
|
|
|
|
|
#2 |
|
Newbie
Join Date: Mar 2005
Posts: 2
Rep Power: 0
![]() |
I've found that (at least the first) reason for the segfault is this line:
movl (%esi), %ecx |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|