There are two ways to go about this...
Use a Hex editor and manually copy-paste the bytes into the NES file. HXD is a nice hex editor.
or
Make a new ASM6 project that uses a bunch of incbins to include the original code, then put your modified code in there too, then incbin the rest of the rom. First use a hex editor or something to find the empty space for your code.
Example: (hack for SMB1 that makes more koopas appear for some reason)
Code:
.db "NES",$1A,2,1,1,0,0,0,0,0,0,0,0,0
;PRG ROM
.org $8000
$ = $8000
incbin "Super mario bros.nes", $ - $8000 + $10, $C71D - $
nop ;replaces sec instruction
incbin "Super mario bros.nes", $ - $8000 + $10, $10000 - $
;CHR ROM
incbin "Super mario bros.nes", $8010, $2000
Another example for Contra: (get the spread gun when you die)
Code:
;NES header
.db "NES",$1A,8,0,$21,0,0,0,0,0,0,0,0,0
;PRG ROM
;bank 0
.org $8000
$ = $8000
;copy 8000 until C000 of that bank
incbin "contra.nes", $ - $8000 + (0*$4000) + $10, $C000 - $
.org $C000
;bank 1
$ = $8000
;copy 8000 until C000 of that bank
incbin "contra.nes", $ - $8000 + (1*$4000) + $10, $C000 - $
.org $C000
;bank 2
$ = $8000
;copy 8000 until C000 of that bank
incbin "contra.nes", $ - $8000 + (2*$4000) + $10, $C000 - $
.org $C000
;bank 3
$ = $8000
;copy 8000 until C000 of that bank
incbin "contra.nes", $ - $8000 + (3*$4000) + $10, $C000 - $
.org $C000
;bank 4
$ = $8000
;copy 8000 until C000 of that bank
incbin "contra.nes", $ - $8000 + (4*$4000) + $10, $C000 - $
.org $C000
;bank 5
$ = $8000
;copy 8000 until C000 of that bank
incbin "contra.nes", $ - $8000 + (5*$4000) + $10, $C000 - $
.org $C000
;bank 6
$ = $8000
;copy 8000 until C000 of that bank
incbin "contra.nes", $ - $8000 + (6*$4000) + $10, $C000 - $
.org $C000
;bank 7 (fixed bank C000-FFFF)
$ = $C000
;we are changing code at DAD1, so copy code until $DAD1
incbin "contra.nes", $ - $C000 + (7*$4000) + $10, $DAD1 - $
lda #3 ;get spread gun when you die
;rest of the bank until $10000
incbin "contra.nes", $ - $C000 + (7*$4000) + $10, $10000 - $
;finished