Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

MPLAB (splitting .asm files)

Status
Not open for further replies.

shaun_c_m

Junior Member level 2
Joined
Oct 12, 2007
Messages
21
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,518
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?


thanks
shaun
 

Did you tried #include <file name>?
I used it before for big project in assembly language.
 

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.

im confused at how this all works.
 

you cannot use a name before the name is declared.

So try to declare the name before it is used. :)
 

ive finally figured it out!!!!

i needed to add the line

Code:
global theend

into the first file. it seems to work happily then :D

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!!!
 

how can we put #include <whatever.asm> or #include <test.bas> in BASIC language?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top