1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-26 05:29:30 +00:00

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:
cuz 2002-11-22 00:52:49 +00:00
parent 0cfca414a0
commit 4b8a20fee6
2 changed files with 16 additions and 22 deletions

View File

@ -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
; c128 banking. Do also create an empty segment named "NMI" to avoid
; warnings if the rs232 routines are not used.
.segment "NMI"
; empty
; c128 banking.
.segment "STARTUP"
; ------------------------------------------------------------------------
; BASIC header with a SYS call
.org $1BFF
@ -172,13 +167,12 @@ L2: lda zpsave,x
; 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
; 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
; the first module in the program, it will always be below $4000 and always
; in RAM. So we place several short stubs here that switch back our ROM
; config before calling our user defined handlers. These stubs are only
; 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,
; they have to go here.
; that parts of our program may not be accessible. To solve this, we place
; the following code into a special segment called "LOWCODE" which will be
; placed just above the startup code, so it goes into a RAM area that is
; not banked.
.segment "LOWCODE"
IRQStub:
cld ; Just to be sure
@ -192,7 +186,7 @@ IRQStub:
jsr condes ; Call the functions
pla ; Get old register value
sta MMU_CR
jmp IRQInd ; Jump to the save IRQ vector
jmp IRQInd ; Jump to the saved IRQ vector
BRKStub:

View File

@ -535,17 +535,17 @@ _rs232_status:
; 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
; 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.
.segment "NMI"
.segment "LOWCODE"
NmiHandler:
lda #CC65_MMU_CFG ;(2)
sta MMU_CR ;(4)
sta MMU_CR ;(4)
lda ACIA+RegStatus ;(4) ;status ;check for byte received
and #$08 ;(2)
beq @L9 ;(2*)
beq @L9 ;(2*)
lda ACIA+RegStatus ;(4) opt ;status ;check for receive errors
and #$07 ;(2) opt
beq @L1 ;(3*)opt
@ -553,7 +553,7 @@ NmiHandler:
@L1: lda ACIA+RegData ;(4) ;data ;get byte and put into receive buffer
ldy RecvTail ;(4)
ldx RecvFreeCnt ;(4)
beq @L3 ;(2*)
beq @L3 ;(2*)
sta RecvBuf,y ;(5)
inc RecvTail ;(6)
dec RecvFreeCnt ;(6)
@ -588,15 +588,15 @@ NmiHandler:
; Try to send a byte. Internal routine. A = TryHard
TryToSend:
sta tmp1 ; Remember tryHard flag
sta tmp1 ; Remember tryHard flag
@L0: lda SendFreeCnt
cmp #$ff
beq @L3 ; Bail out
beq @L3 ; Bail out
; Check for flow stopped
@L1: lda Stopped
bne @L3 ; Bail out
bne @L3 ; Bail out
;** check that swiftlink is ready to send