one of my recent has reached about 3000 lines including comments and it is a right sod to try to keep track of where everything is when its in one huge list.
is it possible to put different subsections/subroutines into different files whilst still being able to assemble and simulate it?
how would i go about splitting 1 big asm file into smaller manageable chunks?
i have found the include directive, but its doing something annoying
let me explain with an example
Code:
;
main code ;relocateable code section
Main:
goto testsubroutine ;this is in another .asm file
;*******************************************************************
theend
goto $ ;go no further than here
;End of program
#include <test.asm> ;include file, put it out of the way
END
[second file]
Code:
test code ;another section of code in a different file
testsubroutine ; the first routine called
nop
nop
goto theend ; i am trying to branch to a label somewhere in the first file
end
in this example the "goto theend" throws up the 'object not previously defined' error.
although it isnt defined in this second file, it is defined in the first.
i seem unable to goto a subroutine that is not in the second file.
into the first file. it seems to work happily then
you were right that i hadnt defined it in the second file, but i wanted it to go to a place in the first file. telling the assembler this bit of info seems to remody the problem. YAY!!!