flat assembler
Message board for the users of flat assembler.
Index
> DOS > How to write a Hello World! Program in FASM? |
Author |
|
VitalOne 21 Jun 2004, 05:53
Code: ; fasm example of writing simple EXE program format MZ push cs pop ds mov ah,9 mov dx,hello int 21h mov ax,4C00h int 21h hello db 'Hello world!',24h 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 |
|||
21 Jun 2004, 05:53 |
|
Slai 21 Jan 2006, 01:12
Why do u need to make the Data Segment equal to the Code Segment ?
|
|||
21 Jan 2006, 01:12 |
|
RedGhost 21 Jan 2006, 06:00
Quote: How to write a Hello World! Program in FASM? the fasm DOS package http://flatassembler.net/fasm165.zip comes with many examples, including more than one hello world type Slai wrote: Why do u need to make the Data Segment equal to the Code Segment ? in the multi-segment example above, the code and data are in different segments, but they do not have to be, just make the data segment register (ds) point to the segment with the data (also in the example above) _________________ redghost.ca |
|||
21 Jan 2006, 06:00 |
|
Plue 21 Jan 2006, 21:09
zck127 wrote: I am trying to write a simple "hello,world" executable program. When I type in the line _________________ Roses are red Violets are blue Some poems rhyme And some don't. |
|||
21 Jan 2006, 21:09 |
|
nvictor 18 Feb 2007, 17:48
RedGhost wrote: in the multi-segment example above, the code and data are in different segments, but they do not have to be, just make the data segment register (ds) point to the segment with the data (also in the example above) I presume the code segment is assumed by the assembler?? |
|||
18 Feb 2007, 17:48 |
|
DOS386 19 Feb 2007, 13:16
Quote: I presume the code segment is assumed by the assembler?? It will generate one segment for you, as long as you remain below 64 KiB, there is no problem, you can mix code with data as you want, and keep the "entry point" at the begin where it comes by default. "Code vs Data" problem comes from some other compilers and is not present when using FASM |
|||
19 Feb 2007, 13:16 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.