Hello everyone, im new to world of windows programming and new to this forum, ive been coding over 10 years in assembly language on all kinds of computers (amstrad cpc 464, atari ST, amiga) and now the PC. For the last few months ive been writing a game in assembler, for DOS (a 3D footy game) every bit of code is written from scratch, using TASM and just recently i decided to convert the whole thing to windows, after downloading MASM32 and trying to write a few routines etc im kinda surprised how easy it seems, i actually kinda like it :eek: . Anyway, my problem is this...getting my dos TASM code to assemble with MASM, before i even try to convert it to windows. My source code assembles using MASM(ML) or TASM and links with either TLINK or the dos version of LINK with no errors. However whenever i use ML to assemble the code, the executable crashes when run, with every other combination the game runs perfect (TASM,TLINK)(TASM,LINK). What i REALLY need to know is does MASM assemble certain things differently, i need a list of differences between MASM and TASM before i go insane...please...anyone......please....im willing to beg...
Posted on 2001-08-30 22:43:39 by Lennon
If you're trying to run DOS programs produced by ML, you need an older linker. You can download it from Iczelion's download page, 2nd one from the bottom...

http://win32asm.rxsp.com/download.html

:)
Posted on 2001-08-31 00:01:07 by S/390
Yeah im using the dos linker. if i assemble it with TASM and link it with the MASM dos linker, the game runs fine....so.....:confused:
Posted on 2001-08-31 00:07:59 by Lennon
Oops, sorry, you did say the old DOS linker...

I haven't played with TASM much, but it does have a somewhat diffetent syntax than MASM. But if you don't get any assembly errors I doubt the problem is in this area.

MASM may be generating shorter jumps or something like that. Try comparing the .LST files from both assemblers and see if you spot any differences in the generated code. Or try running it with a debugger to track down the problem.

:)
Posted on 2001-08-31 00:17:30 by S/390
Lennon,

Im afraid you have to give us some more infos. Not the source code, please, but for the first step post the linker generated MAP files from these combinations: TASM/TLINK, MASM/TLINK, MASM/LINK. And tell us the command line options (or the whole make file) you use.

japheth
Posted on 2001-08-31 05:12:58 by japheth
//////////////////////////////////////////////////////////////////////
MASM LINK

ml.exe /c PROGRAM.ASM
link.exe PMODE.OBJ PFILE.OBJ PROGRAM.OBJ

OPTION casemap:none ;used in masm version

Start Stop Length Name Class
00000H 00000H 00000H _TEXT CODE
00000H 00000H 00000H _DATA DATA
00000H 00E4BH 00E4CH code16
00E50H 31AC7H 30C78H code32
31AD0H 39ACFH 08000H codeend STACK

Program entry point at 0000:03B9
/////////////////////////////////////////////////////////////////////
MASM TLINK

ml.exe /c PROGRAM.ASM
tlink.exe /3 /x /m PMODE.OBJ PFILE.OBJ PROGRAM.OBJ

OPTION casemap:none ;used in masm version

Start Stop Length Name Class
00000H 00000H 00000H _TEXT CODE
00000H 00000H 00000H _DATA DATA
00000H 00E4BH 00E4CH CODE16
00E50H 31AC7H 30C78H CODE32
31AD0H 39ACFH 08000H CODEEND STACK

Program entry point at 0000:03B9
////////////////////////////////////////////////////////////////////
TASM LINK

tasm.exe /ml /m2 /zi /p /l /q PROGRAM.ASM
link.exe PMODE.OBJ PFILE.OBJ PROGRAM.OBJ

Start Stop Length Name Class
00000H 00000H 00000H _TEXT CODE
00000H 00000H 00000H _DATA DATA
00000H 00E4BH 00E4CH code16
00E50H 32023H 311D4H code32
32030H 3A02FH 08000H codeend STACK

Program entry point at 0000:03B9
////////////////////////////////////////////////////////////////////
TASM TLINK

tasm.exe /ml /m2 /zi /p /l /q PROGRAM.ASM
tlink.exe /3 /x /m PMODE.OBJ PFILE.OBJ PROGRAM.OBJ

Start Stop Length Name Class
00000H 00000H 00000H _TEXT CODE
00000H 00000H 00000H _DATA DATA
00000H 00E4BH 00E4CH CODE16
00E50H 32023H 311D4H CODE32
32030H 3A02FH 08000H CODEEND STACK

Program entry point at 0000:03B9
////////////////////////////////////////////////////////////////////

Heres all the info you wanted, i hope you can see sumthing
:confused:
Posted on 2001-08-31 15:53:31 by Lennon
Lennon,

There is great wisdom in not mixing your assemblers and linkers, in DOS, code can be written to be compatible to both Microsoft and Borland linkers in assembler but it does not work like this in 32 bit windows. The object module format is different and the code is not compatible across both assemblers.

If you are gpoing to use Borland assembler, use their linker, same with MASM, use the Microsoft linker but don't try and mix them.

Code in win32 is a different brain to DOS code, API calls instead of interrupts, stack passed parameters instead of register passed parameters, no segments at all and they must not be used and a far greater range of instructions with 32 bit range.

Regards,

hutch@pbq.com.au
Posted on 2001-08-31 19:10:06 by hutch--
Thanks for the input Hutch,

I dont normally mix linkers/assemblers like that, it was originaly a tasm/tlink project, but to get the thing running on the MASM32 package, and running under windows, i started converting it to masm, using masm and link(dos version) i started to try out different linker and assemler combinations when it wouldnt run using masm, no other reason, besides the code runs when linking with tlink OR link, the problem seems to be with masm itself, as for the world of 32 bit windows, the game uses a 32 bit dos extender and is in one segment, same as the windows enviroment, the code should run with very few changes. If i ever getting masm to assemble it properly that is :mad:
Posted on 2001-08-31 19:22:07 by Lennon
Just a thought, is there any bugs in MASM i should know about??
Posted on 2001-08-31 20:06:38 by Lennon
Ive finally found the problem :grin: , after 2 days of slowly braking the code down into to little pieces and comparing LST files *insane type grin* ....ive found a "feature" in the way masm handles Equates, heres an example -:

OBJECTS_NUM EQU PLAYERS_NUM+21
PLAYERS_NUM EQU 22

TASM was doing what you would expect it to do, OBJECTS_NUM=(22+21)=43
MASM, because of the forward reference by the looks of it(it works as normal if PLAYERS_NUM is before OBJECTS_NUM), was turning OBJECTS_NUM into a TEXT EQU so its value was totally wrong, ive got no idea why it was doing this....it seems totally insane, i had loads of these things in my code, no wonder it was crashing all over the place for no apparent reason, this is exactly the kind of thing i was hoping sumbody could have told me about...ho hum....

Thanks for trying to help though everyone, i hope this will help sumbody else out there...

...and after 2 hours coding some windows startup routines, disk I/O etc, ive allready got the game up and running in windows :alright:
Posted on 2001-09-01 08:43:28 by Lennon