Prev: Check out
Next: Detecting A20 gate
From: Rod Pemberton on 30 May 2010 05:22 "Rod Pemberton" <do_not_have(a)notreplytome.cmm> wrote in message news:htta9t$qlm$1(a)speranza.aioe.org... > "Frank Kotler" <fbkotler(a)myfairpoint.net> wrote in message > news:htt678$m3i$1(a)speranza.aioe.org... > > 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 of > > >> 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 order > of > > > the byte processing via DF? I.e., print byte to the right, move left a > > > 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 override > 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 byte > 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 order... > RBIL bugslist? > > > Rod Pemberton RP
|
Pages: 1 Prev: Check out Next: Detecting A20 gate |