From: "Santosh H." Newsgroups: comp.os.msdos.djgpp Subject: rep stosb generates a gpf:-( Date: Wed, 15 Sep 1999 15:09:53 +0530 Organization: VSNL Lines: 44 Message-ID: NNTP-Posting-Host: giasbgb.vsnl.net.in Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: news.vsnl.net.in 937425981 25073 202.54.12.162 (15 Sep 1999 20:06:21 GMT) X-Complaints-To: postmaster AT news DOT vsnl DOT net DOT in NNTP-Posting-Date: 15 Sep 1999 20:06:21 GMT X-Sender: hsantosh AT giasbgb To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hi, I was trying today to port some of my graphics functions I'd written for borland C to DJGPP(why prot mode u knucklehead!sorry:-)).Right , So i have a procedure which i converted from TASM to NASM syntax.the procedure is as below _Drawhorizline: push ebp mov ebp,esp push es push ds mov es,_VideoSegmentSelector ;which I get by push word 0a000h call ___dpmi_segment_to_descriptor mov [_Videosegmentselector],ax mov di,0 ;0 just for eg mov cx,80 rep stosb "BANG!"<-generates a gpf Since rep stosb is to fast to forego can some programming guru tell me why this harmless instruction is acting up.I also tried mov byte [es:di],al but still i get a gpf at the same instruction:-(.Is there some fancy pmode instruction which I'm supposed to use to load es .BTW that bit of code to get the _Videosegmentselector was got from Matthew Mastracci's inttest example in DJGPPASM.zip from delorie com.Strangely When I put the mov [fs:di],al instruction within a loop to run cx times i get a gpf at that instruction at the very first pass?? So i guess u guru's got the problem and any help mailed to hsantosh AT giasbga DOT vsnl DOT net DOT in will be verrry nice.Thanx to the guru's in advance Santosh P.S:I HATE MICROSOFT !!!!#@! ****************************************************************** Santosh .H : Activities Linux Linux and only Linux :-) Thought for a lifetime: Only Wimps use MS windows Toughs use Linux:-) ******************************************************************