DataMuseum.dk

Presents historical artifacts from the history of:

RegneCentralen RC700 "Piccolo"

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RegneCentralen RC700 "Piccolo"

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦e975cded6⟧ TextFile

    Length: 2048 (0x800)
    Types: TextFile
    Names: »NOBOOT.C«

Derivation

└─⟦b35f94715⟧ Bits:30003295 BDS C version 1.50 arbejdsdiskette til RC703 Piccolo
└─⟦b35f94715⟧ Bits:30005324 BDS C version 1.50 arbejdsdiskette til RC703 Piccolo
    └─ ⟦this⟧ »NOBOOT.C« 

TextFile

/*
	NOBOOT.C	written by Leor Zolman
	v1.50 ONLY!		3/82, 9/82

	Given the name of a C-generated COM file linked with the standard
	distribution version of the v1.50 C.CCC run-time package using
	either the standard CLINK or optional "L2" linker), this program
	changes that COM file so that it does not perform a warm-boot after
	its execution is complete, but instead preserves the CCP (Console
	Command Processor) that is in memory when execution begins and
	returns to the CCP directly following execution.

	The versions of NOBOOT.C distributed with BDS C v1.46 will NOT
	work with files produced by v1.50.

	The CLINK option "-N" may be used instead of this program to the
	same effect. NOBOOT is basically intended for use with COM files
	produced by the L2 linker, as opposed to by CLINK.
*/

#include <bdscio.h>

#define JMP	0xC3	/* 8080 JMP instruction				*/
#define SNOBSP 0x0138	/* Location of Set NoBoot SP routine in C.CCC	*/
#define NOBRET 0x013B	/* Locatio of NoBoot RETurn routine in C.CCC	*/

main(argc,argv)
char **argv;
æ
	int fd;
	int i;
	char c;
	char nambufÆ30Å;
	char workbufÆ0x500Å;

	if (argc != 2) æ
		puts("Usage: noboot <C-generated COM file name>Øn");
		exit();
	å

	for (i=0; (c = argvÆ1ÅÆiÅ) && c != '.'; i++)
		 nambufÆiÅ = c;
	nambufÆiÅ = 'Ø0';
	strcat(nambuf,".COM");

	if ((fd = open(nambuf,2)) == ERROR) æ
		puts("Can't open: ");
		puts(nambuf);
		exit();
	å

	i = read(fd,workbuf+0x100,8);
	if (i != 8) puts("Couldn't read in at least 8 sectors...Øn");

	workbufÆ0x100Å = JMP;
	workbufÆ0x101Å = (SNOBSP & 0xFF);	/* Low byte of SNOBSP	*/
	workbufÆ0x102Å = (SNOBSP >> 8);		/*  Hi byte of SNOBSP	*/

	workbufÆ0x109Å = JMP;
	workbufÆ0x10AÅ = (NOBRET & 0xFF);	/* Low byte of NOBRET	*/
	workbufÆ0x10BÅ = (NOBRET >> 8);		/*  Hi byte of NOBRET	*/

	seek(fd,0,0);
	if (write(fd,workbuf+0x100,8) != 8) æ
		puts("Write error.Øn");
		exit();
	å

	if (close(fd) == ERROR) æ
		puts("Close errorØn");
	å
å
«eof»