Rename segment named NMI to LOWCODE
git-svn-id: svn://svn.cc65.org/cc65/trunk@1571 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -24,15 +24,10 @@ IRQInd = $2FD ; JMP $0000 - used as indirect IRQ vector
|
|||||||
|
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
; Place the startup code in a special segment to cope with the quirks of
|
; Place the startup code in a special segment to cope with the quirks of
|
||||||
; c128 banking. Do also create an empty segment named "NMI" to avoid
|
; c128 banking.
|
||||||
; warnings if the rs232 routines are not used.
|
|
||||||
|
|
||||||
.segment "NMI"
|
|
||||||
; empty
|
|
||||||
|
|
||||||
.segment "STARTUP"
|
.segment "STARTUP"
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
|
||||||
; BASIC header with a SYS call
|
; BASIC header with a SYS call
|
||||||
|
|
||||||
.org $1BFF
|
.org $1BFF
|
||||||
@@ -172,13 +167,12 @@ L2: lda zpsave,x
|
|||||||
; above will change this setting so that we have RAM from $0000-$BFFF. This
|
; above will change this setting so that we have RAM from $0000-$BFFF. This
|
||||||
; works quite well with the exception of interrupts: The interrupt handler
|
; works quite well with the exception of interrupts: The interrupt handler
|
||||||
; is in ROM, and the ROM switches back to the ROM configuration, which means
|
; is in ROM, and the ROM switches back to the ROM configuration, which means
|
||||||
; that parts of our program may not be accessible. Since the crt0 module is
|
; that parts of our program may not be accessible. To solve this, we place
|
||||||
; the first module in the program, it will always be below $4000 and always
|
; the following code into a special segment called "LOWCODE" which will be
|
||||||
; in RAM. So we place several short stubs here that switch back our ROM
|
; placed just above the startup code, so it goes into a RAM area that is
|
||||||
; config before calling our user defined handlers. These stubs are only
|
; not banked.
|
||||||
; used if any other code uses the interrupt or break vectors. They are dead
|
|
||||||
; code otherwise, but since there is no other way to keep them in low memory,
|
.segment "LOWCODE"
|
||||||
; they have to go here.
|
|
||||||
|
|
||||||
IRQStub:
|
IRQStub:
|
||||||
cld ; Just to be sure
|
cld ; Just to be sure
|
||||||
@@ -192,7 +186,7 @@ IRQStub:
|
|||||||
jsr condes ; Call the functions
|
jsr condes ; Call the functions
|
||||||
pla ; Get old register value
|
pla ; Get old register value
|
||||||
sta MMU_CR
|
sta MMU_CR
|
||||||
jmp IRQInd ; Jump to the save IRQ vector
|
jmp IRQInd ; Jump to the saved IRQ vector
|
||||||
|
|
||||||
|
|
||||||
BRKStub:
|
BRKStub:
|
||||||
|
|||||||
@@ -535,10 +535,10 @@ _rs232_status:
|
|||||||
; Because of the C128 banking, the NMI handler must go into the non banked
|
; Because of the C128 banking, the NMI handler must go into the non banked
|
||||||
; memory, since the ROM NMI entry point will switch to a configuration where
|
; memory, since the ROM NMI entry point will switch to a configuration where
|
||||||
; only the lowest 16K of RAM are visible. We will place the NMI handler into
|
; only the lowest 16K of RAM are visible. We will place the NMI handler into
|
||||||
; it's own segment and map this segment into the lower 16K in the linker
|
; the LOWCODE segment and map this segment into the lower 16K in the linker
|
||||||
; config.
|
; config.
|
||||||
|
|
||||||
.segment "NMI"
|
.segment "LOWCODE"
|
||||||
|
|
||||||
NmiHandler:
|
NmiHandler:
|
||||||
lda #CC65_MMU_CFG ;(2)
|
lda #CC65_MMU_CFG ;(2)
|
||||||
|
|||||||
Reference in New Issue
Block a user