From: Rod Pemberton on
"Rod Pemberton" <do_not_have(a)notreplytome.cmm> wrote in message
> "Frank Kotler" <fbkotler(a)> wrote in message
> news:htt678$m3i$1(a)
> > Rod Pemberton wrote:
> > > "Frank Kotler" <fbkotler(a)> wrote in message
> > > news:hto6nn$soc$1(a)
> > >> Naw, we're just printing the bytes in "reversed order" - high nybble
> > >> edx first, low nybble of eax last. Since we "get" them al-first,
> > >> Nathan's setting the direction flag to start at the "end" of the
> buffer,
> > >> and work toward the "front".
> > >>
> > >
> > > Sorry, I didn't look at the routine... Can't he just change the
> starting
> > > position and direction of the print on the screen, instead of the
> of
> > > the byte processing via DF? I.e., print byte to the right, move left
> > > char, print next byte, etc.
> >
> > I guess you could do that. How would you do it?
> Me? Direct write to the PC's text screen (mode 3), unless an OS is in my
> way.
> For 16-bit, ES set to b800h, BX set to screen location, using ES as
> on mov byte to BX. Bust word into nybbles in AL and AH.

Sorry, bust word into bytes, then bust bytes into nybbles in AL and AH for
ASCII adjustment and printing.

> For 32-bit, EBX set to screen location, lea to add in B8000h to ebx, mov
> byte to EBX. Bust dword into nybbles in AL, AH, CL, CH.

Sorry, bust dword into bytes, then bust bytes into nybbles in AL, AH, CL, CH
for ASCII adjustment and printing.

> Inc/dec BX or EBX as needed. Since byte sized moves, allows you to write
> color info inbetween.
> > Another way to deal with the "bytes in wrong order" problem is to store
> > 'em in the buffer "as they come" and do a "revstring" on it before
> > printing.
> That works.
> > Or push 'em on the stack and pop 'em off in the "right" order.
> That works too. And, you don't need a string routine. DAS, DAA is 64-bit
> obsoleted. Did you guys already consider BSWAP or XCHG to reverse the
> order?
> > I thought Nathan's approach of using std/cld worked out pretty well...
> >
> I vaguely recall some sort of issue with using rep movs in reverse
> RBIL bugslist?
> Rod Pemberton


Pages: 1
Prev: Check out
Next: Detecting A20 gate