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 3,508 of 4,675   
   R.Wieser to All   
   Re: handy data section format (esp for i   
   23 Jul 18 13:33:58   
   
   From: address@nospicedham.not.available   
      
   Firr,   
      
   > problem is i would like to have some syntax for easy defining of data   
   > there what i invented is something like   
   >   
   > DATA my_label:  "akjhaskjh" 13 10 0 33 33 42   
   > DATA my_label2:  33 33 "dkjsksj" 13 10 "wkjhwjk" 0 33 33 42   
      
   Most assemblers require a datatype indicator between the label (or   
   nothing! - like happens with a "continuation" of a previous line) and the   
   data.  Like db, dw, dd and dq.   
      
   my_data: db 'hello world', 0x0A,0x0D   
      db 'this is the second line',0x0A,0x0D,'$'   
      
   And as the datatype indicates the size, you do not need to do it for each   
   seperate value/string on that line.   
      
   (I could also have used 0xA,0xD or 0x00000A,0x00D.  Doesn't look good, but   
   thats a whole other matter)   
      
   One drawback: Using the above method a line cannot mix multiple data types,   
   something which would be possible using your method.   In other words, both   
   methods have their pros and cons. :-)   
      
      
   But to answer your origional question, you could use the prefixes '+' and   
   '-' to indicate a signed decimal value, followed with a letter indicating   
   the data size.  Like 'b', 'w' and 'd'.   For an unsigned decimal value you   
   could use 'u' as the prefix, followed by the size:   
      
   my_data: +b70,-w32768,uw65535   
      
   Regards,   
   Rudy Wieser   
      
   --- 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