flat assembler
Message board for the users of flat assembler.

Index > Main > Need Help on This Code - Originally TASM

Author
Thread Post new topic Reply to topic
robink



Joined: 17 Sep 2003
Posts: 14
robink 01 Oct 2003, 17:53
I can successfully compile and run this code. My question is why when I change the program to be executed to a .exe or to say, notepad.exe it does nothing. It seems to work when I use a .com program that is in the same directory as exec.com. Here is the code for exec.asm:

ORG 100h
START:
JMP LOC_1
RB 90H
LOC_1:
lea sp,[STK]
MOV AH,4AH
MOV BX,(STK - START + 10FH )/16
INT 21H
JC BEND
lea dx,[PNAME]
lea BX,[PARS]
MOV AX,4B00H
INT 21H
AEND:
MOV AH,4CH
INT 21H
BEND:
MOV AX,0B800H
MOV ES,AX
; MOV ES,AH
JMP AEND

PNAME DB "CPUID.COM",0
PARS Dw ENVIR
Dw CMDLINE,0
Dw FCB1,0
Dw FCB2,0

CMDLINE DB 0,0DH
FCB1 DB 0
RB 11
RB 25
FCB2 = 0
RB 11
RB 25
ENVIR DB 'PATH=',0
DB 'COMSPEC=C:\WINNT\SYSTEM32\CMD.EXE',0
DB 0
STK = $

It seems that when I try to translate from TASM to FASM I learn a lot about FASM so I have tried to translate this program. Any help here would be very helpful in my learning more. Thank-you.

_________________
Thanks,

Robin
Post 01 Oct 2003, 17:53
View user's profile Send private message Reply with quote
KiteMaster



Joined: 01 Aug 2003
Posts: 18
Location: Austria
KiteMaster 01 Oct 2003, 19:12
try "format MZ" at the start of the code for exe programms
Post 01 Oct 2003, 19:12
View user's profile Send private message Reply with quote
robink



Joined: 17 Sep 2003
Posts: 14
robink 02 Oct 2003, 04:21
Nope, that does not work. Thanks for the input, however.

_________________
Thanks,

Robin
Post 02 Oct 2003, 04:21
View user's profile Send private message Reply with quote
wanderer



Joined: 18 Jun 2003
Posts: 44
Location: Moldova, Kishinev
wanderer 02 Oct 2003, 20:46
robink wrote:

Code:
ENVIR           DB 'PATH=',0                                                      
                DB 'COMSPEC=C:\WINNT\SYSTEM32\CMD.EXE',0                          
                DB 0                                                              
STK             = $
    



First, reserve some space for stack: place at least "rb 128" before "STK=$".
Second, specify full path to the exe, not "notepad.exe" only, but "c:\winnt\notepad.exe".

_________________
Best regards,
Antoch Victor
Post 02 Oct 2003, 20:46
View user's profile Send private message Yahoo Messenger Reply with quote
robink



Joined: 17 Sep 2003
Posts: 14
robink 02 Oct 2003, 22:00
Thank-you. That did it. I knew about putting the full path but I did not realize that I needed the RB before the STK = $. Again, thank-you for your help.

_________________
Thanks,

Robin
Post 02 Oct 2003, 22:00
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.