Questions tagged [fasm]

The Flat ASseMbler (FASM) is a fast and efficient self-assembling x86 assembler for DOS, Windows and Linux operating systems.

Flat assembler is a fast assembly language compiler for the x86 architecture processors, which does multiple passes to optimize the size of generated machine code. It is self-compilable and uses intel syntax.

There are versions for Windows, DOS, Linux and other Unix-like operating systems. The DOS and Windows versions also include an editor with integrated syntax-highlighting to edit, compile and execute programs from one place.

This tag should also be used for posts that do not relate directly to FASM, but make extensive use of language features and FASM-specific macros.

Related tags:

  • The more general for posts in assembly language, including
    • for 16-bit programming
    • for 32-bit programming
    • for 64-bit programming

Further links:

350 questions
2
votes
0 answers

DOS allocation error when I try to run my FASM program

I have a problem with some code. It's a part of my own OS that I want to build in the future and share on SourceForge. I have two assembly files: gdos.asm, the kernel. And... vga.asm, my own VGA driver. Everything works correctly in DOSBox. But…
micheal007
  • 137
  • 9
2
votes
2 answers

External procedure in FASM

I have been trying to export procedure from external file to the main assembly program, but it didn't work. Here is test code from external file: ; Export procedure Summa format PE GUI 4.0 include 'win32a.inc' section '.code' code readable…
Dgek
  • 21
  • 4
2
votes
1 answer

FASM assembly program waits before exiting

This is the code that I use with FASM: format PE console entry main include '..\MACRO\import32.inc' section '.data' data readable writeable msg db "привіт!",0dh,0ah,0 ;hi lcl_set db ? section '.code' code readable executable main: ;fail without…
2
votes
1 answer

Sum using XMM registers using FASM under Linux OS

Sum using xmm regsisters using fasm - linux: $./fasm file.asm $ gcc -s file.o -o file -lm The result should be 14 , but I got 7.000000000000000000000000000000. This is the source code: format elf64 extrn printf section '.data' writeable align…
2
votes
1 answer

Gnu Assembler (GAS) Optimizations

Im actually learning assembly and I went with Gas, but the problem is: 1) I only know Intel syntax and I saw in a page Gas with intel syntax is not very good optimized in some cases. Is this correct or im wrong? Im talking about this web:…
Adrian
  • 21
  • 2
2
votes
2 answers

Option Rom code failing to print intended string using Qemu Emulation

Been trying to test out a simple ISA Option Rom program compiled with either FASM or NASM that just prints out a simple 'Hello World' message. Problem is instead of the string being printed I get a couple unexpected characters when testing it out in…
2
votes
1 answer

Simple FASM "Hello world!" crashes on DOS interrupt

In my high-school homework I have to write a program, that uses DOS Interrupts to input and output strings instead of std printf/scanf But when I attempting to run this program: format ELF use16 section '.data' writeable msg db 'Hello, world!',…
Pavel Shishmarev
  • 1,335
  • 9
  • 24
2
votes
1 answer

Addition of two numbers from user input using FASM

I have successfully got the user's input and placed into bl and bh, but when i attempt to add them together, the result is not in decimal form even if I already added '0' to the result. Any ideas on how to solve this problem? Thanks org 100h mov…
2
votes
1 answer

Getting invalid image when adjusting example DLL code

I took an example code that creates a simple DLL from FASM examples directory and am adjusting it to my needs. However, when I do some (innocent from my POV) changes, the generated binary file gets corrupted - running an exe that uses this library…
arrowd
  • 33,231
  • 8
  • 79
  • 110
2
votes
1 answer

To what format do you assemble or compile OS source code?

When writing kernels and OSes in general, whether it be in assembly or something higher level, you need to assemble or compile your code in flat binary, right? You can't assemble it or compile it to anything like ELF format or anything like that,…
matrix
  • 21
  • 4
2
votes
2 answers

Assembly pass pointer to function

I'm trying to sent DWORD variable into function as pointer paramater variable1 dd 1 ... push [variable1] ; push variable adress call _InitPoiner ... _InitPoiner: ; push ebp mov ebp, esp ; lea eax, [ebp+8] ; load address …
Alatriste
  • 527
  • 2
  • 6
  • 21
2
votes
1 answer

About declaring and initializing a structure in Fasm assembly

I've read the documentation of Fasm, but I can't figure out this. In Nasm I'd first declare a struct in ".bss" and then define it in ".data": section ".bss" struc my_struct .a resw 1 .b resw 1 .c resb 1 .d…
Torito
  • 305
  • 1
  • 11
2
votes
0 answers

Understanding division in FASM assembler: What happens when huge number is divided by tiny number?

I'm trying to understand how the division instruction in FASM works. If I get it right then it expects the value to divide in the register (e)dx and (e)ax. See accepted answer here: Assembly Language - How to Do Modulo? After the operation the…
cluster1
  • 4,968
  • 6
  • 32
  • 49
2
votes
2 answers

How to add FASM support to CMake

does anyone know how to add FASM support to CMake? I've tried an original guide here , but it doesn't work for me.
alexfsx
  • 125
  • 2
  • 10
2
votes
2 answers

Is it possible to view FASM preprocessor output?

I'm using fasm to compile a dll that uses macros shipped with fasm, i would like to see what the output is after the preprocessor stage but before the binary stage. Is there any way to see this? I would like to quickly see what is being generated to…
Ronan Thibaudau
  • 3,413
  • 3
  • 29
  • 78