1. Purpose 1.1. History 2. Linker 3. Supported syntax 3.1. Mnemonics 3.2. Addressing modes 3.3. Operand size control 3.4. Expression evaluation 3.5. Segments 3.6. Comments 3.7. Command separation |
3.8. Code pointer relocation 3.9. Branch labels 3.10. Preprocessor 3.11. Object file format 3.12. IPS output support 3.13. Linkage selection 4. Changelog 5. Known bugs 6. Copying 7. Requirements 8. Downloading |
The produced object file is binary-compatible with those made with XA65.
The linker can also be used to convert IPS patches into
binary files (an empty space is assumed to be the original
file), with the following command:
neslink input.ips -o result.bin -f raw
adc
, and
, asl
, bcc
,
bcs
, beq
, bit
, bmi
,
bne
, bpl
, brk
, bvc
,
bvs
, clc
, cld
, cli
,
clv
, cmp
, cpx
, cpy
,
dec
, dex
, dey
, eor
,
inc
, inx
, iny
, jmp
,
jsr
, lda
, ldx
, ldy
,
lsr
, nop
, ora
, pha
,
php
, pla
, plp
, rol
,
ror
, rti
, rts
, sbc
,
sec
, sed
, sei
, sta
,
stx
, sty
, tax
, tay
,
tsx
, txa
, txs
, tya
Syntax:
Name | Examples | Functionally equivalent to (not nescom syntax, provided for illustration only) |
---|---|---|
Implied: | nop ; clc |
|
Immediate: | lda #value etc |
a = value |
Short relative: | bcc end |
|
Direct: | lda $12 |
a = ram[$0012] |
Direct indexed: | lda $12,x lda $12,y |
a = ram[$0012 + x] a = ram[$0012 + y] |
Direct indexed indirect: | lda ($12,x) |
a = ram[ramw[$0012 + x]] |
Direct indirect indexed: | lda ($12),y |
a = ram[ramw[$0012] + y] |
Absolute: | lda $1234 |
a = ram[$1234] |
Absolute indexed: | lda $1234,x lda $1234,y |
a = ram[$1234 + x] a = ram[$1234 + y] |
Absolute indirect: | lda ($1234) |
a = ram[ramw[$1234]] |
lda !$f0
would use 16-bit address instead of direct page.lda #<var
can be used to load the lower 8 bits of an external variable.lda #>var
can be used to load the upper 8 bits of an external variable.bcc somewhere+1
lda #!address + $100
ldy #$1234 + ($6C * 3)
text
, data
, zero
and bss
..text
, .data
, .zero
and .bss
respectively to select the segment.text
and data
segments are saved into
the o65 file. Labels are saved in all segments.
*= $F200
to change
where the code goes by default.-
can be defined for local branches backward
and +
for branches forward.
#ifdef
, #ifndef
, #define
,
#if
, #endif
and #include
like
in any C program. (See bugs)
With the .link
statement, you can change that.
.link page $3F
declares that this object should be
placed into page $3F.
.link group 1
declares that this object should be
placed to the same page together with all other objects that
want to be linked in group 1. This is useful when you want to
ensure that certain tables or routines go to the same page,
even if they are not in the same compilation unit.
The actual page is determined during link time, and you can
get the page by using 24-bit (@) or segment reference (^)
to a symbol from those modules.
This is not completely ready for NES yet.
.nop
statement.#include
d files aren't being properly preprocessed.If you happen to see this program useful for you, I'd appreciate if you tell me :) Perhaps it would motivate me to enhance the program.
Generated from
progdesc.php (last updated: Sun, 22 Aug 2010 04:46:53 +0300)
with docmaker.php (last updated: Sun, 22 Aug 2010 04:46:53 +0300)
at Sun, 22 Aug 2010 04:46:53 +0300