flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
quddusaliquddus 19 May 2009, 00:01
Quote:
Why? |
|||
![]() |
|
bitRAKE 19 May 2009, 01:03
That isn't FASM syntax - looks like MASM?
|
|||
![]() |
|
revolution 19 May 2009, 03:17
In fasm you can just do this:
Code: int 0x20 |
|||
![]() |
|
quddusaliquddus 19 May 2009, 03:35
Thanks for the replies.
Im new to all things assembly, and I am following an example of x86 assembly language code. Are there big differences between different assembly compilers? |
|||
![]() |
|
quddusaliquddus 19 May 2009, 03:37
And also - how would I prevent the above-generated program from quitting so quickly?
|
|||
![]() |
|
revolution 19 May 2009, 05:39
Have a look at the "examples" folder in the download zip file. Those files are already in fasm syntax.
|
|||
![]() |
|
Borsuc 20 May 2009, 00:50
revolution wrote: Have a look at the "examples" folder in the download zip file. Those files are already in fasm syntax. ![]() _________________ Previously known as The_Grey_Beast |
|||
![]() |
|
Japheth 20 May 2009, 10:21
LocoDelAssembly wrote: Or maybe: Actually, format MZ combined with INT $20 is a bug. Because to terminate a DOS program with INT 20h "requires" CS==PSP segment, which usually is true for .COM files only. |
|||
![]() |
|
LocoDelAssembly 20 May 2009, 16:19
Corrected, thanks.
|
|||
![]() |
|
Tomasz Grysztar 20 May 2009, 18:54
Japheth wrote: Actually, format MZ combined with INT $20 is a bug. Because to terminate a DOS program with INT 20h "requires" CS==PSP segment, which usually is true for .COM files only. Good that you added "usually", because you can get the same thing with MZ format, too: Code: format MZ segment main PSP = main - 10h entry PSP:100h org 100h mov ah,9 mov dx,_hello int 21h int 20h _hello db "Hello, guys!",24h Actually, this is the kind of "emulation" that fasm does when you specify binary .com file as a stub for PE executable. |
|||
![]() |
|
DOS386 21 May 2009, 13:41
quddusaliquddus wrote:
It seems to be MASM syntax and 7 of the 8 lines don't do anything, there is just 1 ( ONE ) instruction, as pointed above ![]() Also, numbers are decimal by default in FASM so your "INT 20" becomes INT $14 - serial port: http://www.ctyme.com/intr/int-14.htm INT $20 would be a bad (see above) way to exit, the safest one (see also above) is: Code: mov ax, $4C00 int $21 To prevent from "quitting so quickly", you have to do something before you exit ![]() Also INT $21 is DOS only code, so for DOS examples check the DOS subforum, OTOH for Win32 forget INT $21 and check the Win32 subforum and included examples using format PE ![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.