From 2f3cae0d2e32b29bf7064a4d63ffd3609434d934 Mon Sep 17 00:00:00 2001 From: bbbradsmith Date: Tue, 28 May 2019 15:29:55 -0400 Subject: [PATCH] movable sp for sim65 --- cfg/sim6502.cfg | 2 +- cfg/sim65c02.cfg | 2 +- doc/sim65.sgml | 7 ++++--- libsrc/sim6502/exehdr.s | 5 ++++- src/common/version.c | 2 +- src/sim65/main.c | 17 +++++++++++++---- src/sim65/paravirt.c | 14 ++++++++------ src/sim65/paravirt.h | 2 +- 8 files changed, 33 insertions(+), 18 deletions(-) diff --git a/cfg/sim6502.cfg b/cfg/sim6502.cfg index 530787489..546671641 100644 --- a/cfg/sim6502.cfg +++ b/cfg/sim6502.cfg @@ -4,7 +4,7 @@ SYMBOLS { } MEMORY { ZP: file = "", start = $0000, size = $001B; - HEADER: file = %O, start = $0000, size = $0001; + HEADER: file = %O, start = $0000, size = $0002; MAIN: file = %O, define = yes, start = $0200, size = $FDF0 - __STACKSIZE__; } SEGMENTS { diff --git a/cfg/sim65c02.cfg b/cfg/sim65c02.cfg index 530787489..546671641 100644 --- a/cfg/sim65c02.cfg +++ b/cfg/sim65c02.cfg @@ -4,7 +4,7 @@ SYMBOLS { } MEMORY { ZP: file = "", start = $0000, size = $001B; - HEADER: file = %O, start = $0000, size = $0001; + HEADER: file = %O, start = $0000, size = $0002; MAIN: file = %O, define = yes, start = $0200, size = $FDF0 - __STACKSIZE__; } SEGMENTS { diff --git a/doc/sim65.sgml b/doc/sim65.sgml index ff66079a1..6f197f518 100644 --- a/doc/sim65.sgml +++ b/doc/sim65.sgml @@ -144,8 +144,9 @@ Without using the provided target library, there are some relevant internal deta -The binary input file has a 1 byte header. A value of 0 indicates 6502 simulation, -and 1 indicates 65C02. +The binary input file has a 2 byte header. The first byte indicates CPU type: + 0 = 6502, 1 = 65C02. The second byte is the address of the C parameter stack pointer + The rest of the input file, after the header, will be loaded at The built-in functions are provided by 6 paravirtualization hooks present at