Tag Archives: assembler
The FASM come with great examples. If you get a look on this topic, you will see the news about FASM. The news are: [FASMW64\FASMW32.EXE] – 32bit asm development [FASMW64\FASMW64.EXE] – 64bit asm development [FASMW64\DLL] – 32bit DLL’s required by most programs [FASMW64\DLL64] – 64bit DLL’s requred by some programs [FASMW64\fasmw16935] – Original FasmW package […]
If you read fasm-about-format-elf-executable-3 tutorial then you will have some errors. It’s just a simple example to show you how to deal with .inc files in your project. You need to have func.inc and date.inc files to run fasm with proj.asm. This tow files will come with date and functions for your project. First the […]
The Executable and Linking Format named ELF providing developers with a set of binary interface deﬁnitions that extend across multiple operating environments. This is one simple example using fasm and ELF executable 3 .
<XMP>; Copyright (c) 2012, www.free-tutorials.org
; All rights reserved.
; Main program
;// using 32
;// will be able to create instance on BSD system sor syscals
;// will create some special segments: interpreter, dynamic and note
;// with this will make it dynamically linked
format ELF executable 3
segment readable executable
;next lines will add functions and date
;this is a string and will be show it
primul_text db 'www.free-tutorials.org example 001 - version is ',VERS,0AH,'$'
segment readable writeable
;// align 4 gives the value to which the segments are aligned in memory and in the ﬁle.
;// also values 0 and 1 mean no alignment is required.
;// if not should be a positive, integral power of 2
;// and specifies how many low bits of the section start address must be forced to zero.
;// create data
consola_date dd ?
Let’s run it:
<XMP>usertest@home:~/Dropbox/ASM/fasm$ ./fasm proj.asm
flat assembler version 1.70.03 (16384 kilobytes memory)
3 passes, 251 bytes.
www.free-tutorials.org example 001 - version is 0.0.01</XMP>
Using format ELF executable 3 I can create segment readable executable and use it. Also this […]
The source code it’s very simple. The message it’s show using int 80 and eax with function 4. We need the message and length of this message. See next the source code and comments:
hello: db 'Hello world!',10 ; 'Hello world!' and end string
helloLength: equ $-hello ; Length of the 'Hello world'
mov eax,4 ; The system call for write (sys_write)
mov ebx,1 ; File descriptor 1 - standard output
mov ecx,hello ; Put the offset of hello in ecx
mov edx,helloLength ; helloLength is a constant length of hello message
; This mov edx,[helloLength] to get it's actual size
int 80h ; Call the kernel
mov eax,1 ; The system call for exit (sys_exit)
mov ebx,0 ; Exit with return code of 0 (no error)
The FASM is a self-assembling open-source 80×86 assembler for DOS, Windows and Linux. It supports all 8086-80486/Pentium instructions with MMX, SSE, SSE2 and with more features. FASM contains many programming options and features. The source code can be written in different ways because of control directives, macros and management of resources. FASM, by default uses […]