Subject: Re: [stella] Re: Programming tricks guide From: Paul Slocum <paul-stella@xxxxxxxxxxxxxx> Date: Thu, 06 Feb 2003 10:42:33 -0600 |
How about using the BRK vector? I was listening to Joe Decuir's keynote speech from CGE2K1 this morning and he mentioned using the BRK to avoid using JSR all over the place. It would shave off 3 bytes of ROM!
============================================================== BRK SUBROUTINE TRICK Mark Lesser, Thomas Jentzch ==============================================================
brk .byte $0e ; id-byte lda $e3 ; <- here we will continue ora #$04
BrkRoutine: plp ; remove flags from stack (not needed) tsx ; load x with stackpointer inx ; x++ dec $00,x ; adjust return address lda ($00,x) ; read break-id... tay ; ...and store in y Subroutine: [subroutine code...] rts
ldy #value jsr Subroutine
---------------------------------------------------------------------------------------------- Archives (includes files) at http://www.biglist.com/lists/stella/archives/ Unsub & more at http://www.biglist.com/lists/stella/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[stella] Re: Programming tricks gui, Dennis Debro | Thread | [stella] Combat AI, Zach Matley |
[stella] Re: Programming tricks gui, Dennis Debro | Date | Re: [stella] Programming tricks gui, Dennis Debro |
Month |