Hi all,


I am trying to generate dos application in assembly and using masm32. am I on the right path..If i am correct .. masm is assembling my source code.

.model small
option segment:use16

dseg segment para public 'data'

str1 db "Hello world", 0

dseg ends


cseg segment para public 'code'
assume cs:cseg, ds:dseg


_start:

mov ax, dseg
mov ds, ax
mov es, ax

cseg ends

end _start


its giving me error on mov ax, dseg.. I don't what to do..

regards
Posted on 2003-05-30 06:22:26 by processingspeed
have you tried to do:


MOV AX,SEG dseg ?


I think this should work
Posted on 2003-05-30 06:40:50 by Azrim
not sure what you are after, I just compiled your code



C:\>ml /c /Cp test.asm
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997. All rights reserved

Assembling: test.asm

C:\>
Posted on 2003-05-30 06:44:57 by Azrim
I am not getting exe after linking.. moreover linking fails..........

what to do ???
Posted on 2003-05-30 06:50:50 by processingspeed
Try using a 16bit linker :)
Posted on 2003-05-30 06:53:15 by Azrim
processingspeed,

Why not to use the simplified segment definitions? :)




.model small
.stack
.data
msg db 'Hello world','$'
.code
start:
mov ax,@data
mov ds,ax
lea dx,msg
mov ah,9
int 21h
mov ah,4ch
int 21h
end start


Posted on 2003-05-30 14:04:36 by Vortex
As Azrim noted, the linker that comes with Masm32 is 32 bit and will not create 16-bit DOS programs. To do this, you must have Microsoft's Linker version 5.63 that is available from Microsoft's FTP site: ftp://ftp.microsoft.com/softlib/mslfiles/lnk563.exe.

After extracting the files, I rename the link.exe to link16.exe. You will not be able to use ML.exe to assemble and link 16-bit programs, but you can assemble the program using ML, then link the object file using Link16 like so:

ml /c /Zm /nologo FileName.asm
link16 /nologo FileName.obj;
Posted on 2003-05-30 14:15:54 by Masmer
RadASM can Compiler code 16bit ASM, Please ?
Posted on 2003-05-31 07:18:06 by NetStaVi

RadASM can Compiler code 16bit ASM, Please ?
Yes, set-up commandlines in Project Options:

3,O,$B\ML.EXE /AT /c,2

5,O,$B\LINK16.EXE /TINY,3

This is for a COM file - linker will produce an error of no output file name given, but it uses a default name that is okay. Seems to work for me.
Posted on 2003-07-19 23:31:26 by bitRAKE
I have tried the WinAsm IDE for 16 bit code from Insomnia Software. It isn't bad and it is targetted directly at Windows 3.1 applications:

http://www.programmersheaven.com/zone5/cat24/1355.htm

It is also available on the programmers heaven utility disk. It isn't bad for small applications (32K max).
Posted on 2003-07-19 23:48:03 by donkey