From: king621@nospicedham.comcast.net   
      
   On 04/24/2018 01:29 PM, Kerr-Mudd,John wrote:   
   > On Tue, 24 Apr 2018 11:04:54 GMT, Bartc    
   > wrote:   
   >   
   >> On 24/04/2018 10:48, bilsch wrote:   
   >>> The boot sector jumps to this code.   
   >>> It should print junk6789 but prints only j   
   >>> Why it not print junk6789 ?  TIA.  Bill S.   
   >>   
   >>>   
   >>> pbuf   times 80 db 0   
   >>> string   db 'junk'   
   >>   
   >>> Â Â Â Â Â Â Â Â Â mov si,pbuf   
   >>> Â Â Â Â Â Â Â Â Â mov di,string   
   >>> lup8:Â Â Â Â mov al,[di]   
   >>> Â Â Â Â Â Â Â Â Â mov byte[si],al   
   >>> Â Â Â Â Â Â Â Â Â inc si   
   >>> Â Â Â Â Â Â Â Â Â inc di   
   >>> Â Â Â Â Â Â Â Â Â cmp di,4   
   >>> Â Â Â Â Â Â Â Â Â jbe lup8   
   >>   
   >> di starts at label 'string'. Is that address 0? If not then comparing   
   > it   
   >> with 4 looks odd.   
   >>   
   >> If string has an address of at least 80 as seems likely, then this will   
   >> compare false and only one character is copied to the buffer.   
   >>   
   >   
   > It's surely much easier to keep si for the test string and di as the   
   > output location - you know, Source Index to Destination Index.   
   > And why bother? just put it direct to screen.   
   >   
   Further on (in prstr) the contents of pbuf are used as the source and   
   0xb800 is destination. The code in my question is a test case for   
   something larger. I'm keeping the same structure in the test case.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|