flat assembler
Message board for the users of flat assembler.

Index > DOS > Starting with assembler under dos

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
Cor



Joined: 30 Nov 2006
Posts: 13
Location: Poederoijen, Netherlands
Cor
Hello,

I wil to start with assembler under dos, i have download flat assembler version 1.67.15.

I have copy this code:
Code:
; fasm example of writing simple EXE program

format MZ
         push        cs
         pop         ds

         mov        ah,9
         mov        dx,hello
         int          21h

         mov        ax,400h
         int          21h

hello db 'Hello world!',24h
    

    


then i save it if c:\exedemo.asm and i wil to start the fasm program.
i type:
C:\>fasm exedemo.asm exedemo.exe

then i have a error:
missing end quote
I cannot found ware is the problem?

my operating system is MS-DOS

--edit--
i think i have found the problem:
i must type
C:\>fasm <exedemo.asm> [exedemo.exe]

then have i the follow error:
File creation error

Can you help my please?


thank you


Last edited by Cor on 30 Nov 2006, 20:49; edited 1 time in total
Post 30 Nov 2006, 19:31
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Code:
C:\FASM>fasm exedemo.asm exedemo.exe
flat assembler  version 1.67.15  (952127 kilobytes memory)
2 passes, 59 bytes.

C:\FASM>exedemo
Hello world!    

At least works with the Windows command line version. Are you sure that your ASM source is exactly the same that the one you posted? If that is the case then note that to exit to DOS the function is 4Ch, not 4h, so this is the correct sequence
Code:
         mov        ax,4C00h 
         int          21h    

Your code without this modification was capable of hang my computer for a while, the mouse pointer was very hard to move but finally I reached de X button to kill it Very Happy
Post 30 Nov 2006, 20:49
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Code:
mov        ax,4C00h    

your program was probably still running, so FASM couldn't overwrite it
Post 30 Nov 2006, 21:02
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Quote:

my operating system is MS-DOS


MS-DOS is not a multi-task OS Wink
Post 30 Nov 2006, 21:08
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
he might have been running DOS app from Windoze - quite common case
Post 30 Nov 2006, 21:11
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Cor



Joined: 30 Nov 2006
Posts: 13
Location: Poederoijen, Netherlands
Cor
Thank you for you answer.
I tell you my problem:

I have a PC a 80386 with MS-dos (not windows!). And I wil programming with assembler. I have download flat assembler version 1.67.15

I type the program in a texteditor (WP5.1) and i save this if exedemo.asm.

then go i return to dos.
and i type C:\> fasm <exedemo.asm> [exedemo.exe]
And then have i the next error: File creation error.

If i know your anwer my source code is not good?
Can you view my the good code?

its my first program in assembler, i have make first program voor microcontroller in assembler (http://www.atmel.com) and i wil now make a program for communications at PC and microcontroller with the COM-port. and i cannot program the pc (386).

thank you
Post 01 Dec 2006, 07:55
View user's profile Send private message Reply with quote
Japheth



Joined: 26 Oct 2004
Posts: 151
Japheth
> and i type C:\> fasm <exedemo.asm> [exedemo.exe]

there is a slight missunderstanding here. The "[" and "]" displayed by fasm if called without parameters are not meant to be typed in, they are telling that this parameter is optional. If you type them, fasm cannot create the output file and displays this "file creation error" message.
Post 01 Dec 2006, 08:21
View user's profile Send private message Visit poster's website Reply with quote
Cor



Joined: 30 Nov 2006
Posts: 13
Location: Poederoijen, Netherlands
Cor
thank you for you answer

Can you tel my what i must type then?

if i know i must do not type the "[" and "]". what do i type then?
if i type: C:\>fasm <exedeme.asm> then have i the error:
File creation error.

thank you

--edit--
I have test it:
c:\>fasn>exedemo
and then have i not a error, and not a exe file. Can you tel wat i must do to make from a .asm a .exe file?
e am sorry its to run the file. Embarassed
Post 01 Dec 2006, 08:32
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1608
Location: Ukraine
shoorick
you have to type:
Code:
fasm exedemo.asm    
Post 01 Dec 2006, 11:10
View user's profile Send private message Visit poster's website Reply with quote
Cor



Joined: 30 Nov 2006
Posts: 13
Location: Poederoijen, Netherlands
Cor
thank you,

i do it and then have i the next message:

flat assembler version 1.67.15 (3008 kilobytes memory)
exedemo.asm [11]:
"( he let view a heart)
error: missing end quote.

whats then the problem?
Post 01 Dec 2006, 11:22
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1608
Location: Ukraine
shoorick
or your real exedemo.asm was modified and has this line No.11, which is wrong for assembler syntaxis, or you have strange text editor, etc.

try to use new unmodified copy from demo archive.

try to test your situation with text files test.asm:
Code:
db "ABCDEFGH"    
then
Code:
fasm test.asm test.txt    
should generate text file contains only 8 symbols: ABCDEFGH
Post 01 Dec 2006, 11:39
View user's profile Send private message Visit poster's website Reply with quote
Cor



Joined: 30 Nov 2006
Posts: 13
Location: Poederoijen, Netherlands
Cor
thank you,

I have do this:
and then have the message:

flat assembler version 1.67.15 (3008 kliobytes nemory)
1 passes, 0.2 seconds, 8bytes.

and then have a not a .exe file Crying or Very sad

whats here the problem?
Post 01 Dec 2006, 12:22
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1608
Location: Ukraine
shoorick
please be more informative. what exactly have you do?
Post 01 Dec 2006, 12:36
View user's profile Send private message Visit poster's website Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1608
Location: Ukraine
shoorick
i see 8 bytes: right! it had not be exe file, as i told, it had to be TEXT file with 8 symbols. than i think fasm works ok. now check your exedemo.asm - is it correct inside, or better take not modifyed exedemo.asm from fasm package.

another method: type in the command line
Code:
type exedemo.asm    
and look - is it correct inside or not.
Post 01 Dec 2006, 12:42
View user's profile Send private message Visit poster's website Reply with quote
Cor



Joined: 30 Nov 2006
Posts: 13
Location: Poederoijen, Netherlands
Cor
its works! Very Happy

thank you

I have the code type in kladblok (a windows tekst editor) then have i this save as exedemo.asm and exedemo.txt.
then it save on a diskette and it copy to the 386 pc.

there have i type:
fasm exedemo.asm
then have a message.

then have i typed dir
and i view exedemo.exe Very Happy
and then type i exedemo.exe and i view:
Hello world!

Have you good idee for a good tekst editor in dos?, i have Wordperfect 5.1
and then works this code not and i do it in a windows software and copy it from pc 1(windows) to pc2 (dos) and this works.

Thank you,
i go to learn assembler for the 386 pc.
Post 01 Dec 2006, 12:59
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1608
Location: Ukraine
shoorick
i would suggest you to install DOS Navigator and have with it great wide featured tool with not big size. i've been using it till 2002, until a had using my 386sx as main PC.
Post 01 Dec 2006, 13:20
View user's profile Send private message Visit poster's website Reply with quote
Cor



Joined: 30 Nov 2006
Posts: 13
Location: Poederoijen, Netherlands
Cor
oke, thank you, i go search to DOS navigater.
Post 01 Dec 2006, 13:26
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1608
Location: Ukraine
shoorick
Post 01 Dec 2006, 13:30
View user's profile Send private message Visit poster's website Reply with quote
Cor



Joined: 30 Nov 2006
Posts: 13
Location: Poederoijen, Netherlands
Cor
thank you,
Post 01 Dec 2006, 14:29
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Post 01 Dec 2006, 15:56
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.