News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

MASM COMMANDS PROBLEM ON DOSBOX

Started by shahnaz, May 17, 2014, 06:54:01 PM

Previous topic - Next topic

shahnaz

Okay so i am new on this forum , and i am just trying to grasp its rule!!
but anyways i am having a problem on running masm commands on dosbox,
currently i am  learning how to use its commands! As i have a 64bit processor so i have to download dosbox and follow certain steps to run it  i have done all the installations correctly and have taken help from all the tutorials and lessons that i came across while searching on google but its not helping!
So, what i did that i made an .asm file and have stored it in the BIN folder of my masm, and then through dosbox i am running it but when i try to compile it , its giving me the errors that unable to link the file!!
So guys, please HELP!!!

Gunther

Quote from: shahnaz on May 17, 2014, 06:54:01 PM
, its giving me the errors that unable to link the file!!
So guys, please HELP!!!

for producing a DOS program, which can run under DOS Box, you'll need to use LINK16.exe. It's in the bin sub-directory. Link.exe is for 32-bit windows applications.

Gunther
You have to know the facts before you can distort them.

shahnaz

I tried to do what u told! but it is still giving me error that this program cannot be run on DOS!

dedndave

show us your code
you can attach by clicking on the "Attachments and other options" link below the Reply window
Zip it, first

shahnaz

i have attached my code, and i am also specifying that from where did i got my masm :
http://www2.hawaii.edu/~pager/312/masm%20615%20downloading.htm

dedndave

in the upper right corner of the forum is a link to a download page
the masm32 package contains much more than just the assembler
it contains include files, libraries, examples, tutorials, etc

hutch--

Try replacing this,


MOV AX,SOURCE
MOV AX,DESTINATION
ADD BX,AX
MOV SUM,BX


with


MOV AX,SOURCE
ADD AX,DESTINATION
;;; ADD BX,AX
MOV SUM,AX


Then get the 32 bit dowload MASM32 at the above link.

dedndave

it assembles and links fine
you have to use Link16.exe, rather than Link.exe - as Gunther mentioned

and, what Hutch said   :P

dedndave

here is a little better version of the 16-bit program

        .MODEL  Small
        .STACK  4096
        .DOSSEG
        .386
        OPTION  CaseMap:None

;####################################################################################

        .DATA

SOURCE      WORD 100
DESTINATION WORD 200

;************************************************************************************

        .DATA?

SUM     WORD ?

;####################################################################################

        .CODE

;************************************************************************************

_main   PROC    FAR

        mov     dx,@data
        mov     ds,dx

        mov     bx,DESTINATION
        mov     ax,SOURCE
        add     bx,ax
        mov     SUM,bx

        mov     ax,4C00h
        int     21h

_main   ENDP

;####################################################################################

        END     _main


honestly, i don't know why you have a 64-bit OS to write 16-bit code, though - lol

shahnaz

honestly, i don't know why you have a 64-bit OS to write 16-bit code, though

because my instructor has told me to use 16-bit code instead of 32-bit =( and i cant just replace my 0S!!
anyways thanks alot for ur help guys !!

Gunther

shahnaz,

Quote from: shahnaz on May 17, 2014, 11:26:31 PM
because my instructor has told me to use 16-bit code instead of 32-bit =( and i cant just replace my 0S!!
anyways thanks alot for ur help guys !!

so, your instructor is an ignoramus. Anyway, I hope it runs now, at least under DosBox.

Gunther
You have to know the facts before you can distort them.