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
3
votes
4 answers

How do you generate a random number in Assembly language using the FASM compiler?

I am really new to assembly and I'm trying to create a simple program. For this I need to generate a random number. Anybody know how I can do this with the FASM compiler?
Sam152
3
votes
1 answer

Unable to disasembly my app -- no debugging information found

I'm trying to disassembly app written in assembly. I'm on Linux, x64: $ objdump -d my_app my_app: file format elf64-x86-64 That's it. What's wrong with it? It's not a simple hello world of a few lines, it's around 200 lines of code. The…
Uji
  • 33
  • 5
3
votes
1 answer

Error After Switching to Protected Mode and Making a Far Jump

I am writing a boot loader using FASM (the Flat Assembler). I was successful in 16-bit mode but I am facing an error in switching to 32-bit mode. I looked at an answer to a similar (infact same problem at GPF after far jump to protected mode) but…
Anish Sharma
  • 314
  • 3
  • 18
3
votes
1 answer

Problems in moving a register value to a memory address in assembly language using fasm assembler?

I am really confused about this one thing. I was following the book assembly programming for x86 processors and i was reading about the mov instructions and how it works. So, the author said that the following instruction is valid mov…
Missy Zewdie
  • 231
  • 2
  • 9
  • 17
3
votes
2 answers

Colors 0-15 Assembly

Good night, I'm trying to do a project with assembly(FASM), where i need to do some triangles and put 2 colors from 0 to 15 (ask the number to the human using the program) i got this to "read" the values: mov ah, 40h mov bx, 1 mov cx,…
Vasco Lopes
  • 141
  • 9
3
votes
1 answer

(Assembly 32 bit) can't use lea without the brackets?

I haven't seen anyone touch on this as far as i can tell, so i'm using a flat assembler and if i try to do something like this "lea eax,testing" it won't work but if i do this "lea eax,[testing]" it works? Lots of examples i come across i see…
noob
  • 51
  • 6
3
votes
1 answer

Mach-O binaries using FASM

is anybody using FASM to produce Mach-O binaries? it's my assembler of choice and I thought it would be nice to learn whether that's possible to accomplish and whether somebody is already doing it. thanks in advance.
vruz
  • 31
  • 2
3
votes
1 answer

Passing a 1 byte argument to a function?

I want to create a function that receives a 1 byte argument. But I am reading that in x86 I can only push 2 or 4 bytes onto the stack. So should I expect a 2 bytes argument to be passed to my function and then extract my 1 byte? Is this is how to…
John
  • 1,049
  • 1
  • 14
  • 34
3
votes
2 answers

assembler (fasm) - read character

the bios interrupt function 21h (ah = 1h) should read a character from the standart input and echo it. My read function: mov ah, 1h int 21h So, if i press a key it realises that, but it won't echo a character. Since im using my code to boot…
3
votes
1 answer

FASM Procedure Issue

I'm new to whole assembly FASM I have implement WriteString via this tutorial INT 10h / AH = 13h - write string. input: AL = write mode: bit 0: update cursor after writing; bit 1: string contains attributes. BH = page…
Ahmed Ghoneim
  • 6,834
  • 9
  • 49
  • 79
2
votes
3 answers

FASM - compacting "buffer db 0, 0, 0, 0, 0, 0, ..."

I was lucky enough to run into some NASM code that compiled fine in FASM changing just a single line; buffer times 64 db 0 This works fine in NASM, but not in FASM - i had to write: buffer db 0, 0, 0, 0, 0, 0, ... There must be a more compact way…
Vegard J.
  • 307
  • 3
  • 13
2
votes
3 answers

FASM: Dynamic array

How can I store variables in an array, which size is known only on run-time? How can I access elements of this array? I think it should be easy, but I don't see a way. I mean something like dynamic arrays in C.
Ivan
  • 609
  • 8
  • 21
2
votes
2 answers

X86: protected mode, GDT, IDT

I've tried to execute simple kernel with a kolibri bootloader. It's being loaded into 1000:0000. I don't understand, what's wrong in this part: ... ; switch to PM mov eax, cr0 or al, 1 mov cr0, eax use32 PROTECTED_ENTRY: mov ax, 00010000b ;…
i.y.
  • 153
  • 11
2
votes
1 answer

Asm. How to set RC bits of CW?

How to set in control word of FPU bits in RC to 3? answer (editor's note: don't post answers as part of the question, but for now it's here) fstcw word ptr cw or word ptr cw, 110000000000b fldcw word ptr cw
Kovpaev Alexey
  • 1,725
  • 6
  • 19
  • 38
2
votes
1 answer

Unable to print Unicode string using wprintf in FASM or NASM

I'm having trouble printing a Unicode string using the wprintf function in FASM (Flat Assembler). I've tried the following code, but it produces random output (αñ╣αñ┐αñ¿αÑìαñ┐): format PE64 console entry start include…
1 2
3
23 24