🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: net.micro.atari
1 messages
1 total messages Started by D'arc Angel Thu, 16 Jan 1986 03:54
atst.out.h - format of .prg files
#2097
Author: D'arc Angel
Date: Thu, 16 Jan 1986 03:54
87 lines
3248 bytes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~\ lineater,\~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

so far this is the only source i have worth contributing, hopefully
more will follow, this is a .h file i wrote (with some help from a
friend at CWRU) that describes the format of the header for atari .o
and .prg files:

/*	atst.out.h	.1	24Dec85	*/

/*
 * Header prepended to each Atari ST .prg file
 */
struct exec {
	 short	a_magic;	/* magic number */
unsigned long	a_text;		/* size of text segment */
unsigned long	a_data;		/* size of initialized data */
unsigned long	a_bss;		/* size of uninitialized data */
unsigned long	a_syms;		/* size of symbol table */
unsigned long	a_AZero1;	/* always zero */
unsigned long	a_AZero2;	/* always zero */
unsigned short	a_isreloc;	/* is reloc info present */
};

#define	CMAGIC	0x601a		/* contiguous text */

#define	ISRELOCINFO	0	/* relocation information is present */
				/*  any other value - no reloc info  */

/*
 * Macros which take exec structures as arguments and tell whether
 * the file has a reasonable magic number or offsets to text|symbols|strings.
 */
#define	N_BADMAG(x) \
    (((x).a_magic)!=CMAGIC)
#define	N_TXTOFF(x) \
	((x).a_magic==ZMAGIC ? 1024 : sizeof (struct exec))
#define N_SYMOFF(x) \
	(N_TXTOFF(x) + (x).a_text+(x).a_data)
#define	N_STROFF(x) \
	(N_SYMOFF(x) + (x).a_syms)

/*
 * Format of a relocation datum.
 */
struct relocation_info {
	 int	r_address;	/* offset from beg of Text Segment of */
				/* 1st longword needing relocation    */
unsigned char	r_offset;	/* reloc offset byte */
};

/*
 * Format of a symbol table entry
 */

struct	nlist {
	 char	n_name[9];	/* symbol name */
unsigned short	n_type;		/* type flag, i.e. N_TEXT etc; see below */
unsigned long	n_value;	/* value of this symbol (or sdb offset) */
};

/*
 * Simple values for n_type.
 */
#define	N_BSS	0x0100		/* bss */
#define	N_TEXT	0x0200		/* text */
#define	N_DATA	0x0400		/* data */
#define	N_EXT	0x0800		/* external */
#define N_EQREG	0x1000		/* equated register */
#define N_GLOBL	0x2000		/* global */
#define N_EQU	0x4000		/* equated */
#define N_DEF	0x8000		/* defined */

-------------------------------------------------------------------------

it has a problem (at least on VAXen) that C likes to add a half word
of filler after the magic number in the start of the header, anyone
have a work around for it?
-- 
			god bless Lily St. Cyr
			 -Rocky Horror Picture Show

Name:	James Turner
Mail:	Imagen Corp. 2650 San Tomas Expressway, P.O. Box 58101
        Santa Clara, CA 95052-9400
AT&T:	(408) 986-9400
UUCP:	...{decvax,ucbvax}!decwrl!imagen!turner
CompuServe: 76327,1575
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads