[Color Computer] [coco] Learning assembly for OS-9

Lothan lothan at newsguy.com
Tue Jul 19 03:37:58 EDT 2005

Learning assembly language programming with OS-9 can be a lot of fun, but
you're likely to run into a lot of stress and misery trying to write a
device driver as your first project. Device drivers aren't all that
difficult if you have a fundamental grasp of the structures held by the
kernel and file managers, such as path descriptors, register stacks, the
branch table, and interrupt processing.

For this reason, I recommend starting with something small and working your
way up. A rudimentary application might look like this:

 nam test
 ttl Test program

 use os9defs

TypeLang equ Prgrm+Objct  Type=program, Language=object code
Rev equ 1 Revision=1
AttrRev equ Reent+Rev Attribute=re-entrant, revision=1

 mod Size, Name, TypeLang, AttrRev, Start, DataSize

Name fcs /Test/ The name of the application is Test
Ed fcb $01 Edition 1

Data rmb 1 Reserve one byte of memory in the data area
DataSize equ . Define the data area size

HelpMsg fcc /Usage: This application takes no arguments and does nothing/
 fdb $0d$0a
HelpLen equ *-HelpMsg Define the length of the string

Start pshs x       Save Register X
 lda #1            Standard output path
 leax HelpMsg,pcr  Get the address of the string
 ldy #HelpLen      Get the length of the string
 os9 I$Write       Write the string
 lbcs Error        Exit with the error code if error
 puls x            Restore Register X

Exit clrb          Clear the error code and Carry flag
Error os9 F$Exit   Exit the application

 emod              End of the module
Size equ *         Define the module size
 end               End of the source file

> -----Original Message-----
> From: coco-bounces at maltedmedia.com [mailto:coco-bounces at maltedmedia.com]
> On Behalf Of George Ramsower
> Sent: Monday, July 18, 2005 12:19 PM
> To: ColorComputer at yahoogroups.com
> Subject: [Color Computer] [coco] Learning assembly for OS-9
> How would one go about learning to write assembly for OS-9.
> I tried once but couldn't figure out(understand) the sequence of events
> that
> are necessary to get a working module assembled.
> I want to build a couple of drivers and device descriptors. How is that
> done?
> I have all the OS-9/Microware tools to do this. I even have a C-compiler..
> don't understand that one either.
> George
> Brought to you by the 6809, the 6803 and their cousins!
> Yahoo! Groups Links
> <*> To visit your group on the web, go to:
>     http://groups.yahoo.com/group/ColorComputer/
> <*> To unsubscribe from this group, send an email to:
>     ColorComputer-unsubscribe at yahoogroups.com
> <*> Your use of Yahoo! Groups is subject to:
>     http://docs.yahoo.com/info/terms/
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco

More information about the Coco mailing list