NintendoAge http://nintendoage.com/forum/ -Sqooner Reading external subroutines using Asm6 http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=187038 2019-05-06T12:20:43 -05.00 reaktor24 3
That's great thanks. Working okay now!  

Cheers ]]>
Reading external subroutines using Asm6 http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=187038 2019-05-06T10:41:46 -05.00 reaktor24 3
You need to include the file name in the main file of your code like so.
  .bank 0        
  .org $8000  
  .include "maincode2.asm"

So, in Bank 0 of maincode.asm, I am storing the file maincode2.asm. You can do this anywhere in your code, you don't need to have the .org or memory location there unless you are specifically storing it at that location for some reason. The key is to use use that .include. This literally puts all of the code in that file in that exact location in your code.

I like to use this for bankswitching. Below is just a peak at how I organize my banks and include separate files. If you are not to bankswitching yet, don't worry about that part. Just understand that whereever you put the -.include "filename.asm"- in you code is exactly where the assembler sees the code in filename.asm.
 
;;;;;;;;;;;;;;;;;bankSource=00;;;;;;;;;;;;;;;;;;;;
  .bank 0        
  .org $8000  
  .include "maincode2.asm"
    
  .bank 1
  .org $A000
  .include "maincode3.asm" 

;;;;;;;;;;;;;;;;;bankSource=01;;;;;;;;;;;;;;;;;;;;
  .bank 2    
;;;NO MORE CODE! FOR FLASH SAVING!!!  
  ;.org $8000
  .org $0500  ;;put code in ram  
  .include "flashsavefiles\savecode.asm"
    
  .bank 3
  .org $A000
SCORESFLASH:  
  .incbin "flashsavefiles\blank.bin"

;;;;;;;;;;;;;;;;;bankSource=02;;;;;;;;;;;;;;;;;;;;  
  .bank 4                                                
  .org $8000
TitleGraphics:  
  .incbin "CHRfiles\titlesprites.chr"
  .incbin "CHRfiles\titlegraphics.chr"
 
  .bank 5
  .org $A000
GameGraphics:
  .incbin "CHRfiles\gamesprites.chr"
GameBGGraphics:
  .incbin "CHRfiles\gamegraphics.chr" 
]]>
Reading external subroutines using Asm6 http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=187038 2019-05-06T09:16:50 -05.00 reaktor24 3
'Can't determine address'

Do I need to include a memory location or something with .org?

I tried .org $C600 as a test and it seems to assemble without errors. Of course, the rom file doesn't work.

Anyone know where I'm going wrong?

Steve ]]>