flat assembler
Message board for the users of flat assembler.

Index > Windows > HELP ON FASM AND EXEC FUNC

Author
Thread Post new topic Reply to topic
Betheny



Joined: 28 Dec 2006
Posts: 4
Location: Canberra
Betheny 28 Dec 2006, 07:58
Hello People ... i am a new member of this Forum ... Wink and i have a question
I want to write a program which runs all the commands in DOS using the EXEC function. at the moment i want to see what this Piece of coding does !
****************************************
include 'C:\ASSEMBLY_FLAT\INCLUDE\win32axp.inc'
section '.data' data readable writable
CommandLine0 db "C:\Command.com",0

section '.code' code readable executable

proc main

invoke WinExec,CommandLine0,SW_SHOW
invoke ExitProcess,0

endp

.end main
****************************************

I can make the EXE file with FASM.EXE But it does not do anything ... ! If someone could explain me what this does and if someone has actully got to run this or not i would be happy to help me. Even though i will check this here but you can also email me at
Prince_wont_die@yahoo.com

Thanks
Beth Ball

_________________
SAPA . YAYA
Post 28 Dec 2006, 07:58
View user's profile Send private message Yahoo Messenger MSN Messenger Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1902
DOS386 28 Dec 2006, 08:41
Quote:
want to write a program which runs all the commands in DOS


I see 3 possible solutions:

- Reduce usage of bold text in your posts
- Use FASM for DOS
- Use HX-DOS extender (works for me, allows to use * some * "Win32"
code in DOS

_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug
Post 28 Dec 2006, 08:41
View user's profile Send private message Reply with quote
Filter



Joined: 08 Oct 2006
Posts: 67
Filter 28 Dec 2006, 15:42
Betheny wrote:
Hello People ... i am a new member of this Forum ... Wink and i have a question
I want to write a program which runs all the commands in DOS using the EXEC function. at the moment i want to see what this Piece of coding does !
****************************************
include 'C:\ASSEMBLY_FLAT\INCLUDE\win32axp.inc'
section '.data' data readable writable
CommandLine0 db "C:\Command.com",0

section '.code' code readable executable

proc main

invoke WinExec,CommandLine0,SW_SHOW
invoke ExitProcess,0

endp

.end main
****************************************

I can make the EXE file with FASM.EXE But it does not do anything ... ! If someone could explain me what this does and if someone has actully got to run this or not i would be happy to help me. Even though i will check this here but you can also email me at
Prince_wont_die@yahoo.com

Thanks
Beth Ball

Code:
format PE CONSOLE 4.0
include 'win32axp.inc'
section '.data' data readable writable
CommandLine0 db "command.com",0

section '.code' code readable executable

proc main

invoke WinExec,CommandLine0,SW_SHOW
invoke ExitProcess,0

endp

.end main                     

This seems to work for me. Maybe command.com wasn't in C:\?

It works in a weird way though.
Post 28 Dec 2006, 15:42
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.