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

Assembly- Calling function inside another i.e nested functions

I try to call windows function inside my custom assembly function The pseudocode would be something like: MYFUNC PUSH EBP PUSH WINDOWSFUNCTIONPARAMETER CALL [IMPORTEDWINDOWSFUNCTION] POP EBP RET So I know its safe to leave this like this if I call…
Pavulonix
  • 21
  • 2
2
votes
1 answer

How can I print the pressed keyboard key in Assembly bootloader?

I have created a small boot-able OS in Assembly, with Flat Assembler. I call it PulsarOS. However, I want to create a typing program for it. Like I said, it's all in x86 Assembly. I want it simply to where the user can type, and the typed text is…
2
votes
2 answers

Windows 64 ABI, correct register use if i do NOT call windows API?

As suggested to me in another question i checked the windows ABI and i'm left a little confused about what i can and cannot do if i'm not calling windows API myself. My scenario is i'm programming .NET and need a small chunk of code in asm targeting…
Ronan Thibaudau
  • 3,413
  • 3
  • 29
  • 78
2
votes
1 answer

Reading from memory in 8086 real mode while using 'ORG 0x0000'

I've been messing around with x86-16 assembly and running it with VirtualBox. For some reason when I read from memory and try to print it as a character, I get completely different results from what I was expecting. However when I hard-code the…
Matthew
  • 268
  • 1
  • 11
2
votes
3 answers

Putting Two ORGs Together

I'm building a boot loader that boots the content that is located at the 1000h part of the floppy. I was doing that using Fasm(because my friend only uses Fasm, and he was helping me with this), but I prefer to use Nasm, and now I'm having problems…
Nathan Campos
  • 28,769
  • 59
  • 194
  • 300
2
votes
1 answer

FASM: Calling Tangent from GCC

I don't know what the problem is because this works perfectly for SIN and COS. For TAN, it returns 0.0000 for 50.0 radian. But if I enabled the commented line, it works as expected. That's weird because TAN is supposed to return a double in XMM0,…
royalfinest
  • 155
  • 1
  • 8
2
votes
1 answer

Does FASM uses Intel Syntax?

I have tried compiling the following code in FASM: mov DWORD PTR [ebp - 4], 1234567 It gave me an "Invalid Expression" error. However the following code worked: mov DWORD [ebp - 4], 1234567 So does FASM uses Intel Syntax (I am assuming that the…
John
  • 1,049
  • 1
  • 14
  • 34
2
votes
1 answer

How to get double return value of atof() function (from msvcrt.dll) in assembly?

I want to convert string representing floating point number to double (64bit ieee754) and store the result of conversion in the register RAX from assembly (using FASM). First of all I included library to my main.asm: atof: jmp [imp_atof] section…
Pavel Sapehin
  • 988
  • 12
  • 23
2
votes
2 answers

How to set the bit in position?

mov al, 100d ; 01100100 shr eax, 1 ; cf = 0 ; 00110010 How to burn cf in 5th position? For example: My number 10000111. CF = 1 => 10001111 My main task is to make reverse byte using shr (shl). I want to do it myself, but I do not know…
ales
  • 45
  • 1
  • 5
2
votes
1 answer

How to set the DS and ES register equal to CS?

my problem is the following: I have a program that has its data and code together in the same segment (Code Segment). I want to use the ESI and EDI registers to compare a few strings, but they are in the Code Segement. The ESI and EDI registers are…
jhonny6721
  • 115
  • 9
2
votes
1 answer

How to develop with both Assembly and C/C++ on FASM?

So, I am developing an OS and for now I've been only writing code in assembly. I wish to continue making it with C/C++. The compiler/editor I use is FASM (for Windows). I've tried using MinGW with it, but it gives error when linking fasm's .o…
2
votes
2 answers

Assembler: Using "Flat assembler" how do I produce EXE files (compile, link..)?

I'm using FASM to compile a small piece of code: mov ah,4ch mov al,00 int 21h I click Run -> Compile, and what I get is a .BIN file. sorry for the noobish question but why don't I get an OBJ, or an EXE file, and what is this BIN?
Alon Amir
  • 4,913
  • 9
  • 47
  • 86
2
votes
2 answers

Can't add a section in FASM Syntax

I have some problem here with adding a section using FASM Syntax. I have checked on others websites and I am sure this is the right syntax. I must be missing something : format elf executable 3 entry start section '.text' readable…
user3102158
  • 173
  • 9
2
votes
1 answer

masm FPU to fasm FPU cannot translate and it does not work

I have this code in masm to deal with the FPU and it works great in this code I get a number from 2 different textboxes and then divide them and then output the results to another textbox this is the data that is local LOCAL variable1 :QWORD LOCAL…
Darrin Woolit
  • 69
  • 1
  • 7
2
votes
1 answer

Differences between Win32 FASM .inc files

What is the difference between the win32a, win32ax, win32axp, win32w, win32wx, and win32wxp .inc files in Flat Assembler? I tried to find it in the FASM documentation but I couldn't... Thanks in advance, The ChristonianCoder
ChristonianCoder
  • 295
  • 1
  • 10