crt_6809: Fix argument and environ passing
authorTormod Volden <debian.tormod@gmail.com>
Sun, 19 Apr 2015 16:43:39 +0000 (18:43 +0200)
committerAlan Cox <alan@linux.intel.com>
Sun, 19 Apr 2015 17:45:43 +0000 (18:45 +0100)
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Library/libs/crt0_6809.s

index 8a34833..265e43c 100644 (file)
@@ -29,9 +29,10 @@ start2:
                ; we don't clear BSS since the kernel already did
 
                ; pass environ, argc and argv to main
-               ldx 4,s
+               ; pointers and data stuffed above stack by execve()
+               leax 4,s
                stx _environ
-               ldx 2,s
+               leax 2,s
                stx ___argv
                puls x                  ; argc
                ldy #_exit              ; return vector