Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Last revision Both sides next revision
mg_notes:cc65_tips:ca65_a2_strings [2017/12/29 18:44]
M.G. created
mg_notes:cc65_tips:ca65_a2_strings [2017/12/29 18:47]
M.G. [Examples]
Line 10: Line 10:
 Turn on or off the msb for ''​asc'',​ ''​str'',​ ''​pstr'',​ ''​cstr'',​ and ''​dc.b''​. ​ Defaults to ''​on''​. Turn on or off the msb for ''​asc'',​ ''​str'',​ ''​pstr'',​ ''​cstr'',​ and ''​dc.b''​. ​ Defaults to ''​on''​.
  
-  asc "​foo"​ +  asc "​foo" ​     ; store strings using msb setting 
-  hasc "​bar"​ +  hasc "​bar" ​    ; store strings with msb on 
-  lasc "​baz"​ +  lasc "​baz" ​    ; store strings with msb off 
-  inv "​inverse"​ +  inv "​inverse" ​ ; store inverse chars 
-  dci "​mytoken"​+  dci "​mytoken" ​ ; dextral character inverted
  
 ''​asc''​ stores text using the msb setting. ​ ''​hasc''​ and ''​lasc''​ force high or low msb, ''​inv''​ stores inverse characters (40-col screen), dci stores all but the last character with the msb set.  All support mixing hex bytes that are stored as-is. ''​asc''​ stores text using the msb setting. ​ ''​hasc''​ and ''​lasc''​ force high or low msb, ''​inv''​ stores inverse characters (40-col screen), dci stores all but the last character with the msb set.  All support mixing hex bytes that are stored as-is.
  
-  string asis +  string asis    ; str and dc.b store plain strings 
-  string pascal +  string pascal ​ ; str and dc.b store Pascal strings 
-  string c+  string c       ; str and dc.b store C strings
  
 Cause ''​str''​ and ''​dc.b''​ to use the given string type.  ''​asis''​ is equivalent to using ''​asc''​ instead of ''​str''​. ​ Defaults to ''​asis''​. Cause ''​str''​ and ''​dc.b''​ to use the given string type.  ''​asis''​ is equivalent to using ''​asc''​ instead of ''​str''​. ​ Defaults to ''​asis''​.
  
-  str "​foo"​+  str "​foo" ​ ; format according to string setting
   pstr "​bar"​ ; length-prefixed   pstr "​bar"​ ; length-prefixed
   cstr "​baz"​ ; zero-terminated   cstr "​baz"​ ; zero-terminated