flat assembler
Message board for the users of flat assembler.

Index > DOS > Error in compiled com image

Author
Thread Post new topic Reply to topic
keyoke



Joined: 18 Jun 2003
Posts: 56
Location: London
keyoke 25 Aug 2003, 07:50
Hi Privalov,
this is a example of the code i compile.

Code:
SumProc:

some intructions

someloop:
call someotherproc
jne someloop

ret

text db "somtext",0

someotherproc:

someother instructions

ret

    
1

now when i debug this type of example the call to the someotherproc
function works fine but the first intructions of the someotherproc procedure are compiled incorrectly almost like the defined bytes interfere with the first instructions in the procedure.
is this a error is compiler or what?
thanks for your help in advance.
Post 25 Aug 2003, 07:50
View user's profile Send private message Visit poster's website Reply with quote
wanderer



Joined: 18 Jun 2003
Posts: 44
Location: Moldova, Kishinev
wanderer 25 Aug 2003, 09:30
keyoke wrote:
now when i debug this type of example the call to the someotherproc
function works fine but the first intructions of the someotherproc procedure are compiled incorrectly almost like the defined bytes interfere with the first instructions in the procedure.
is this a error is compiler or what?
thanks for your help in advance.


If you mean that a wrong offset is generated in this instruction, then it's because you didn't place org 100h in the beginning of code. As you know, com files are loaded on offset 100h from segment start. The procedure call was generated correctly as there's relative offset in it, however it won't work for global variables for example.

_________________
Best regards,
Antoch Victor
Post 25 Aug 2003, 09:30
View user's profile Send private message Yahoo Messenger Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 25 Aug 2003, 09:40
It's probably an error of debugger - if it treats your data string as instructions and disassemble them, it might happen (an often happens) that it'll end with treating first bytes or real instructions that you put after the data block as the additional bytes for some not-really-existing instruction discovered in your data, and so the disassembly will be wrong.
Post 25 Aug 2003, 09:40
View user's profile Send private message Visit poster's website Reply with quote
keyoke



Joined: 18 Jun 2003
Posts: 56
Location: London
keyoke 25 Aug 2003, 10:29
Privalov,
I do use
Code:
org 100h
use16
    


to debug i use the ms-dos debug command would this disassemble the code incorrectly?
i have also tried turbo debugger to debug the code...
it seems like the debugger isnt disassembling the code directly???
i dunno maybe ill try disassembling it with ida to check wat comes up..
Post 25 Aug 2003, 10:29
View user's profile Send private message Visit poster's website Reply with quote
Yawgmoth



Joined: 20 Aug 2003
Posts: 37
Yawgmoth 25 Aug 2003, 11:44
Speaking of debuggers, when can we expect a FASM debugger?
Post 25 Aug 2003, 11:44
View user's profile Send private message Reply with quote
keyoke



Joined: 18 Jun 2003
Posts: 56
Location: London
keyoke 27 Aug 2003, 07:09
I think privalov has enough on his plate already.....with the fasm compiler, and all the documentation. So i think we should give him a bit of a break Wink maybe someone else will code a debugger for fasm. would be good Smile
Post 27 Aug 2003, 07:09
View user's profile Send private message Visit poster's website 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.