flat assembler
Message board for the users of flat assembler.

Index > DOS > Tutorial (com file just flashing up in a window)

Author
Thread Post new topic Reply to topic
dtrainor



Joined: 13 Dec 2004
Posts: 4
dtrainor
I am working on the tutorial and created the following example.asm:

mov ah,2
mov dl,97
int 21h
int 20h

Then I did fasm example.asm example.com in a dos command prompt.
Presumably this should be writing the letter 'a' to the screen, but since int 20h immediately closes the window, I just see the window flash when I execute example.com.

Is this what I should expect or am I missing something?
Post 14 Dec 2004, 03:46
View user's profile Send private message Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner
it displayed an "a" on my pc

Code:
E:\>fasm a.txt a.com
flat assembler  version 1.56
1 passes, 8 bytes.

E:\>a
a
E:\>
    

i guess u need to run it from command prompt, not double click the .com file :p

i am using win 95 :p
Post 14 Dec 2004, 05:32
View user's profile Send private message Visit poster's website Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1171
Location: Overflow
Matrix
howdy,

add this before int 20h
Code:
xor ah,ah
int 16h
    
Post 14 Dec 2004, 09:56
View user's profile Send private message Visit poster's website Reply with quote
dtrainor



Joined: 13 Dec 2004
Posts: 4
dtrainor
vbVeryBeginner wrote:
i guess u need to run it from command prompt, not double click the .com file


True. Breaking the windows mentality requires some discipline.
Post 14 Dec 2004, 20:51
View user's profile Send private message Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner
Quote:

True. Breaking the windows mentality requires some discipline.


Very Happy
if u r using the old windows 95, 98, or ME which didn't support sort of cache command prompt like what in windows 2000 and XP, where when u press the up arrow, u could get the previous typed command (so u don't have to type every time u wanna assemble and run)
u could get a PSDK "cmd" version which could run in old win9x.

check this out Smile -> http://ldt.mit.edu/consize.html
Post 15 Dec 2004, 05:10
View user's profile Send private message Visit poster's website Reply with quote
bubach



Joined: 17 Sep 2004
Posts: 340
Location: Trollhättan, Sweden
bubach
vbVeryBeginner wrote:
if u r using the old windows 95, 98, or ME which didn't support sort of cache command prompt like what in windows 2000 and XP, where when u press the up arrow, u could get the previous typed command (so u don't have to type every time u wanna assemble and run)

or u can run the dos program "doskey.exe", which does that...

_________________
BOS homepage: http://bos.asmhackers.net/
Post 15 Dec 2004, 08:18
View user's profile Send private message Reply with quote
dtrainor



Joined: 13 Dec 2004
Posts: 4
dtrainor
Matrix wrote:
howdy,

add this before int 20h
Code:
xor ah,ah
int 16h
    


And I did this, which kept the window open.
I am running an XP with 500MB memory. I want to use flat 32-bit addressing. Is using a DOS Window under XP the right environment for that? This is a pure number crunching algorithm, almost no user interface necessary.
Post 17 Dec 2004, 20:11
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Quote:
I want to use flat 32-bit addressing. Is using a DOS Window under XP the right environment for that?

absolutely no, you won't run flat real or unreal mode under any protected-mode environment (even win95). You must use dos (or restarting to dos from w95/w98).
Post 17 Dec 2004, 21:22
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner
dtrainor wrote:

I want to use flat 32-bit addressing.


did u mean the feature in OS "real mode"?
Post 18 Dec 2004, 00:00
View user's profile Send private message Visit poster's website Reply with quote
dtrainor



Joined: 13 Dec 2004
Posts: 4
dtrainor
vid wrote:

absolutely no, you won't run flat real or unreal mode under any protected-mode environment (even win95). You must use dos (or restarting to dos from w95/w98).

vbVeryBeginner wrote:

did u mean the feature in OS "real mode"?


This is from the book Assembly Language Step-By-Step by Duntemann: (about 1999-2000)

"Protected mode assembly language programs may be written for both Windows NT and Linux (I am assuming that XP replaces NT). The easiest way to do it under NT is to create console applications, which are text-mode programs that run in a text-mode window called a console. The console is controlled through a command line almost identical to the one in MS-DOS. Console applications use protected mode flat model and are fairly straightforward compared to writing Windows applications."

The above is what I want to do. I interpreted this to mean I use fasmc156. Then I boot my computer into XP. Then I open a command prompt. Then in this I can build and run programs using the protected mode flat model 32-bit addresses.

Can I do it like that, or must I do something else?
Post 18 Dec 2004, 05:40
View user's profile Send private message Reply with quote
bubach



Joined: 17 Sep 2004
Posts: 340
Location: Trollhättan, Sweden
bubach
You can make 32-bit command line programs under XP.
It's called "format PE console" instead of "format MZ" or "org 0x100" (com-files)...


Last edited by bubach on 13 Feb 2012, 15:18; edited 1 time in total
Post 18 Dec 2004, 09:26
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
oh, that's what you wanted. Like bubach said, but you have to use APIs to commenicate with OS (not int 21h), and you executable must have a bit different structure etc. There is Iczlions tutorial for this somewhere.
Post 18 Dec 2004, 11:15
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
gumletis



Joined: 18 Dec 2004
Posts: 128
gumletis
i have try the same and it forgot to put RET in the last line, maybe that will help you
Post 20 Dec 2004, 12:11
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< 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.

Powered by rwasa.