NESDev and Strangulation Records messageboards
Forum Index | FAQ | New User | Login | Search

Previous ThreadView All ThreadsNext ThreadShow in Flat Mode*


SubjectRe: Assembler Features  
Posted byblargg
Posted on12/24/03 11:35 PM
From IP199.170.89.75  



In my assembler the code is broken into independent blocks which allows local labels and for the linker to dead-strip unused code. I had one style of anonymous labels, but have recently adopted a new style based on what I saw in some NES asm source. The similarities to C should be fairly obvious :)

#include "nes.h"  ; insert text of file

extern main ; accessible to other files
static nmi ; only visible in this file
static irq

block {
main:

: lda $2002
bpl - ; previous unnamed label

; ...

nmi:
irq: rti
}

block $FFFA { ; absolute placement
dc.w nmi
dc.w main
dc.w irq
}

The dead-stripping is feature is very useful as it allows common routines to be all in one file, in separate blocks, without having unnecessary ones linked in. When I had the assembler targeted for a PIC microcontroller with flash memory, I wrote a linker which only updated the flash memory with modified blocks. This sped up reprogramming and reduced the number of erase cycles.




-
Entire Thread
Subject  Posted byPosted On
*Assembler Features  ASMGuy12/24/03 7:07 PM
.*Re: Assembler Features  mcmartin12/27/03 02:02 AM
..*Re: Assembler Features  ASMGuy12/27/03 03:29 AM
...*Doing +; conditional instructions; I found the UNIF spec  tepples12/27/03 04:09 AM
....*Re: Doing +; conditional instructions; I found the UNIF spec  RoboNes12/27/03 11:05 AM
...*Re: Assembler Features  ASMGuy12/27/03 03:34 AM
..Re: Assembler Features  blargg12/24/03 11:35 PM
..*Re: Assembler Features  tepples12/25/03 02:24 AM
...*Re: Assembler Features  tepples12/25/03 02:25 AM
..*Re: Assembler Features  Memblers12/25/03 01:40 AM
.*Re: Assembler Features  Memblers12/24/03 8:48 PM
..*Re: Assembler Features  tepples12/24/03 10:37 PM
...*Re: Assembler Features  ASMGuy12/24/03 10:56 PM
....*Re: Assembler Features  RoboNes12/25/03 12:36 PM
....*Re: Assembler Features  Memblers12/25/03 01:33 AM
Jump to

Memblers' homepage             Contact Me

Forums powered by WWWThreads Demo