home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.asm.x86      Ahh, the lost art of x86 assembly      4,675 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 4,101 of 4,675   
   Terje Mathisen to John   
   Re: small asm code (compo?)   
   24 Aug 20 10:57:30   
   
   From: terje.mathisen@nospicedham.tmsw.no   
      
   Kerr-Mudd,John wrote:   
   > On Sun, 23 Aug 2020 18:41:33 GMT, aen@nospicedham.spamtrap.com wrote:   
   >   
   >> On Sun, 23 Aug 2020 13:11:07 -0400, "Rick C. Hodgin"   
   >>  wrote:   
   >>> ...   
   >>>          mov     ah,2ah   
   >>>          int     21h   
   >>            shl     al,1   
   >>>          cbw   
   >>>          mov     bx,ax   
   >>>          add     bx,offset days   
   >>>          mov     byte ptr [bx+2],'$'   
   >>>          mov     dx,bx   
   >>>          mov     ah,9   
   >>>          int     21h   
   >>>          ret   
   >   
   > Yup, that's about it; I forgot to put in the original spec that I want   
   > the return code set to 1 for Sun etc, Otherwise the 'mov bx,ax' could   
   > have been an 'xchg'.   
   >   
   > Anyone want to try the long version? ('Monday' 'Tuesday' etc?)   
   >   
   It seems obvious that you would print "day" separately from the leading   
   day name chars, since that would save ~18 data bytes.   
      
   One complication is that the names are different lengths, and we cannot   
   pad them all to fit "Wednes$", so maybe use XLAT to convert day number   
   to starting offset via a 7-byte table?   
      
   Terje   
      
   --   
   -    
   "almost all programming can be viewed as an exercise in caching"   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca