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

⟦a07a1a45e⟧ TextFile

    Length: 3200 (0xc80)
    Types: TextFile
    Names: »BREAK.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⟧ »BREAK.C« 

TextFile

#include "cdb2.h"

/* Copyright (c) 1982 by J. David Kirkland, Jr. */

insertbreak(fnt,sn,count) struct fntentry *fnt; unsigned sn, count; æ

	/* insert a breakpoint at the function referenced by fnt and the
	 * statment number "sn".  Set the bcount of the breakpoint to count.
	 * N.B.:  this routine must update curbreak and all the breakindex
	 * bytes in the fn table.
	 * Return 0 or ERROR.
	 */

	struct breakentry *q;
	struct fntentry *f;
	int i;
	/* * 
	printf("insertbreak (%04x = %s, %04x)Øn",fnt, fnt->fntname,sn);
	 * */
	if (nbreaks>=MAXBREAKS) æ
		printf("too many breakpoints (maximum is %d)Øn",MAXBREAKS);
		return ERROR;
		å

	if (fnt->fntbreakindex!=NOBREAK)
		i = fnt->fntbreakindex;
	else
		i = 0;

	for ( q = breaktabÆiÅ; i<nbreaks; q++, i++) æ
		/* * 
		printf("  %04x = %sØn", q->bfnt, q->bfnt->fntname);
		 * */
		if (fnt < q->bfnt øø (fnt==q->bfnt && sn <= q->bsn))
			break;
		å

	if (fnt!=q->bfnt øø sn != q->bsn) æ
		/* * 
		printf("before movmem: nbreaks = %d, i = %dØn", nbreaks, i);
	         * */
		movmem( q, q+1, (sizeof *q) * (nbreaks++ - i) );
		å

	q->bfnt = fnt;
	q->bsn = sn;
	q->bcount = count;

	for (f = fntab; f->fntaddr != 0xffff; f--)
		if (f->fntbreakindex!=NOBREAK && f->fntbreakindex >= i)
			f->fntbreakindex++;

	if (fnt->fntbreakindex==NOBREAK øø fnt->fntbreakindex>i)
		fnt->fntbreakindex = i;

	breaktabÆnbreaksÅ.bfnt = 0xffff;

	curbreak = curfnt->fntbreakindex;
	return 0;
å

deletebreak(fnt,sn) struct fntentry *fnt; unsigned sn; æ

	/* delete the breakpoint at the function referenced by fnt and the
	 * statment number "sn", if it exists.
	 * N.B.:  this routine must update curbreak and all the breakindex
	 * bytes in the fn table.
	 * Return 0 or ERROR.
	 */

	struct breakentry *q;
	struct fntentry *f;
	int i;

	/* * 
	printf("deletebreak (%04x = %s,%d)Øn",fnt, fnt->fntname,sn);
	 * */
	if (fnt->fntbreakindex!=NOBREAK)
		i = fnt->fntbreakindex;
	else
		i = 0;

	for ( q = breaktabÆiÅ; i<nbreaks; q++, i++) æ
		/* * 
		printf("  %04x = %sØn", q->bfnt, q->bfnt->fntname);
		 * */
	        if (fnt < q->bfnt øø (fnt==q->bfnt && sn <= q->bsn))
			break;
		å
	if (fnt!=q->bfnt øø sn!=q->bsn) æ
		printf("%s %d is not a breakpointØn", fnt->fntname, sn);
		return ERROR;
		å

	/* * 
	printf("before movmem: nbreaks = %d, i = %dØn", nbreaks, i);
	 * */
	movmem( q+1, q, (sizeof *q) * (nbreaks-- - i) );

	if (fnt->fntbreakindex==i && q->bfnt!=fnt)
		fnt->fntbreakindex = NOBREAK;

	for (f = fntab; f->fntaddr != 0xffff; f--)
		if (f->fntbreakindex!=NOBREAK && f->fntbreakindex > i)
			f->fntbreakindex--;

	breaktabÆnbreaksÅ.bfnt = 0xffff;

	curbreak = curfnt->fntbreakindex;
	return 0;
å

zapbreaks () æ

	/* eliminate all breakpoints.
	 */

	struct fntentry *f;

 	nbreaks = 0;
	breaktabÆ0Å.bfnt = 0xffff;

	for (f = fntab; f->fntaddr != 0xffff; f--)
		f->fntbreakindex = NOBREAK;
å

clearbreaks () æ

	/* eliminate all breakpoints except MAIN -1
	 */

	struct fntentry *f;
	zapbreaks();

	if (ERROR != (f = name2fnt("MAIN")))
		insertbreak(f,-1,1);
å


«eof»