flat assembler
Message board for the users of flat assembler.
Index
> Main > Align section .bbs or import ? Goto page Previous 1, 2 |
Author |
|
macomics 05 Mar 2024, 18:34
Thanks.
I tested it again. Indeed, this is my mistake. Heap continues to work. And further memory allocation is possible. |
|||
05 Mar 2024, 18:34 |
|
Roman 05 Mar 2024, 18:41
After section .bss I write this:
Code: section '.code' code readable writeable executable some data Start: main code Directx11 call renderToTexture section '.bss' readable writeable all_data rb 610 mb ;add new section and now work fine. section '.text' code readable writeable executable include 'procs\renderToTexture.txt' Now render fine character. And what is mean ?! Fasm bug or some sections have limit size ? |
|||
05 Mar 2024, 18:41 |
|
macomics 05 Mar 2024, 19:13
There are two sections of code in your example. Two sections containing the code cannot be specified in the PE format. There are only 16 available sections and they have their own purposes. You have set two sections of the code. I suspect that fasm simply overwrites the code section of the second one without an error message.
To prevent this, I usually use the following macro Code: macro .code aim=main { purge .code macro .code var& \{ err \} section '.text' code readable executable entry aim } If you call such a macro twice, the second call will generate the err directive Code: struc PE64_OPTIONAL_HEADER { ; ... .DataDirectory PE32_DATA_DIRECTORY ; <- sections repeat PE32_NUMOF_DIR_ENTRIES - 1 db .DataDirectory.Length dup ? end repeat } Code: struc PE32_SECTION_HEADER { .: .Name db PE32_SIZEOF_SHORT_NAME dup ? .VirtualSize dd ? .VirtualAddress dd ? ; Later, there is a comparison by virtual address .RAWSize dd ? .RAWPointer dd ? ; or raw pointer .pRelocations dd ? .pLinenumbers dd ? .cRelocations dw ? .cLinenumbers dw ? .Characteristic dd ? .Length = $ - . } In general, you can see everything in the debugger and understand where and what is wrong. Try running the game in the debugger, rather than simply executing it with an error message. |
|||
05 Mar 2024, 19:13 |
|
Roman 05 Mar 2024, 19:46
Practices show me my variant.
Now my render to texture work right. How should be ! On characters i out put render from texture. I need do variance shadow map(blurred shadows) and need render to texture for post processing. https://rutube.ru/video/39f494afdb7700443c700775cc198b7d/?r=plemwd Last edited by Roman on 05 Mar 2024, 19:52; edited 2 times in total |
|||
05 Mar 2024, 19:46 |
|
macomics 05 Mar 2024, 19:50
As you wish. I warned you. If your program stops loading in Win 11 and later because of some new check for the presence of unnecessary section headers, then you will deal with it later.
|
|||
05 Mar 2024, 19:50 |
|
Roman 05 Mar 2024, 19:51
Quote: If your program stops loading in Win 11 and later because of some new check for the presence of unnecessary section headers, then you will deal with it later. Maybe it will happen. |
|||
05 Mar 2024, 19:51 |
|
Roman 06 Mar 2024, 06:03
This code compiled
Code: section '.bss' readable writeable org 500000h ;all_data rb 610 mb gltf_names = 60000 gltfMapKeyNamesOfst rd 1 gltfMapKeyNames rb 64*gltf_names gltflvlData rd 8000000 ;in hear load file gltflvlDataCountrOfst rd 1 gltflvlDataCountr rd 1*gltf_names gltflvlDataEnd: lvl.bin size 36 mb But my load File proc write file lvl.bin not loaded! Whithout org, file load normal. GetLastError show 0x03e6 (Invalid Access to Memory Location). File name correct 'lvl.bin',0 ReadFile() Error 3e6 (Invalid Access to Memory Location) Why?! I try do this code in another project and all work fine ! File load fine with org 500000h Maybe i found some interesting bug in my game code ! |
|||
06 Mar 2024, 06:03 |
|
Goto page Previous 1, 2 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.