flat assembler
Message board for the users of flat assembler.

Index > Main > New section for special cases.

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1701
Roman 18 Aug 2023, 16:59
We have data section, code section, section '.bss'
But not have cases section.

What i mean:
Code:
include 'macros.txt' ;some part push to section cases
include 'data.txt'     ;some data push to section cases

section code
 ...
section data
 ...
section cases
 ...
    


For example
Code:
;if comment include 'data.txt' section cases it will become empty.
include 'data.txt'     ;some data push to section cases

section code
 ...
section data
 ...
section cases          ;this section fill auto(not hands) from another places code
 rept x_dat { dd 0 }   ;this auto push from 'data.txt'
    
Post 18 Aug 2023, 16:59
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 913
Location: Russia
macomics 19 Aug 2023, 10:14
And where did you find this in the MZ/PE/PE64 format?
If you need it so much, then no one prevents you from allocating a section through VirtualAlloc and writing code that performs these actions (placing data in it from data.txt).

After all, there is a mapping file.
Post 19 Aug 2023, 10:14
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1701
Roman 19 Aug 2023, 10:26
Quote:

If you need it so much, then no one prevents you from allocating a section through VirtualAlloc and writing code that performs these actions (placing data in it from data.txt).

This not good for Macro and preprocessing.
Post 19 Aug 2023, 10:26
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 913
Location: Russia
macomics 19 Aug 2023, 18:21
Code:
include 'macros.txt' ;some part push to section cases
include 'data.txt'     ;some data push to section cases

section code
 ...
section data
 ...
virtual at rbx ; section cases
 ...
end virtual    
Post 19 Aug 2023, 18:21
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1701
Roman 19 Aug 2023, 19:35
Not understood how i could from include 'macros.txt' or section code
push code in virtual at rbx ; in section cases ?

I know this:
Code:
;first describing virtual
virtual at ebx
 label1 dw ?
label2 dd ?
end virtual
;than using in code
mov ax,[label1] ;will be assembled mov ax,[ebx]

    
Post 19 Aug 2023, 19:35
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 913
Location: Russia
macomics 19 Aug 2023, 21:23
Roman wrote:
Not understood how i could from include 'macros.txt' or section code
push code in virtual at rbx ; in section cases ?

I know this:
Code:
;first describing virtual
virtual at ebx
 label1 dw ?
label2 dd ?
end virtual
;than using in code
mov ax,[label1] ;will be assembled mov ax,[ebx]

    
For example:
Code:
macro push_cases { push_cases_label: virtual at rbx } ; from macros.txt
include 'macros.txt' ;some part push to section cases
include 'data.txt'     ;some data push to section cases

; from data.txt
macro push_cases {
    push_cases
    cases0 dd 1000 dup (0) ; ...
}
; ---- end data.txt ----

section code

  lea rbx, [push_cases_label]
  mov eax, [cases0 + 15 * 4]
 ...
section data
 ...
; virtual at rbx ; section cases
 push_cases
end virtual    
Post 19 Aug 2023, 21:23
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1701
Roman 20 Aug 2023, 08:22
Virtual in data section looking like as rd in bss section.

If I want from code add news values?
If I do macro New I apply New value.
If I not in code using macro New I not gets any values.

Using in macro new equ counter+1 ?


Quote:

section data
...
; virtual at rbx ; section cases
push_cases
end virtual

You writed this hands , i want auto fill(not hands)
Post 20 Aug 2023, 08:22
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.