Hi,
ok I am probably gonna get my butt kicked for this...but I don't know where to post this question, I figured C is closer to Assembly. And you guys must have done it, since I have to![]()
Code:.section .data .section .text .global _start stringVar: .asciz "Hello World0" copyString: .byte 12 _start: movl $stringVar, %esi movl $copyString, %edi movl $0,%ebx copyLoop: cmpl $12,%ebx je exit movb (%esi), %cl movb %cl, (%edi) incl %esi incl %edi incl %ebx jmp copyLoop exit: movl $1, %eax int $0x80
For some reason I keep getting a seg fault whenever I attempt to move the content of %cl to %edi
I am not sure why that is happening as I have allocated 12 bytes to copyString and edi points to the first element...
I would like any help
thanks!



LinkBack URL
About LinkBacks




