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

Linked List Explanation Flat Assembler Please?

I have been tasked with the project of creating a Linked List inside of a flat assembler for a class project. I need to be able to store words there dynamically. I understand vaguely memory allocation and de allocation. What I don't understand is…
0
votes
1 answer

Using syscall with FASM to read numbers with suffix

I am trying to simulate a scanf in assembly that takes different suffixes (h-hex,b-bin etc). This worked fine for unsigned values, but after adding those 5 lines (commented below, to enable signed values), I ran into problem of missing front digit…
royalfinest
  • 155
  • 1
  • 8
0
votes
1 answer

Converting 16-bit DOS .com assembly for use on 64-bit

I wrote few programs in assembly in flat assembler for 32bit windows xp. But now that I have 64bit windows 8 I can't run the .com files, as they appear to be incompatible with 64bit version (the programs are 32bit). How do I convert it so I can run…
zoran404
  • 1,682
  • 2
  • 20
  • 37
0
votes
2 answers

(FASM) I can't see the content of a file

my problem is the following: I am writing a software in Assembler. It reads a Windows Executable, and compares the first two bytes if they are equal to "MZ". The ReadFile API has success in its job, but when I try to compare the first two bytes of…
jhonny6721
  • 115
  • 9
0
votes
2 answers

FindFirstFile and FindNextFile crash my program in assembly. Why?

I am writing a program that looking for files with the extension ".fly". It displays the names of the founded files, but when I try to use FindFirstFile and FindNextFile, my program crashes. I have tried with FindFirstFileA (ANSI Version of the…
jhonny6721
  • 115
  • 9
0
votes
1 answer

How do I find a file inside the current directory in x86 Windows Assembly

I am having a few issues with my code. I am trying to read both of the PE headers inside of an executable file. However, when I invoke ReadFile, it sets [hFile] to 5A, which is not the handle I put inside from CreateFile. From what I understand,…
Chris Altig
  • 680
  • 3
  • 8
  • 22
0
votes
1 answer

assembly illegal instruction ".model small"

my code : .MODEL SMALL .CODE ORG 100H Label1 : JMP Label2 +---------------------+ | TEMPAT DATA PROGRAM | +---------------------+ Label2 : +---------------------+ | TEMPAT PROGRAM | +---------------------+ INT 20H END Label1 but I get…
Samuel Ricky
  • 69
  • 1
  • 2
  • 10
0
votes
1 answer

FASM- passing parameters to an external procedure

I am having trouble with passing parameters to procedures outside the main ASM file. Here is my code. It shows a main procedure, _main (in main.asm) which calls a sub-procedure _sub in another source file (sub.asm). The sub-procedure prints a string…
0
votes
2 answers

convert raw bytes to hexadecimal in c++ or assembly(FASM)

I know this sounds like a really dumb question but I am trying to build a simple hexadecimal editor and I can't read the bytes from the file. I use readfile api to read 8kb buffer and then I was going to convert the 8kb to hexadecimal but it gives…
Darrin Woolit
  • 69
  • 1
  • 7
0
votes
2 answers

read source of a webpage in fasm or nasm

I have this c++ code to read the source of a webpage. #include "stdafx.h" #include #include #include #include #pragma comment(lib,"ws2_32.lib") using namespace std; int main(){ WSADATA wsaData; …
Darrin Woolit
  • 69
  • 1
  • 7
0
votes
1 answer

FASM pass by reference/pointer

I'm trying to write an assembly function that allocates memory and stores the address in a given pointer. However, I cannot figure out how to store the address in the parameter passed to the function. I have the following: struc SSLSocket sock, ssl,…
Brandon
  • 22,723
  • 11
  • 93
  • 186
0
votes
2 answers

FASM x86 msg db new line

I was wondering something. I continued learning some assembly, and I started to understand more of it. Anyways, let's carry on. This is what I've made: org 100h ; Message 1 mov ah,09 mov dx,msg int 21h ; Message 2 ; LOL mov ah,09 mov dx,msg2 int…
Joshua Bakker
  • 101
  • 1
  • 4
  • 10
0
votes
2 answers

Fasm loop using eax not working

I am trying to make a for loop in assembly where the EAX register is set to 5, and increased until it is greater than 10. Each time it increases, it outputs it's current value. When I execute my program, it goes in an infinite loop which only…
Johnathan
  • 787
  • 4
  • 10
  • 21
0
votes
1 answer

FASM assembly how to use the FPU in 64 bit programs

I have this code in FASM that calculates a measurement using the FPU that works great in 32 bit programs. How would I convert it so it would run in 64 bit program. when I use this code in the 64 bit program it gives me 0.00000 instead of a number…
Darrin Woolit
  • 69
  • 1
  • 7
0
votes
2 answers

How to prevent assembler compiling 16 bit applications?

I'm using the Flat Assembler on Windows 7 64 bit. I'm trying to compile a simple program, but it's compiling as a 16 bit program. Some programs seems to compile fine, but after searching for a while for a hello world example, the program doesn't…