|
|
DataMuseum.dkPresents historical artifacts from the history of: CP/M |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about CP/M Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 2176 (0x880)
Types: TextFile
Names: »NOBOOT.C«
└─⟦23f778bf6⟧ Bits:30005378 BDS C v1.46 & Pascal/MT+ v5.5 (Callan format)
└─⟦this⟧ »NOBOOT.C«
└─⟦4ada80662⟧ Bits:30005446 Pascal/MT+ v5.5 & XREF & BDS C v1.46
└─⟦this⟧ »NOBOOT.C«
/*
NOBOOT.C written by Leor Zolman
3/82
Given the name of a C-generated COM file (linked with the standard
distribution version of the C.CCC run-time package), 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.
NOTE: If a command is the object of a pipe operation using DIO,
then a warm-boot will always occur after its execution, whether
or not NOBOOT has been applied to it.
*/
#include "bdscio.h"
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Å = 0x21;
workbufÆ0x101Å = 0x00;
workbufÆ0x102Å = 0x00;
workbufÆ0x103Å = 0x39;
workbufÆ0x104Å = 0x22;
workbufÆ0x105Å = 0x79;
workbufÆ0x106Å = 0x05;
workbufÆ0x107Å = 0xcd;
workbufÆ0x108Å = 0x34;
workbufÆ0x109Å = 0x01;
workbufÆ0x10aÅ = 0xf9;
workbufÆ0x12fÅ = 0x2a;
workbufÆ0x130Å = 0x79;
workbufÆ0x131Å = 0x05;
workbufÆ0x132Å = 0xf9;
workbufÆ0x133Å = 0xc9;
workbufÆ0x134Å = 0x2a;
workbufÆ0x135Å = 0x06;
workbufÆ0x136Å = 0x00;
workbufÆ0x137Å = 0x11;
workbufÆ0x138Å = 0xcc;
workbufÆ0x139Å = 0xf7;
workbufÆ0x13aÅ = 0x19;
workbufÆ0x13bÅ = 0xc9;
workbufÆ0x13cÅ = 0x00;
workbufÆ0x13dÅ = 0x00;
workbufÆ0x13eÅ = 0x00;
workbufÆ0x443Å = 0xc3;
workbufÆ0x444Å = 0x2f;
workbufÆ0x445Å = 0x01;
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»