flat assembler
Message board for the users of flat assembler.
  
|  Index
      > Macroinstructions > initialized locals | 
| Author | 
 | 
| asmfan 22 Mar 2009, 15:02 in proc locals/endl
 Code: proc someproc locals buf db dup 260 (?) endl ret endp buf gets initialized _________________ Any offers? | |||
|  22 Mar 2009, 15:02 | 
 | 
| Tomasz Grysztar 22 Mar 2009, 17:09 It should be "260 dup (?)", not the other way, as you wrote.
 And after this correction it works OK for me. | |||
|  22 Mar 2009, 17:09 | 
 | 
| Tomasz Grysztar 24 Mar 2009, 11:41 If you want to have uppercase DUP enabled for local macro, you need to modify deflocal@proc macro:
 Code: macro deflocal@proc name,def,[val] { common match vars, all@vars \{ all@vars equ all@vars, \} all@vars equ all@vars name forward local ..var,..tmp match =label,def \{ ..tmp equ \} match tmp,..tmp \{ ..var def val \} match ,..tmp \{ label ..var val \} match =?, val \{ ..tmp equ \} match any =dup (=?), val \{ ..tmp equ \} match any =DUP (=?), val \{ ..tmp equ \} ; add this line here match tmp : value, ..tmp : val \{ tmp: end virtual initlocal@proc ..var,def value virtual at tmp\} common match first rest, ..var, \{ name equ first \} } | |||
|  24 Mar 2009, 11:41 | 
 | 
| asmfan 24 Mar 2009, 11:54 I know i could but isn't it expected behavior when keywords are case insesitive? maybe some global fix'ing for them? Why you have such strick position relatively some uppercased keywords
 Code: proc p local a:BYTE, but_not_byte:byte ; error here endp and lowercased some other? Maybe this some unspoken fasm rule? it's inconvenient to constantly check the case for keywords /either for macros or for [pre-]processor keywords/ especially when porting to fasm. The same with structures (macro) when only short (d*) data declaration allowed. Sometime mere struct porting takes time( | |||
|  24 Mar 2009, 11:54 | 
 | 
| Tomasz Grysztar 24 Mar 2009, 12:09 fasm preprocessor is case-sensitive and it's a spoken rule. The assembler used to be case-sensitive, too, but due to requests I changed it, though it's now creating a mess, as you see.   | |||
|  24 Mar 2009, 12:09 | 
 | 
| asmfan 24 Mar 2009, 12:23 yeah, met some)
 maybe inserting some {tmp = toLower(src)} to stage when labels/keywords are determined by comparison keywords to {tmp} have sense? Or smth alike? Then no fix'ation needed. | |||
|  24 Mar 2009, 12:23 | 
 | 
| Tomasz Grysztar 24 Mar 2009, 12:40 There's a better way to fix this one particular problem:
 Code: macro deflocal@proc name,def,[val] { common match vars, all@vars \{ all@vars equ all@vars, \} all@vars equ all@vars name forward local ..var,..tmp match =label,def \{ ..tmp equ \} match tmp,..tmp \{ ..var def val \} match ,..tmp \{ label ..var val \} match any =?, val \{ ..tmp equ \} match any (=?), val \{ ..tmp equ \} match tmp : value, ..tmp : val \{ tmp: end virtual initlocal@proc ..var,def value virtual at tmp\} common match first rest, ..var, \{ name equ first \} } Should work with all DUP variants (also "buf db dup 260 ?" which was not detected earlier). | |||
|  24 Mar 2009, 12:40 | 
 | 
| asmfan 24 Mar 2009, 12:50 Tomasz Grysztar wrote: (also "buf db dup 260 ?" which was not detected earlier). Of course it was my mistake:) And it shouldn't be right as you said in #2. I just wrote it here so, not copy/pasted the right version (with "DUP" that caused this thread). _________________ Any offers? | |||
|  24 Mar 2009, 12:50 | 
 | 
| Tomasz Grysztar 24 Mar 2009, 12:55 Oh, I did mean "db 260 dup ?". Followed your mistake.   | |||
|  24 Mar 2009, 12:55 | 
 | 
| < Last Thread | Next Thread > | 
| Forum Rules: 
 | 
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.