changed "spc" to "c_sp"

This commit is contained in:
Gorilla Sapiens
2025-06-04 06:37:59 +00:00
parent 3d118dc6e5
commit b6f42f9ab2
204 changed files with 913 additions and 909 deletions

View File

@@ -1121,7 +1121,7 @@ If BSS and/or the stack shouldn't stay at the end of the program,
some parts of the cc65 runtime lib need to be replaced/modified.
common/_heap.s defines the location of the heap and atari/crt0.s
defines the location of the stack by initializing spc.
defines the location of the stack by initializing c_sp.
<sect1>Upgrading from an older cc65 version<p>

View File

@@ -4788,17 +4788,17 @@ bit. Using
<tscreen><verb>
.if (.cpu .bitand CPU_ISET_65SC02)
lda (spc)
lda (c_sp)
.else
ldy #$00
lda (spc),y
lda (c_sp),y
.endif
</verb></tscreen>
it is possible to determine if the
<tscreen><verb>
lda (spc)
lda (c_sp)
</verb></tscreen>
instruction is supported, which is the case for the 65SC02, 65C02 and 65816

View File

@@ -131,7 +131,7 @@ All other parameters will be pushed to the C-stack from left to right.
The rightmost parameter will have the lowest address on the stack,
and multi-byte parameters will have their least significant byte at the lower address.
The <tt/spc/ pseudo-register is a zeropage pointer to the base of the C-stack.
The <tt/c_sp/ pseudo-register is a zeropage pointer to the base of the C-stack.
If the function is variadic, the <tt/Y/ register will contain the number of
bytes pushed to the stack for this function.
@@ -153,10 +153,10 @@ void cdecl foo(unsigned bar, unsigned char baz);
; Example code for accessing bar. The variable is in A/X after this code snippet:
;
ldy #2 ; Offset of high byte of bar
lda (spc),y ; High byte now in A
lda (c_sp),y ; High byte now in A
tax ; High byte now in X
dey ; Offset of low byte of bar
lda (spc),y ; Low byte now in A
lda (c_sp),y ; Low byte now in A
</verb></tscreen>
<sect1>Epilogue, after the function call<p>
@@ -175,12 +175,12 @@ used if the return type is 32-bit.
If the function has a void return type, the compiler will not depend on the result
of <tt>A/X/sreg</tt>, so these may be clobbered by the function.
The C-stack pointer <tt/spc/ must be restored by the function to its value before the
The C-stack pointer <tt/c_sp/ must be restored by the function to its value before the
function call prologue. It may pop all of its parameters from the C-stack
(e.g. using the <tt/runtime/ function <tt/popa/),
or it could adjust <tt/spc/ directly.
or it could adjust <tt/c_sp/ directly.
If the function is variadic, the <tt/Y/ register contains the number of bytes
pushed to the stack on entry, which may be added to <tt/spc/ to restore its
pushed to the stack on entry, which may be added to <tt/c_sp/ to restore its
original state.
The internal pseudo-register <tt/regbank/ must not be changed by the function.

View File

@@ -193,9 +193,9 @@ _init: LDX #$FF ; Initialize stack pointer to $01FF
; Set cc65 argument stack pointer
LDA #&lt;(__RAM_START__ + __RAM_SIZE__)
STA spc
STA c_sp
LDA #&gt;(__RAM_START__ + __RAM_SIZE__)
STA spc+1
STA c_sp+1
; ---------------------------------------------------------------------------
; Initialize memory storage

View File

@@ -209,7 +209,7 @@ Internally, the binary program file has a 12 byte header provided by the library
<item>1 byte <bf/CPU type/: <tt/0/ = 6502, <tt/1/ = 65C02
<item>1 byte <bf/spc address/: the zero page address of the C parameter stack pointer <tt/spc/ used by the paravirtualization functions
<item>1 byte <bf/c_sp address/: the zero page address of the C parameter stack pointer <tt/c_sp/ used by the paravirtualization functions
<item>1 word <bf/load address/: where to load the data from the file into memory (default: <tt/$0200/)