flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > Suspicious Weird 16 bit output in FASM 1.68

Author
Thread Post new topic Reply to topic
_santa



Joined: 15 Dec 2009
Posts: 3
_santa 15 Dec 2009, 14:29
I tried to compile a simple bootloader using FASM 1.68 in Windows 7 Professional x64. It did not work. The code was ok, and I decided to disassemble the binary. The output was weird. I aksed my friend to compile the same code under Windows XP Professional 32 bit and disassemble it, the output was ok. I think FASM has some troubles with Windows 7 or 64 bit OSes.

Here I attach the source of the bootloader I tried to compile, my disassembler output (Win 7) and my friends disassembler output (WinXP).

Can anyone tell me what's happening??
I will be grateful if someone suggests a solution to fix this.


Description: My fiends disassembled listing of my source, compiled in Windows XP
Download
Filename: WinXP_disasm.txt
Filesize: 11.01 KB
Downloaded: 502 Time(s)

Description: My disassembled listing of my source, compiled in Windows 7 x64
Download
Filename: Win7_disasm.txt
Filesize: 11.04 KB
Downloaded: 480 Time(s)

Description: The source I tried to compile
Download
Filename: source.asm
Filesize: 184 Bytes
Downloaded: 460 Time(s)

Post 15 Dec 2009, 14:29
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20409
Location: In your JS exploiting you and your system
revolution 15 Dec 2009, 14:38
fasm is a 32bit program so a 64bit OS should have no effect on the output since the OS has to switch to a 32bit mode to run fasm anyway.

Since no one else has reported any such problems perhaps you might want to check your setup for AV interference (or maybe even some malware?). Other than that I can't think of a reason for you to get different outputs.
Post 15 Dec 2009, 14:38
View user's profile Send private message Visit poster's website Reply with quote
rCX



Joined: 29 Jul 2007
Posts: 172
Location: Maryland, USA
rCX 16 Dec 2009, 01:52
I think we'll have to wait for someone with 64-bit OS to test this. Just so everything's clear, it may be a good idea to post the command line used to assemble it and the resulting binary.
Post 16 Dec 2009, 01:52
View user's profile Send private message Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 16 Dec 2009, 07:21
I just tried it on Server 2003 (x64) and I got the WinXP_disasm.txt
I don't have a Win7 installation at hand right now, but I guess that the other listing comes from a different source.
Both FASMW 1.68 and 1.69 result the same binary. It is really odd that the Win7 one omits the "int" and just dumps hex 10 in there. Its like db 0x10 not int 0x10.

Are you *really* sure, its the same source? Smile
Post 16 Dec 2009, 07:21
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
_santa



Joined: 15 Dec 2009
Posts: 3
_santa 16 Dec 2009, 15:58
Answering your questions ...

Madis 731,
Yes, I'm absolutely sure that the source is the same. Recompiled the source 3 more times, the result is the same.

rCX,
I used a batch file to build the source... the command line looks like this: "C:\Program Files (x86)\FASM\fasm.exe" "C:\Users\Alex\Documents\Projects\KERNEL\Sources\boot\bootstrap.asm" "C:\Users\Alex\Documents\Projects\KERNEL\Cd-Rom\boot\bootstrap.bin"

I would appreciate if someone could test it on another windows 7 installation. It would be really nice. Until this i have no idea what causes this strange compilation and how to fix it.

revolution,
I've scanned my pc with AV, no malware nor potentially unwanted software found. The pc is virus-clear.
Post 16 Dec 2009, 15:58
View user's profile Send private message Reply with quote
_santa



Joined: 15 Dec 2009
Posts: 3
_santa 16 Dec 2009, 16:29
Recent tests showed that problem is only when using the command-line compiler fasm.exe, not fasmw.exe. I think it is a bit not logical coz fasmw.exe is only a front-end to fasm.exe and is not a separate compiler (or maybe I am mistaken), but the facts are that only command line compilers are affected. I tried the older version, fasm 1.64 and got the same odd output as before.

Any ideas how to fix it?
Compiling in fasmw is not a solution for me. Need command line tool.
Post 16 Dec 2009, 16:29
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 16 Dec 2009, 16:39
I've tried with a Windows 7 and replicating your paths as much as I could (the only difference is that I've used volume F).

Please try exactly what I'm uploading now to be sure we are both testing the same thing. I left a copy of my binary file (Loco.bin) so you can compare differencies.

PS: No, FASMW has the assembler built-in so you could percieve some differences.

PS2: Be sure to execute Make.bat at the very same location I did.


Description:
Download
Filename: Users.zip
Filesize: 2.05 KB
Downloaded: 392 Time(s)

Post 16 Dec 2009, 16:39
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.