flat assembler
Message board for the users of flat assembler.

Index > Main > data moved with 2 different outputs of .exe

Author
Thread Post new topic Reply to topic
dosin



Joined: 24 Aug 2007
Posts: 337
dosin 07 May 2009, 16:12
Format MZ
when I move all the data down to the jmp $
it compiles to 10.4 kb .exe in this one
This is the end of the file:
Code:
      mov  esi,endmsg 
      call print_string 

      
      jmp   $ 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
;       data       <------------------------here 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
include 'errors.inc' 
include 'keymaps.inc' 
include 'Fddinfo.inc' 
include 'msg.inc' 
include 'fat.inc' 

temp_buff:   rb 0x1000 
buffer_area: rb 0x10000 
buffer:      rb 512
    


and when I put jump over it in the middle of the file:

Code:
jmp inc_over2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
;       data  
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
include 'errors.inc' 
include 'keymaps.inc' 
include 'Fddinfo.inc' 
include 'msg.inc' 
include 'fat.inc' 

inc_over2:
    


it compiles to a 22.9 kb .exe
The data is not change,, just moving the strings and data
around in the .asm file..

can anyone explain why this happening???
Post 07 May 2009, 16:12
View user's profile Send private message Reply with quote
r22



Joined: 27 Dec 2004
Posts: 805
r22 07 May 2009, 17:08
Maybe your include(s) contain 12.5KB of "R"eserved data that is forced to be allocated when it's in the middle of the section, but not at the end of the section (where reserved data belongs).
Post 07 May 2009, 17:08
View user's profile Send private message AIM Address Yahoo Messenger Reply with quote
dosin



Joined: 24 Aug 2007
Posts: 337
dosin 07 May 2009, 17:13
Is this a bug?

or is there something I am missing?
Post 07 May 2009, 17:13
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20516
Location: In your JS exploiting you and your system
revolution 08 May 2009, 01:09
11kB
Code:
jmp There
rb 11 shl 10
There: ret    
1B
Code:
ret
rb 11 shl 10    
Post 08 May 2009, 01:09
View user's profile Send private message Visit poster's website Reply with quote
dosin



Joined: 24 Aug 2007
Posts: 337
dosin 08 May 2009, 01:41
Quote:

ret
rb 11 shl 10


shouldn't it be the same?
I have noticed this happening
but I am not sure why?
Post 08 May 2009, 01:41
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20516
Location: In your JS exploiting you and your system
revolution 08 May 2009, 05:31
rb is uninitialised data. It is not put into the file unless there is some initialised data that follows it. Not a bug, intentional.
Post 08 May 2009, 05:31
View user's profile Send private message Visit poster's website Reply with quote
dosin



Joined: 24 Aug 2007
Posts: 337
dosin 08 May 2009, 06:38
Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  
;       data   
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  
include 'errors.inc'  
include 'keymaps.inc'  
include 'Fddinfo.inc'  
include 'msg.inc'  
include 'fat.inc'  

 

    

in these files are data

example: db "Some String",0
number: dd 0
ect....

not rb

and the includes that do not use the rb,, these are the ones being moved..
and the exe is changing size
Post 08 May 2009, 06:38
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20516
Location: In your JS exploiting you and your system
revolution 08 May 2009, 08:49
I expect your 'fat.inc' has some uninitialised data at the end.
Post 08 May 2009, 08:49
View user's profile Send private message Visit poster's website Reply with quote
dosin



Joined: 24 Aug 2007
Posts: 337
dosin 08 May 2009, 15:46
you are right! Thanks revolution...
I was looking at everything but that... Embarassed
Post 08 May 2009, 15:46
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.