flat assembler
Message board for the users of flat assembler.
Index
> DOS > Why my simple code doesn't compile? |
Author |
|
AsmGuru62 23 Apr 2012, 17:38
If your code can fit into 64Kb -- you can use COM file instead of MZ EXE file.
COM is a flat model - very easy to program. No need to set up any segments - they are all the same and set up by DOS. |
|||
23 Apr 2012, 17:38 |
|
Juhas 23 Apr 2012, 19:57
But I want to learn how to make exec's.
|
|||
23 Apr 2012, 19:57 |
|
edfed 23 Apr 2012, 20:05
you can start from examples in the DOS fasm package. you will have exactlly all the minimal stuff to do .exe with fasm, and i think it is the only sure reference for fasm initiation.
Code: ; fasm example of writing multi-segment EXE program format MZ entry main:start ; program entry point stack 100h ; stack size segment main ; main program segment start: mov ax,text mov ds,ax mov dx,hello call extra:write_text mov ax,4C00h int 21h segment text hello db 'Hello world!',24h segment extra write_text: mov ah,9 int 21h retf i think the problem, in the first code, is that .code may be interpreted as a local label relative to s label in the .data segment. then, to access the full name, you will have to write: Code:
entry s.code:start to get correct compile. in the second code, data is a reserved word (used to define the permissions of a segment or section) if i well remember, then, cannot be used as a label to define a segment, or anything else. |
|||
23 Apr 2012, 20:05 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.