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
56
votes
1 answer

Where to learn x64 assembly from?

Okay so I know C++, C#, Java and some other languages and I decided to learn assembly next but I feel like I've hit a solid brick wall right from the start. I just need someone to point me in the right direction. Here are the questions: I've been…
AlanKalane
  • 981
  • 1
  • 8
  • 17
38
votes
5 answers

A good NASM/FASM tutorial?

Does anyone know any good NASM or FASM tutorials? I am trying to learn assembler but I can't seem to find any good resources on it.
Callum Rogers
  • 15,630
  • 17
  • 67
  • 90
37
votes
1 answer

ASM: MASM, NASM, FASM?

I have done ARM assembly programming and I would like to learn the Intel Assembler. I keep hearing all these different F/M/N/ASMs mentioned- but I am unsure how they related to what I wish to achieve? Could somebody please help me identify what I…
user997112
  • 29,025
  • 43
  • 182
  • 361
16
votes
2 answers

Loop with function call faster than an empty loop

I linked some assembly with some c to test the cost of a function call, with the following assembly and c source (using fasm and gcc respectively) assembly: format ELF public no_call as "_no_call" public normal_call as "_normal_call" section…
rtpax
  • 1,687
  • 1
  • 18
  • 32
15
votes
2 answers

How to write to the console in fasm?

I'm exceptionally new to assembly. I only picked it up yesterday and I've looked through many examples and still can't figure out for myself how to write to the console. I always get an error when I seem to replicate it in my own way.
codinggoose
  • 151
  • 1
  • 1
  • 3
13
votes
2 answers

Hanging of XShmPutImage event notification

I am using XShm extension to draw and manipulate images in Linux. In order to not have screen flickering, I am passing send_event = TRUE to XShmPutImage and then waiting for the event with XIfEvent, immediately after the call to XScmPutImage. This…
johnfound
  • 6,857
  • 4
  • 31
  • 60
8
votes
2 answers

Why does this code crash with address randomization on?

I am learning amd64 assembler, and trying to implement a simple Unix filter. For an unknown reason, even simplified to the bare minimum version (code below), it crashes at random. I tried to debug this program in GNU Debugger (gdb). In the default…
KAction
  • 587
  • 2
  • 10
8
votes
1 answer

Switch from protected mode to real mode in a DOS EXE program

I learned to switch to protected mode with a simple DOS based bootloader. This loader loads kernel.bin into a buffer and copies the buffer to 100000h (kernel is 8KiB). Control is then transferred to the kernel. When I return from the kernel and…
micheal007
  • 137
  • 9
7
votes
2 answers

Is it possible to wake up intel cores with INIT-SIPI-SIPI sequence with all cores in real mode?

I'm using DOS to boot up and start my application test.exe. This program starts the BSP (Bootstrap Processor) in real mode and accesses the APIC table at FEE0:0000 to enable the SVI (Spurious vector interrupt) at offset 0x0F0and send an…
vitor alho
  • 71
  • 3
6
votes
1 answer

How to debug programms written in fasm under linux using gdb?

I wrote simple "hello, world" in fasm, and its works, but how i can generate debug info for gdb and edb (Evan's Debugger)? Fasm compiler could only produce debugging symbols in its specific format - "fas", which of course gbd couldn't understood.
user210129
5
votes
2 answers

Creating named variables in the stack

Is there any way to create named variables in the stack rather refer to them by offset: sub esp, 0x10 ; 4 variables of 4 bytes mov DWORD [ebp-4], 0xf ; 1st var mov DWORD [ebp-8], 0xff ; 2nd var ; and so on
Kevin
  • 281
  • 2
  • 12
5
votes
4 answers

Print string using INT 0x10 in bootsector

I want to create printl function that allow me to print string in the ax register. I am in 16-bit real mode and I can not find any way to print a message. I using int 0x10 to print a single letter. I try pass argument (string to print) in bx…
vakus
  • 732
  • 1
  • 10
  • 24
4
votes
0 answers

FASM executables & AV false positives

I'm currently working with FASM to compile Windows executables. However, I have noticed that there is a high rate of AV false positives, which I'm trying to understand and resolve. My approach is to create a minimal executable and try to "fix" the…
bytecode77
  • 14,163
  • 30
  • 110
  • 141
4
votes
2 answers

Initializing array in assembler

I just started learning ASM, I have C experience but I guess it doesn't matter. Anyway how can I initialize a 12 elements array of DT to 0s, and how not to initialize it? I use FASM.
adad
  • 41
  • 1
  • 2
4
votes
1 answer

memcmp ignores characters at odd positions

I am calling memcmp from fasm (version 1.71.51) code, and I obtain strange results. It seems like memcmp only compares characters that are at odd position. Code: format ELF64 section '.text' executable public _start extrn memcmp extrn…
real
  • 639
  • 1
  • 6
  • 15
1
2 3
23 24