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.
These two files will come with dates and functions for your project.
First the proj.asm file :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ; Copyright (c) 2012, Catalin George Festila -www.free-tutorials.org ; All rights reserved. ; Main program use32 segment readable executable start: mov [consola_date],1 mov esi,primul_text call afiseaza call cpu_id jmp iesire include 'func.inc'; include 'date.inc'; primul_text db 'www.free-tutorials.org example 001 - version is ',VERS,0AH,'$' segment readable writeable align 4 consola_date dd ? |
The next two .inc files …first date.inc come with :
1 2 3 4 | ; Copyright (c) 2012, Catalin George Festila - www.free-tutorials.org ; All rights reserved. ; Static data VERS equ "0.0.01" |
and func.inc file comes with :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ; Copyright (c) 2012, Catalin George Festila -www.free-tutorials.org ; All rights reserved. ; Functions afiseaza: push ebx mov edi,esi mov edx,esi or ecx,-1 xor al,al repne scasb neg ecx sub ecx,2 mov eax,4 mov ebx,[consola_date] xchg ecx,edx int 0x80 pop ebx ret cpu_id: mov eax,0 cpuid ret iesire: movzx ebx,al mov eax,1 int 0x80 |
And the result is:
1 2 3 4 5 | :~/fasm$ ./fasm proj.asm flat assembler version 1.70.03 (16384 kilobytes memory) 3 passes, 246 bytes. :~/fasm$ ./proj www.free-tutorials.org example 001 - version is 0.0.01 |