Hi guys I'm new programming in Assembly.
I am trying to create a subroutine that convert a value in a Variable into an string, so in order to accomplish that I need to get the size of the variable first, so can some body tell me how can I do it in FASM?
Let say for example I have this code:
section '.data' data readable writeable
mainhwnd dd 0 ; handle of window
hinstance dd 0 ; handle of module
Eightbits db 1
Sixteenbits dw 2
Fourtyeightbits dp 6
Sixtyfourbits dq 8
Eightybits dt 10.0
How can I find out with code how many bytes are used by the Eightybits varaible?
Thanks for your help!
Alonso
I am trying to create a subroutine that convert a value in a Variable into an string, so in order to accomplish that I need to get the size of the variable first, so can some body tell me how can I do it in FASM?
Let say for example I have this code:
section '.data' data readable writeable
mainhwnd dd 0 ; handle of window
hinstance dd 0 ; handle of module
Eightbits db 1
Sixteenbits dw 2
Fourtyeightbits dp 6
Sixtyfourbits dq 8
Eightybits dt 10.0
How can I find out with code how many bytes are used by the Eightybits varaible?
Thanks for your help!
Alonso
That is not possible to do dynamically at runtime without storing additional information - for Eightybits is only an address and it is the programmer that decides what to do with it - the data there can be interpreted in many ways. If this response is lame then I do not understand what you wish to do. ;)
That is not possible to do dynamically at runtime without storing additional information - for Eightybits is only an address and it is the programmer that decides what to do with it - the data there can be interpreted in many ways. If this response is lame then I do not understand what you wish to do. ;)
Thanks your reply.
What I am trying to do is a routine that you do not need to be tell what is the size of the variable (it most be detected automaticly), there have to be a way other wise how can you do this:
push ; how does FASM knows that it have to push 1 byte of data into the stack?
Thanks for your help again!!:)
push ; how does FASM knows that it have to push 1 byte of data into the stack?