Re: [cc65] simple assembly interrupt handler

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2006-01-03 21:10:51
On Tue, Jan 03, 2006 at 10:49:47AM -0600, PH wrote:
> Which means that he started the vectors at $fff6 instead of $fffa (I
> think).  I can't find any documents anywhere that say $fff6-$fffa is
> used as interrupt vectors.  So, I assume this is a mistake?  (I hope
> groepaz is listening and can enlighten me)

Just look at the source. From libsrc/nes/crt0.s:
---------------------------------------------------------------------------
.segment "VECTORS"

        .word   irq2        ; $fff4 ?
        .word   irq1        ; $fff6 ?
        .word   timerirq    ; $fff8 ?
        .word   nmi         ; $fffa vblank nmi
        .word   start       ; $fffc reset
        .word   irq         ; $fffe irq / brk
---------------------------------------------------------------------------

Not only there are questionmarks after the vectors, all of the labels do also
point to an "rti" instruction.

> Also, when I try running the linker on the code, it says:
>
> ld65.exe: Warning: Memory area overflow in `ROMV', segment `VECTORS' (6
> bytes)
> ld65.exe: Error: Cannot generate output due to memory area overflow
>
> I'm using your code as your wrote it.  Any ideas why it is complaining
> about an overflow?

You are probably linking against the nes.o and nes.lib files that come with
cc65. The startup file does already contain vector definitions, so the linker
will try to pack both into the memory area - and fails.

Since you were talking about example code from somewhere, I didn't assume that
you are using the cc65 NES library. If you use it, some or all functionality
is already in place. You may want to have a look at the library sources.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Tue Jan 3 21:11:04 2006

This archive was generated by hypermail 2.1.8 : 2006-01-03 21:11:07 CET