Alternates_Syntaxes  ...


Beginners,   DO NOT READ THIS. The RosAsm syntax is clean, clear and simple. There is absolutely no reason for wishing to use another one. But older programmers are  inclined by human natures habit to do things in some ways and they hate to have to change, even from bad to good.


So, I have implemented a Pre-Parser that allows several alternate syntaxes. To enable them, you have to say:


PREPARSE Alternates


See Pre_Parser_concept for PREPARSE rigid syntax.



For sizes markers, instead of the clean and easy:


  mov  ecx  D$Counter


you can write, as well, any of the old and stupid forms of:


mov  ecx  D[Counter]

mov  ecx  dWord [Counter]

mov  ecx  dWord Ptr [Counter]


Same, of course, for all Sizes Markers:


D$Synbol    >    D / Dword /  Dword Ptr[Symbol]

W$Synbol    >   W / word    /  Word Ptr[Symbol]

B$Synbol     >    B /  Byte     /  Byte Ptr[Symbol]

Q$Synbol    >    Q / Qword /  Qword Ptr[Symbol]

R$Synbol     >    R /  Real    /   Real Ptr[Symbol]

F$Synbol     >    F /  Float    /  Float Ptr[Symbol]

T$Synbol     >    T / TByte   /  Tword / Tbyte Ptr / TWord Ptr [Symbol]

O$Synbol    >    O / Oword /  Oword Ptr[Symbol]

X$Synbol     >    X /  Xword /  Xword Ptr[Symbol]


(for Tbyte, Tword is an alternates historical stupidity).



Implicit size, when RosAsm can guess it from a Register Parameter is allowed too:


mov  ecx  [Counter]

mov  ax  [Counter]

mov  [Counter]  bl


Sizes can only be computed from Byte/Word/dWord Registers.



When declaring Data, you can as well replace the original D$, W$, B$, and so on, by DD, DW, DB, and so on, but this last formulation absolutely requires spaces separators (and nothing else) before and after the Marker (whereas the basic syntax does not).



When declaring Equates, if you can't live with:


[TRUE  1,    FALSE  0]


you can as well write (well,... this one is a good choice, IMHO):


[TRUE  =  1,    FALSE  =  0]


or even:


[TRUE  EQU  1,    FALSE  EQU  0]


These two formulations, too, require spaces separators before and after the '='  and  'EQU' dummy statement. This small limitation allows the Basic Syntax to reuse  these reserved words for  another purpose when they are standing just after/before ''[ / ]''. Example:


[=  =  e,    >  =  a, .........]




If you want to do something stupid such as Typings (the most confusing feature ever implemented in an Assembler), you can do it with Macros. For Example:


[Data | {#1Ptr: #2>L} | {#1  #2#1Ptr}]


Data  dWordData D$,  24  13  3


Note the comma after ''D$'', absolutely required because the Macro parser would confuse ''D$  24'' with ''D$24''. Note too, that, in such cases of Macros Declarations, as the Macros Parser does its job a long time after the Pre-Parser, you can not have usage of ''DD/DB/DW'' alternates.


mov  eax  dWordData             ; eax = 24 !!!!!!!!!!!!

mov  ebx  dWordDataPtr        ; ebx = Adress of  dWordData!!!!!!!!!!!!!!



Or even more stupid:


[Data|{ADDR#1: #2>L} | {#1  #2ADDR#1}]


mov  eax  Mydata+8          ; eax = 3 !!!!!!!!!!!!

mov  ebx  ADDR_Mydata ; ebx = Adress of  dWordData!!!!!!!!!!!!!!


Your source will just be completely unreadable, the Right-Click search will not find the symbols declarations,  your development time will be twice as long and the compilation will be twice as long also. But it works...

~~~~~~~