flat assembler
Message board for the users of flat assembler.
  
|  Index
      > Windows > My fasm hello world; how to do sectionless variables? | 
| Author | 
 | 
| cod3b453 07 Feb 2010, 00:10 Change
 Code: pbuffer dd 0 readcount dd 0 writecount dd 0 to Code: pbuffer rd 1 readcount rd 1 writecount rd 1 these will then be allocated at run time (zeroed) Last edited by cod3b453 on 07 Feb 2010, 00:29; edited 1 time in total | |||
|  07 Feb 2010, 00:10 | 
 | 
| mindcooler 07 Feb 2010, 00:16 Excellent, thank you.
 If I need initialized variables, how can I avoid allocating an entire section for them? Is initalization by code the way to go? | |||
|  07 Feb 2010, 00:16 | 
 | 
| LocoDelAssembly 07 Feb 2010, 00:26 cod3b453, actually you should use "1" instead of "0".
 I recommend to also change pbuffer to "buffer rb _buffer" (no longer a pointer) and not use VirtualAlloc anymore. | |||
|  07 Feb 2010, 00:26 | 
 | 
| cod3b453 07 Feb 2010, 00:28 Sorry yes I forgot to change the values, thanks LocoDelAssembly    | |||
|  07 Feb 2010, 00:28 | 
 | 
| windwakr 07 Feb 2010, 00:33 mindcooler wrote: Excellent, thank you. I think FASM includes an example that has data and code in the same section, I think it's the "Beer" one. | |||
|  07 Feb 2010, 00:33 | 
 | 
| mindcooler 07 Feb 2010, 00:54 LocoDelAssembly wrote: cod3b453, actually you should use "1" instead of "0". Ah, letting the loader do the job for me! _________________ This is a block of text that can be added to posts you make. | |||
|  07 Feb 2010, 00:54 | 
 | 
| mindcooler 07 Feb 2010, 00:56 windwakr wrote: 
 Yes, it keeps constant data at the end of the code segment, but it fails for variable data. Thinking allocating zeroed space and copying constants to it might be a good idea. _________________ This is a block of text that can be added to posts you make. | |||
|  07 Feb 2010, 00:56 | 
 | 
| < Last Thread | Next Thread > | 
| Forum Rules: 
 | 
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.