From: cuz Date: Fri, 22 Nov 2002 00:52:49 +0000 (+0000) Subject: Rename segment named NMI to LOWCODE X-Git-Tag: V2.12.0~2062 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4b8a20fee6a91ae686f8f70d9400dd0ec3d55fb8;p=cc65 Rename segment named NMI to LOWCODE git-svn-id: svn://svn.cc65.org/cc65/trunk@1571 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/libsrc/c128/crt0.s b/libsrc/c128/crt0.s index b7309c9c2..5a66cd753 100644 --- a/libsrc/c128/crt0.s +++ b/libsrc/c128/crt0.s @@ -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: diff --git a/libsrc/c128/rs232.s b/libsrc/c128/rs232.s index a2f3a5001..821890224 100644 --- a/libsrc/c128/rs232.s +++ b/libsrc/c128/rs232.s @@ -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