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

How to compare two strings in x86 assembly with FASM?

I want to compare the user input stored in the register si with another string. By the way, I'm using FASM. Here's my code so far after the user input. If I'm using the repe cmpsb command, I know that I have to use the extra segment, but I don't…
user8495585
4
votes
2 answers

FASM vc MASM trasnlation problem in mov si, offset msg

just did my first test with MASM and FASM with the same code (almos) and I falled in trouble. The only difference is that to produce just the 104 bytes I need to write to MBR in FASM I put org 7c00h and in MASM 0h. The problem is on the mov si,…
Ruben Trancoso
  • 1,444
  • 5
  • 27
  • 55
4
votes
2 answers

Local variable structure FASM

So I was reading the manual on how to create structures.. At first, I did: struc point X, Y { .X dw X .Y dw Y } section '.code' code readable executable main: push ebp mov ebp,esp PP Point 0, 0 ;Crashes here.. mov esp, ebp …
Brandon
  • 22,723
  • 11
  • 93
  • 186
4
votes
0 answers

JIT Assembler for C# language

I'm writing a memory editing library and I'm interested in writing asm code on the fly in C#. I especially like FASM, so I found a library called Fasm_managed that can assemble my x86 asm code on the fly. Now, I'm hurting a problem, I need to…
user2128817
4
votes
3 answers

x86 Assembly: movsd instruction issue

This is my problem: I trying to use scanf (in msvcrt.dll) to input a single floating point value in flat assembler then I write a simple "scanf program" like this (in C): #include int main() { float a; scanf("%f", &a); …
Bình Nguyên
  • 2,252
  • 6
  • 32
  • 47
4
votes
1 answer

About assembler far calls and the heaven's gate, do segment calls that trigger an exception push cs and eip BEFORE the exception is thrown?

Currently i'm playing with the windows/WOW64 trick known as "the heaven's gate", which, as some of you will probably know, allows us to enter x64 mode even though in a x86 program (i was so amazed when i tested it and it worked!) But i know it is…
nts94
  • 41
  • 3
3
votes
1 answer

Printing out registers/ints to console | FASM | WINAPI

Just wondering if there was a way i could print out a number to the console by invoking. it can be either base 10, or hex I don't mind. I would like to see the format in which some functions return. I would prefer not to do it the long way using…
Fio
  • 79
  • 7
3
votes
2 answers

Harnessing AsmXML with Delphi

AsmXML written by Marc Kerbiquet seems to be promising as an xml parser. I want to harness it further with Delphi but I stumble because of an object format compatibily issue. Is it possible to tweak the fasm source code to fix the trouble or should…
menjaraz
  • 7,551
  • 4
  • 41
  • 81
3
votes
1 answer

x86 Assembly How to properly get XMM0 into ST0?

A wonderful Sunday everyone. I am currently learning a lot of assembly in the 32-bit environment (currently Windows). I am using FASM for this. I have the following code which I successfully made but I'm quite unhappy with the way I load XMM0 into…
Zvend
  • 33
  • 3
3
votes
1 answer

Qemu is infinitely rebooting when setting GDT

I am making an OS mostly in C++, but for the bootloader, I'm using FASM. When I try to set the GDT, Qemu clears the screen and re-prints "SeaBIOS" at the top. It continues in a loop like that until I close it. Here is a gif of it: I tried running…
Lysander Mealy
  • 113
  • 1
  • 6
3
votes
1 answer

How do i write and execute FASM code in VS Code

At the University where I study, we are taught Assembly language. My teacher told us to use Fasm,but I would like to use visual studio code to write programs. I downloaded the Retro Assembler extension, but it tries to find the file…
DerzkeyBK
  • 165
  • 1
  • 9
3
votes
5 answers

FASM write Hello World to console with NO includes or dependencies at all

I've seen How to write hello world in assembler under Windows? and Writing hello,world to console in Fasm with DOS How to write to the console in fasm? I've tried / seen code like this MASM example from this answer ;---ASM Hello World Win64…
3
votes
1 answer

How to disassemble fasm-generated binary?

I am writing program in FASM assembler, and want to see what code is generated after all macro expansions. One usually can disasseble binary with objdump -d, but for binary, generated by fasm, it outputs only following: $ cat true.fasm format ELF64…
KAction
  • 587
  • 2
  • 10
3
votes
2 answers

Virtual Machine implemented in assembly on an x86

I was just wondering if anybody here has written or knows where I can find a simple virtual machine written in x86 assembly, preferably Fasm, but anything would serve as an example as long as it is simple or at least well commented. Thank you in…
3
votes
0 answers

Moving the contents of a register into a variable

I would need to move the contents of a register into a variable. This works: mov [a], 8 ; it's a random value (8), just for example. However, this does not work: mov eax, 8 mov [a], eax I have searched the documentation, but found nothing…
Foxy
  • 980
  • 8
  • 17
1
2
3
23 24