You're probably not going to get anywhere decent because x816 has no NES header support (meaning the 16 byte header you have to prepend yourself using something like
copy /b header.bin+yourrom.bin result.nes).
I would suggest not bothering with DOS at all and get yourself asm6 and use that. There is absolutely no legitimacy in limiting yourself like that. If you want example code for that (for a mapper 1 game with a single 32KByte PRG section and a single 8KByte CHR page (you'll need to make your own CHR data)):
Code:
;
; iNES Header Section
; =====================
.db "NES", $1a ; Offset 0 = ID string + 0x1a
.db 2 ; Offset 4 = 16KB PRG bank count
.db 1 ; Offset 5 = 8KB CHR bank count
.db 1 ; Offset 6 = Mapper #
.db $00 ; Offset 7 = Mapper # (extended)
.fillvalue $00 ; XXX - use fillvalue to work around an asm6 v1.05 bug
.align 16 ; Pad remaining header with zeros
; RESET point
; =====================
.fillvalue $ff ; XXX - use fillvalue to work around an asm6 v1.05 bug
.org $8000
reset:
sei
ldx #$ff
txs
lda #$00
;
; MAIN code
; ===========
- jmp -
;
; NMI vector
; ===========
nmi:
rti
; IRQ vector
; ============
irq:
rti
; NMI/RESET/IRQ Vectors
; =======================
.fillvalue $ff ; XXX - use fillvalue to work around an asm6 v1.05 bug
.org $fffa
.dw nmi ; NMI vector
.dw reset ; RESET vector
.dw irq ; IRQ vector
Assembling is easy:
\path\to\asm6.exe -l myprog.asm followed by
copy /b myprog.bin+myprog.chr myprog.nes.
Despite this warning if you still want to use x816, you can create a 16-byte NES header yourself (call it header.bin) based on the above header data, then use some code like this for x816:
Code:
.opt off
.dasm off
.detect off
.index 8
.mem 8
.hirom off
.base $008000
.org $008000
.par {}
; RESET point
; =====================
reset:
sei
ldx #$ff
txs
lda #$00
;
; MAIN code
; ===========
- jmp -
;
; NMI vector
; ===========
nmi:
rti
; IRQ vector
; ============
irq:
rti
; NMI/RESET/IRQ Vectors
; =======================
.org $00fffa
.dw nmi ; NMI vector
.dw reset ; RESET vector
.dw irq ; IRQ vector
Assembling is easy:
\path\to\x816.exe -l myprog.asm followed by
copy /b header.bin+myprog.bin+myprog.chr myprog.nes.
You will also need to be absolutely 100% sure to write pure 6502 instructions -- this will be entirely your responsibility. The assembler has no way to limit its instruction set to 6502 only, so instructions like
INC or
INC A will assemble into their 65c02/65816 opcodes without any errors and you'll be wondering why your code just locks up or behaves oddly (6502 does not offer that opcode; you have to use
CLC ADC #1). So again: please stick to a real 6502 assembler and stop with this limit-myself-to-DOS nonsense. :-)
Sorry for the screwed up formatting; the board software appears to make a beautiful mess of tabs vs. spaces.