Category : Files from Magazines
Archive   : ISSUE-33.ZIP
Filename : C.FIG
Output of file : C.FIG contained in archive : ISSUE-33.ZIP
#include
#define TEXTSPACE ???? /* however long the total text is */
#define SCREENCOUNT ???
unsigned scrseg;
char *charptr,*place[SCREENCOUNT], /* place[] = pointers to screens */
buff[4000],texthold[TEXTSPACE];
main()
{
struct regs rr;
int i,fhand;
interrupt(0x11,rr); /* equipment check interrupt */
scrseg=((rr.ax >> 4) & 3 == 3) ? 0xb000 : 0xb800; /* which CRT adapter? */
fhand=open("text.txt",0); /* load text area from word processor file */
read(fhand,texthold,TEXTSPACE);
close(fhand);
place[0]=charptr=texthold;
for(i=1;i
place[i] = charptr;
}
* * * * * * /* this is the area where the program */
text(QQ); /* would do something useful. */
* *
text (RR);
* * * * * *
}
/***************/
text(nn)
int nn;
{
char att,*wptr;
int y,i,*iptr;
for(i=0,iptr=buff;i<2000;i++) 0x0720; /* blank screen buffer */
for(charptr = place[nn]; *charptr != 0xa 😉 if(*charptr++ == 26) return;
/* to end of line: this gives me an area for comments */
for(att=0x7,y=0,wptr=buff;;charptr++) switch(*charptr){
case 0xa: wptr = &buff[++y*160];
/* point pointer to beginning of new line */
if(y<25) break; /* fall through if screen too large */
case '~': longmove(scrseg,0,buff,4000);
/* End of screen. You could use port calls to the 6845 to
blank the screen and avoid flicker. If you do, remember
that the control port is 0x3d8 for color/graphics and
0x3b8 for monochrome. More hardware dependencies! */
return;
case 0xd: break; /* some WP's don't include 0xd's */
case '^': att ^= 8; /* toggling intensity bit: 0xf<->0x7*/
break;
default: *wptr++ = *charptr; /*insert character */
*wptr++ = att; /*and attribute */
break;
}
}
/******************/
longmove(segment,offset,buffer,count)
unsigned seg,offset,ct;
char *buffer;
{
/* This one depends on
a. How your version of C handles the stack.
b. What sort of assembler you are using.
I'll just give assembly pseudocode. You'd probably be
using [BP+?] addressing */
#asm
mov es,segment
mov di,offset
mov si,buffer ;ds is already set
mov cx,count
cld ;increment si & di with each loop
rep movsb
#endasm
}
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/