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

Can not compile fasm file

I'm trying to compile asm-xml. But I'm getting the following error: error: illegal instruction. The affected line is: section '.asmdata' writeable Anyone could help me to fix this iisue? Thank you in advance, Greetings F
user897237
  • 613
  • 5
  • 12
  • 25
-1
votes
0 answers

Booting a custom BOOTx64.EFI file works in QEMU, but not on real hardware

I've recently found myself following this tutorial: https://johv.dk/blog/bare-metal-assembly-tutorial I've followed all steps, and my file boots fine using QEMU, but when I try to run it on my laptop (ASUS TUF Gaming F15 with Core i5-11400H, 16GB,…
-1
votes
1 answer

endianness doesn't affect writing but reading in memory

I've been reaching a conclusion that in both little endian and big endian. We write to memory from left to right so that means that the number 0x00FF will be written as the following in both systems: 1000:00 1001:FF However the reading differs…
AngryJohn
  • 576
  • 4
  • 10
-1
votes
1 answer

Why do you have to dereference the label of data to store something in there: Assembly 8086 FASM

Consider the following example: mov al, [variable1] This makes sense, as you save in the register al the content (thus dereferencing it) of variable1. Now consider this example: mov dword L6, 1 This isn't correct; the correct form is mov dword [L6],…
user12184817
-1
votes
2 answers

How to call memmove in assembly?

I tried to use mov rdx, 4 push rdx mov rsi, temp_str push rsi mov rdi, temp_str1 push rdi call memmove and sub rsp, 24 mov [rsp + 16], rdx mov [rsp + 8], rsi mov [rsp], rdi call memmove add rsp, 24 and other kinds of magic, but nothing works.…
DSblizzard
  • 4,007
  • 7
  • 48
  • 76
-1
votes
2 answers

Why does strace report my x64 FASM program runs in 32-bit mode?

I have format ELF64 executable 3 at top of my source file. I compiled my program using fasm main.asm Output: flat assembler version 1.73.13 (16384 kilobytes memory, x64) 3 passes, 319 bytes. Then I tried to run it using strace ./main, because it…
DeBos
  • 176
  • 1
  • 13
-1
votes
1 answer

Assembly socket creation crash

this is my Assembly source code for windows socket (ws2) this program compiled without any problem but on execution time, program crash (for seconds, program do nothing) what is the problem ? i think the problem is about stack or ... format PE…
Jason
  • 75
  • 1
  • 6
-1
votes
1 answer

Fasm: How to move a string in x and y direction

I want to output a string say for example "hello", and I want to put that string into motion by moving it to x or y direction. How to do it using fasm ? Thank you.
-1
votes
1 answer

Why does PC halt when i try to hook INT 13h from my bootloader?

My computer halts when i write my software onto MBR. My software is for hook INT 13h and execute some code when INT 13h is executed. I already try with too many ISRs for INT 13h but unsuccessfully. Here is my example source: cli cs mov…
-1
votes
1 answer

How to hook windows keyboard ISR?

I am trying to hook keyboard ISR with my code below but I cannot because DeviceIoControl API returns ERROR_INVALID_FUNCTION. Here is my code: invoke DefineDosDevice,[raw],filename1,devicename lea rcx,[filename2] invoke …
Bruno
  • 1
  • 3
-1
votes
1 answer

Adding 2 Numbers in FASM

How to make the assembly program below work in FASM. DATA SEGMENT NUM1 DB ? NUM2 DB ? RESULT DB ? MSG1 DB 10,13,"ENTER FIRST NUMBER TO ADD : $" MSG2 DB 10,13,"ENTER SECOND NUMBER TO ADD : $" MSG3 DB 10,13,"RESULT OF…
JR Galia
  • 17,229
  • 19
  • 92
  • 144
-1
votes
1 answer

fastcall how to use for more than 4 parameters

I was trying to build a function in assebmly(FASM) that used more than 4 parameters. in x86 it works fine but I know in x64 with fastcall you have to spill the parameters into the shadow space in the order of rcx,rdx,r8,r9 I read that for 5 and etc…
Darrin Woolit
  • 69
  • 1
  • 7
-1
votes
1 answer

Doesn't compile Assembly directivies

Im using Flat Assembler, and when I want to run something, it writes: " illegal instruction" to every line of the assembler directives. For example in the code below, it would write that .MODEL SMALL is not legal, and if id delete this line it would…
-2
votes
1 answer

How to make bubble sort in Flat Assembler?

I wrote some code for bubble sort in c++. Now I want to write it in flat assembler but it seems harder than I expected. Can someone help or provide relevant sources? Here is my c++ code: int[] arr= {5,8,7,4,1,9} int n =6 //array size for (i = 0;…
-2
votes
3 answers

Where does neg store the reversed number?

I'm reading a book about assembly x86 on the FASM assembler and the following sentence is introduced: neg subtracts a signed integer operand from zero. The effect of this instructon is to reverse the sign of the operand from positive to …
user12184817
1 2 3
23
24