From: Rod Pemberton on 30 May 2010 05:22
"Rod Pemberton" <do_not_have(a)notreplytome.cmm> wrote in message
> "Frank Kotler" <fbkotler(a)myfairpoint.net> wrote in message
> > Rod Pemberton wrote:
> > > "Frank Kotler" <fbkotler(a)myfairpoint.net> wrote in message
> > > news:hto6nn$soc$1(a)speranza.aioe.org...
> > >> 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
> > >> and work toward the "front".
> > >>
> > >
> > > Sorry, I didn't look at the routine... Can't he just change the
> > > position and direction of the print on the screen, instead of the
> > > 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
> 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
> > 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