Newsgroups: comp.os.msdos.djgpp From: samantha Subject: Re: Djgpp inline asm/graphics (hline) question Message-ID: <341310B5.3041@ceasars.co.za> Date: Sun, 07 Sep 1997 13:38:13 -0700 References: <3411758B DOT AF94207 AT ecr DOT net> Reply-To: jazz AT ceasars DOT co DOT za Organization: Student MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 37 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Jesse Legg wrote: > > Hello all! I am attempting to teach myself protected mode asm with djgpp > and have > been running into things that I could use help with. This group has been > very helpfully > in the past so I thought I'd pick your brains again! :) > testl $1, %%edi ; test for odd number address (help!?? :) Erm... why not try dividing by two? If you get a result that has a fraction, not even, if not, even...? > shr $1, %%ecx ; from my real mode tutorial; what is this? :) I think this means divide by two. Shr ecx,1 (Intel format?) shifts the bits in ecx one step to the right, this dividing the number in ecx by two. If you shr ecx,2 for instance, you divide by four, then ecx,3 divides by 8, etc. Shl (if I am not cofusing two) multiplies by powers of 2 in the the same manner. This is probably used by your tutorial as part of calculating a screen offset into vidram...? > adc $0, %%ecx ; ditto I have no idea what this does... why not look in an asm ref? Another fing: why not download Shawn Hargreaves' (shawn AT talula DOT demon DOT co DOT uk) Allegro game library. It comes with full DJGPP source, (lots of inline asm in it btw) and it does the kind of stuff you seem to want to do quite well in vga and svga modes. Take a look at it! Hope this helped. Rylan