Editing
OS-9 Assembly Code Development
(section)
From F256 Foenix
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Program Modules === The format of a program module varies depending on whether you have a single source file for your program or multiple source files. Note: multiple source files format cannot use direct page addressing due to the way they are compiled. ==== Single Source File Format ==== The following is a skeleton for a single source file memory module (program). <code>********************************************************************</code> <code>* [Program Name]</code> <code>* [Description]</code> <code>*</code> <code>* by [Author Name]</code> <code>*</code> <code>* Edt/Rev YYYY/MM/DD Modified by</code> <code>* Comment</code> <code>* ------------------------------------------------------------------</code> <code> nam [executablename]</code> <code> ttl [Full Program Name]</code> <code> ifp1</code> <code> use defsfile</code> <code> endc</code> <code>tylg set Prgrm+Objct</code> <code>atrv set ReEnt+rev</code> <code>rev set $00</code> <code>edition set 1</code> <code> '''mod eom,name,tylg,atrv,start,size'''</code> <code> [Data Section - Variables and Data Structures Here]</code> <code>size equ .</code> <code>name fcs /[executablename]/</code> <code> fcb edition</code> <code>start</code> <code> [Program Section - Program Code Here]</code> <code> </code> <code> os9 F$Exit</code> <code> '''emod'''</code> <code>eom equ *</code> <code> end</code> OS9 can load programs (modules) only if they are in module header format. A module (program) is defined between the '''mod''' and '''emod''' pseudo instructions. * '''mod:''' Creates the module header and starts CRC check. '''mod''' has 6 attributes: # Module size (computed from the ''<u>eom</u>'' label at the end of the code - 2 bytes) # Module name offset (offset where the string of the name is contained, here that is defined at the ''<u>name</u>'' label with the ''fcs'' pseudo instruction - 2 bytes # Module type & language (in this case a Program in 6809 object code - 1 byte) # Module attribute-revision (1 byte). Attributes are reentrant (ReEnt) or not reentrant (0). Revision is a number 0-15. If two or more modules with the same name are in the module directory, then OS-9 only keeps the highest revision number module. # Module execution offset (here that is defined with the ''<u>start</u>'' label - 2 bytes) # Module variable storage size (defined by the ''<u>size</u>'' label immediately after the variable area, includes stack space - 2 bytes) * '''emod''': Outputs the correct 3 byte CRC. This is generated by the assembler over the entire module. For more information about memory modules, see OS-9 Fundamentals: [https://www.youtube.com/watch?v=YpoqTyrty8k OS-9 Fundamentals on YouTube by Boisy Pitre] ==== Multiple Source File Format ====
Summary:
Please note that all contributions to F256 Foenix are considered to be released under the Creative Commons Zero (Public Domain) (see
F256 Foenix:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Page actions
Page
Discussion
Read
Edit
Edit source
History
Page actions
Page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Search
Tools
What links here
Related changes
Special pages
Page information