flat assembler
Message board for the users of flat assembler.
Index
> Main > idata error! |
Author |
|
shoorick 09 Aug 2006, 10:38
it is about globals data macros: check fasmlib if there is such include - it seems it used there. (idata here - initialized data, udata - unitialized)
|
|||
09 Aug 2006, 10:38 |
|
vid 09 Aug 2006, 10:49
it's file fasmlib/fasmlib/data.inc. If you want just idata/udata macros, you have them here:
Code: macro idata arg { __IData equ __IData, ;add one ',' to __IData, initial "__IData" before ','s will be used to call macro macro __IDataBlock ;begin macro (or overload old one) which holds data inside "idata" block arg } macro udata arg { __UData equ __UData, macro __UDataBlock arg } ;include all "idata"-defined blocks macro IncludeIData { macro __IData dummy,[n] ;create macro which will be invoked, [n] makes sure macro's forward will \{ ;be preprocessed for each ',' added to __IData \forward __IDataBlock ;use the macro with data purge __IDataBlock ;and remove it so previous macro becomes avilable \} match I, __IData \{ I \} ;and now unroll __IData macro (just "__IData" wouldn't do, replaced equate isn't ;preprocessed anymore and so it wouldn't beheave as macro usage) purge __IData ;__Idata macro is not needed anymore } ;include all "udata"-defined blocks macro IncludeUData ;... same as IncludeIData but it is whole in virtual to count size and define labels { ;and then required space is reserved macro __UData dummy,[n] \{ \common \local ..begin, ..size ..begin = $ virtual at $ \forward __UDataBlock purge __UDataBlock \common ..size = $ - ..begin end virtual rb ..size \} match U, __UData \{ U \} purge __UData } ;use both macros at least once idata{} udata{} if you don't want these macros at all, then just copy-pase itoa.digits db '0123456789ABCDEF', 0 line into you data section :] |
|||
09 Aug 2006, 10:49 |
|
Kenny80 09 Aug 2006, 11:10
my mistake i read wrong, dosen't complain about idata it complains about line below idata the "digits db '0123456789ABCDEF',0" and error is "unexpected characters." , i haven't modified source more than changing inc files, removed a extra.inc since i don't have it and added fasmlib,inc instead, since same author who made source and fasmlib.inc!
sorry for being such pain in ass but really need to know how, make my life bit easier |
|||
09 Aug 2006, 11:10 |
|
shoorick 09 Aug 2006, 11:18
you may just place this string li procedure body:
Code: .. mov ebx, .digits .. jmp .theend .digits db '0123456789ABCDEF' endp 16 bytes in code section will not change weather and even could work faster |
|||
09 Aug 2006, 11:18 |
|
vid 09 Aug 2006, 12:10
Quote: if i remove the idata section then it will end up in .code section which is wrong! why? it probably won't be faster (there is different cache for code and for data i think), but it is commonly used... |
|||
09 Aug 2006, 12:10 |
|
okasvi 09 Aug 2006, 12:31
FlatAssembler ...
My apps usually have nothing but '.flat' section made by default if no sections specified |: edit: uh, did re-read my post and point of it isnt clear I think. I would include digits inside proc with jmp .over / .digits db '...',0 / .over: |
|||
09 Aug 2006, 12:31 |
|
shoorick 09 Aug 2006, 12:48
btw, what a sense in termination zero here
|
|||
09 Aug 2006, 12:48 |
|
vid 09 Aug 2006, 14:49
yeah, and what a waste of byte
that 0 has uncountable advantages... for example when you loose your source andwant to get it back from binaries using IDA, you just have to push 'a' instead of complicated block manipaluation. Not mentioning that ending string with 0 conforms so many standards, and it lessens chance of reading instruction as data... |
|||
09 Aug 2006, 14:49 |
|
Kenny80 10 Aug 2006, 18:49
vid wrote:
write wrong was bit to strong word for what i meant, my point is that if i want change value then it won't work since it's in .code section, of course i can change .code section to allow it but i like to have all stuff in correct section hehe, ya i'm annoying but that's how i like it i don't want or need a lection in why just simple how thank you! |
|||
10 Aug 2006, 18:49 |
|
vid 11 Aug 2006, 06:25
well, then idata/udata macros are here just for you
|
|||
11 Aug 2006, 06:25 |
|
Kenny80 11 Aug 2006, 09:07
Lets try this last time shall we!
Code: idata
itoa.digits db '0123456789ABCDEF'
endg do anyone of u see anything wrong with above line, as i look at it i don't see any error with it, any typo error or missing char / to many char somewhere? since fasm still complains about line that there is a "unexpected char", but where is it?? pure simple question, as all i want is a simple answer if there is a error, please type a working "this is how it should be" example then! and not off topic answer about my ending zero or why your mom have big panties! (yes this is of topic sorta) i give you exampl,e lets say you are late for work and you can't get your car to start, you call mechanic then you don't want 20 min long explanation why your car dosen't start, you only want the answer for the fix or if he can fix it! ok now u know my position here haha, just simple answer and i deal with rest why it happend so on! i noticed if you ask long question then u will get even longer answer, guess keep it short if you don't have all day reading! |
|||
11 Aug 2006, 09:07 |
|
vid 11 Aug 2006, 09:28
this is how it should be:
Code: idata { itoa.digits db '0123456789ABCDEF' } PS: all ideas here are worth of reading, and you should show little more thank for helping. You will be surprised, but you are not only one who has little time. And still we spend our time helping people like you, so waste some of precious time thinking about it |
|||
11 Aug 2006, 09:28 |
|
Kenny80 11 Aug 2006, 18:48
ya you right, just me who was bit pissed on problem, thx for all help, couldn't done it without you all!
cheers! |
|||
11 Aug 2006, 18:48 |
|
0x4e71 11 Aug 2006, 19:36
vid wrote:
Fully subscribe to that. <rant> Years ago I decided to reverse my favorite assembler in order to improve it and fix some of its horrible bugs. To my "delight" I discovered that instead of using "0", this program marked string termination by setting the 8th bit of the last character in the string (since the move instruction on that CPU affected the flags too, this technique allowed very "clever" and compact string manipulation code). This fact alone provided several hours of "fun" (not) plus the need to write a bunch of ad-hoc mini programs just to descramble all string data.... time you can better spend doing other stuff! </rant> |
|||
11 Aug 2006, 19:36 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.