From 1c18c77f87cb32400a51ced7752607c3eea6f8f9 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Thu, 23 Nov 2017 22:22:42 +0000 Subject: [PATCH] 6502: correct crt0 The older compiler when we forced fastcall makes main() fastcall. The current compiler which we can now use without patches makes make() vararg for some odd reason. That means we need to leave argv on the stack. With this set the 65c816 userspace actually seems useable --- Library/libs/crt0_6502.s | 2 +- Library/libs/crt0nostdio_6502.s | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/libs/crt0_6502.s b/Library/libs/crt0_6502.s index a5f4e358..577c6809 100644 --- a/Library/libs/crt0_6502.s +++ b/Library/libs/crt0_6502.s @@ -88,7 +88,7 @@ start: inx l1: sta _environ stx _environ+1 - jsr popax ; Pull argv off the stack leaving argc +; jsr popax ; Pull argv off the stack leaving argc ldy #2 ; 2 bytes of args jsr _main diff --git a/Library/libs/crt0nostdio_6502.s b/Library/libs/crt0nostdio_6502.s index 9806f80f..9dd056bd 100644 --- a/Library/libs/crt0nostdio_6502.s +++ b/Library/libs/crt0nostdio_6502.s @@ -87,7 +87,7 @@ start: inx l1: sta _environ stx _environ+1 - jsr popax ; Pull argv off the stack leaving argc +; jsr popax ; Pull argv off the stack leaving argc ldy #2 ; 2 bytes of args jsr _main -- 2.34.1