delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/09/18/18:24:18

From: "Stefan Viljoen" <rylan AT intekom DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: rep stosb generates a gpf:-(
Date: Sat, 18 Sep 1999 20:51:29 +0300
Organization: The South African Internet Exchange
Lines: 51
Message-ID: <7s0rvn$mbs$4@ctb-nnrp2.saix.net>
References: <Pine DOT SOL DOT 3 DOT 96 DOT 990915144809 DOT 14092B-100000 AT giasbgb> <37E29DEB DOT 3961CD69 AT hmc DOT edu>
NNTP-Posting-Host: pc36-01-p47.nt.saix.net
X-Trace: ctb-nnrp2.saix.net 937685815 22908 155.239.194.47 (18 Sep 1999 20:16:55 GMT)
X-Complaints-To: abuse AT saix DOT net
NNTP-Posting-Date: 18 Sep 1999 20:16:55 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2014.211
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Nate Eldredge <neldredge AT hmc DOT edu> wrote in message
news:37E29DEB DOT 3961CD69 AT hmc DOT edu...
> "Santosh H." wrote:
> >
> > 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
>

I encountered EXACTLY the same problem in converting TASM code to NASM code.
Stosb stores the value in al (? was it ah?) to es:di right? I broke this
down to its components, doing something like

mov [es:di],al
inc di

Check out the code on my programming page - I deal specfically with
converting real mode TASM code for graphics to protected mode NASM/DJGPP
compatible code - the stuff I have there does exactly what you seem to want
to do.


--
This message courtesy of
RylanNet rylan AT intekom DOT co DOT za
http://home.intekom.com/rylan/
--
StarWars for ever!.


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019