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

How to compare a strings which more than dword size in fasm?

I'm a new in assembly and trying to write something like file searcher. This snippet I using for compare with 4-letter mask (FASM): lea eax,[fd.cFileName] push eax call [lstrlen] cmp dword [fd.cFileName+eax-4],'.txt' ;…
user2750729
  • 43
  • 1
  • 4
0
votes
1 answer

Some questions about FASM

I am a newbie to the world of assembly and will like to ask some few questions about FASM before I waste my time and sanity in learning it. I read that FASM can output COFF .obj file. Can this .obj file be linked together with other .obj files…
MOHW
  • 737
  • 1
  • 11
  • 23
0
votes
0 answers

FASM concurrent increment and CPU load

I'm experimenting with FASM in order to improve my understanding of concurrency. I've created a program that has two threads each making some number of lock xadd. I run it on my Win7 64bit on i7 and I'm getting quite interesting results. While the…
Juriy
  • 5,009
  • 8
  • 37
  • 52
0
votes
1 answer

How to link the readline library to an object file?

I'm trying to use the GNU readline library in a program written in FASM. This is my assembly code: format elf64 public _start extrn readline section ".text" executable _start: push prompt call readline jmp _start section ".data" …
Aadit M Shah
  • 72,912
  • 30
  • 168
  • 299
0
votes
2 answers

Linked assembly subroutine doesn't work as expected

I'm writing a simple subroutine in FASM to print 32-bit unsigned integers to STDOUT. This is what I came up with: format elf public uprint section ".text" executable uprint: push ebx push ecx push edx push esi mov ebx, 10 …
Aadit M Shah
  • 72,912
  • 30
  • 168
  • 299
0
votes
1 answer

Detecting Key Events

I am having trouble trying to detect key events in the x86 assembly language. When I run my program, I get this generic error: key.exe has encountered a problem and needs to close. We are sorry for the inconvenience. fasm, my assembler, generates a…
user2097804
  • 1,122
  • 4
  • 13
  • 22
0
votes
2 answers

How to use large numbers?

How to use large numbers in? like 3441881739,30000000 etc mov eax,3441881739 In this case eax value is a negative number. How to fix it? split it? how? I need to do also add/sub/mul/div etc the cmp operation. Can someone explain and give an example…
The Mask
  • 17,007
  • 37
  • 111
  • 185
0
votes
1 answer

FASM: macro to display string

I want to create macro in FASM, which could directly print string (int DOS) like this: prints 'hey there!!!!' I have written such code: format MZ use16 stack 0x100 entry _TEXT@16:_start ; macro prints str { call @f db str, 0x24 @@: …
deathmood
  • 113
  • 6
0
votes
1 answer

Why does this given a seg fault?

I want to print argv[1] (in C terminallogy) from another routine and not from start routine(that's entry point). But it given a seg fault: format ELF executable 3 entry start segment readable executable start: pop ebx ;argc pop ebp…
Jack
  • 16,276
  • 55
  • 159
  • 284
0
votes
2 answers

x86 assembler cpuid output function parse result of registers

I make a fasm program with cpuid and the output is: EAX -> 0x00000662 EBX -> 0x00000000 ECX -> 0x00000000 EDX -> 0x0383FBFF I use fprint from /lib/ld-linux.so.2 to show this output. So I need to read all flags from EAX,... regs with some function…
0
votes
3 answers

How to use the FASM Console for Compiling

I am trying to make an assembly IDE that lets the user enter code and compile it with NASM, FASM, YASM, etc. However, since FASM comes with an IDE, I can't find any information on compiling with the console. For example, if I had a program test.asm,…
user1327203
0
votes
1 answer

Environment Variable - Startup Folder

Is there an Environment Variable for the startup folder. On XP it is located under C:\Documents and Settings(user)\Start Menu\Programs\Startup and on vista 7 it is under Appdata\Microsoft\Windows\Start Menu\Programs\Startup\ So I was wondering if…
Josh Line
  • 625
  • 3
  • 13
  • 27
0
votes
1 answer

FASM - Adding to Start Up HKCU

I am trying to make my FASM application add itself to the system start up by adding an entry in "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" I am using the following API's: RegOpenKeyExA RegSetValueExA RegCloseKey In advapi32.dll When my code is…
Josh Line
  • 625
  • 3
  • 13
  • 27
0
votes
1 answer

FASM - Simple: lstrcpy & lstrcat - Resulting strings are incorrect

I am trying to do a simple task in FASM that I have literally been struggling with for about two hours now. I have commented the code with the goal and the issue, but I will explain. I am trying to store the path to a specific file into a variable.…
Josh Line
  • 625
  • 3
  • 13
  • 27
0
votes
2 answers

How to excecute machine instructions in assembly language (intel)

If I had an instruction like 00010101 for example, and I had it in ram for programs to access, how would I be able to excecute that instruction in assembly language without using OS functions? I am using Fasm for intel. Thanks. EDIT: I know this is…
user1327203