Are you interested in a zombies game on the calc?
Hell yes!
 37%  [ 3 ]
What's zombies?
 50%  [ 4 ]
You're to stupid to program that!
 12%  [ 1 ]
Total Votes : 8

I've been messing around with trying to get multiple files to work together in Sourcecode 3 with z80 Assembly, but I would like to know the "Proper" way of doing things, because I keep getting error messages and stuff not working.
What I want to do:
Have 3+ files: One for 'main' (runner program)
One for 'data' (labels and such)
One or more for 'routines' (the main actions the program will take)
I want to be able to include "ti83plus.inc" just once and then have all the routine files be able to 'see' it so that I may use bcalls and such in my routines. I've found a couple online resources for linking files like this, but none gave ALL of the nessecary code, so that's why I'm asking for the "Proper" way to do it.
I would like to know exactly what to put in each file, and an explanation of WHY everything needs to be that way. Thank you for all your time and patience. My end goal is to make a knock-off of Call of duty zombies once I get good enough at assembly, but I just started learning this week, so that's probably a long ways away.

Code:
#include "ti83plus.inc"
#include "data.asm"
#include "routines.asm"

code...
What should I put at the top of my routines and data? or should I just write the labels straight away?
You don't *need* labels at the top of the other files. It just adds the code to the main program where you include it. However, if you include it at the bottom (recommended), you need labels to call the routines or to use the data.
Ah okay so If I included my routines file at the top of my main file it would just start executing the code there before the code in my main file?
Exactly! Smile And if you put data at the top of the main file, it executes data. Funny, isn't it? Razz
When I put my include statements at the bottom of my main file, It can't find the labels in my routines file??? I don't understand why It does that.
How do you include it? If the name of your secondary program is "DATA", use #include "DATA.asm".
I wrote
In main:
...
call testPrint
...
#include “routines.asm”

In routines

testPrint:
*code to print a char that I have confirmed works*
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement