Megalextoria
Retro computing and gaming, sci-fi books, tv and movies and other geeky stuff.

Home » Archive » net.micro.pc » dynamic ramdisk, program interupter, fast find for MS-DOS 2.x
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
dynamic ramdisk, program interupter, fast find for MS-DOS 2.x [message #112715] Mon, 16 September 2013 13:50
jnw is currently offline  jnw
Messages: 11
Registered: July 1985
Karma: 0
Junior Member
Message-ID: <2528@mcnc.UUCP>
Date: Tue, 29-Jan-85 21:57:49 EST
Article-I.D.: mcnc.2528
Posted: Tue Jan 29 21:57:49 1985
Date-Received: Sat, 2-Feb-85 08:58:54 EST
Organization: Microelectronics Ctr. of NC; RTP, NC
Lines: 787

# use sh to extract
echo extracting README
cat >README <ram.a <ram.doc <setram.c <='a') i-=32;		/* set to upper case */
	drive=i-'A'+1;
	if(drive<0 || drive>31) goto usage;
	getold();
	if(old){
		if(argc>2){
			puts("ramdisk already has memory");
			exit(1);
		}
		clear();
		exit(0);
	}
	if(argc<3){
		puts("no memory allocated to ramdisk");
		exit(1);
	}
	size=atoi(argv[2]);
	if(size<8 || size>800) goto usage;
	loci[1]=size<<1;
	size<<=6;
#asm
	mov		ah,4ah			;modify programs allocated block
	mov		cx,cs
	sub		cx,10h
	mov		word loc_,cx
	mov		word loci_,cx
	mov		es,cx			;start of partition
	mov		bx,word size_	;new size
	int		21h
	jc		err

	mov		ax,cs			;get pointer to environment block
	sub		ax,10h
	mov		es,ax
	mov		es,es:[2Ch]
	mov		ah,49h			;dealloc environment block
	int		21h
	jc		err

	mov		ax,4405h		;IOCTL call to ramdisk
	mov		bx,word drive_
	mov		dx,offset loci_
	mov		cx,4
	int		21h
	jnc		ok
err:
	mov		word err_,ax
	jmp		main_error_
ok:
	mov		ax,3100h
	mov		dx,word size_
	int		21h
	jmp		err
#
error:
	puts("error number ");
	err&=63;
	if(err>9) putchar(err/10+'0');
	putchar(err%10+'0');
	puts(" (decimal)");
	exit(1);
}

getold(){
#asm
	mov		ax,4404h		;IOCTL call to ramdisk
	mov		bx,word drive_
	mov		dx,offset loci_
	mov		cx,2
	int		21h
	jc		err
#
	old=loci[0];
}

/* Clear the ramdisk */
clear(){
#asm
	mov		ah,49h			;free mem
	mov		es,word old_
	int		21h
	jc		err

	mov		ax,4405h		;IOCTL call to ramdisk
	mov		bx,word drive_
	mov		dx,offset zero_
	mov		cx,4
	int		21h
	jc		err
#
	return;
}
xyzzy

echo extracting makeram.bat
cat >makeram.bat <int.a <>=4) to hex digit at [si--]
cdigit:
	mov	al,bl
	and	al,0Fh
	shr	bx,1
	shr	bx,1
	shr	bx,1
	shr	bx,1
	cmp	al,9
	jle	noadd
	add	al,7
noadd:	add	al,30h
	mov	cs:byte [si],al
	dec	si
	ret

addr:	dw	0FFFFh			;segment addr at end of this code
dstring:db	0Dh,0Ah,'c','s','=',0,0,0
csnum:	db	0,',',' ','i','p','=',0,0,0
ipnum:	db	0,0Dh,0Ah,0

init:
	mov	ax,351Ch		;get tick interupt vector
	int	21h
	mov	ds:word tick+1 DAT,bx
	mov	ds:word tick+3 DAT,es

	mov	ax,251Ch		;set new tick vector
	mov	dx,offset check DAT
	int	21h

	mov	ax,cs
	mov	dx,offset init+0Fh DAT
	mov	cl,4
	shr	dx,cl
	add	ax,dx
	mov	ds:addr DAT,ax
	mov	ax,3100h		;terminate and stay resident
	int	21h
	end
xyzzy

echo extracting int.doc
cat >int.doc <int_port.doc <makeint.bat <ffind.c <0) close(f);
	curflag=1;
	fe=fs=2048;
loop:
	while((c=getc(stdin))<=' ' || c==',') if(c<0) exit(0);
	i=0;
	do{ if(i<127) curfile[i++]=c; }
		while((c=getc(stdin))>' ' && c!=',');
	curfile[i]=0;
	f=open(curfile,0);
	if(f<=0){
		puts("******** can't open file ");
		puts(curfile);
		puts("\n");
		goto loop;
	}
}

/* find all lines in the current file containing string */
findall(argc,argv)
char **argv;{
	char *p,*q,*r,*string;
	int c;
	string=argv[1];
	c= *string;
loop:
	getline();
	for(p=line;pffind.doc <  

		
		
		
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Kermit vs. Xmodem
Next Topic: JOVE/msdos
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Mar 28 20:31:23 EDT 2024

Total time taken to generate the page: 0.05801 seconds