Author Topic: MASM COMMANDS PROBLEM ON DOSBOX  (Read 6434 times)

shahnaz

  • Guest
MASM COMMANDS PROBLEM ON DOSBOX
« on: May 17, 2014, 06:54:01 PM »
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

  • Member
  • *****
  • Posts: 3585
  • Forgive your enemies, but never forget their names
Re: MASM COMMANDS PROBLEM ON DOSBOX
« Reply #1 on: May 17, 2014, 09:37:11 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
Get your facts first, and then you can distort them.

shahnaz

  • Guest
Re: MASM COMMANDS PROBLEM ON DOSBOX
« Reply #2 on: May 17, 2014, 09:46:11 PM »
I tried to do what u told! but it is still giving me error that this program cannot be run on DOS!

dedndave

  • Member
  • *****
  • Posts: 8823
  • Still using Abacus 2.0
    • DednDave
Re: MASM COMMANDS PROBLEM ON DOSBOX
« Reply #3 on: May 17, 2014, 09:54:08 PM »
show us your code
you can attach by clicking on the "Attachments and other options" link below the Reply window
Zip it, first

shahnaz

  • Guest
Re: MASM COMMANDS PROBLEM ON DOSBOX
« Reply #4 on: May 17, 2014, 10:20:08 PM »
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

  • Member
  • *****
  • Posts: 8823
  • Still using Abacus 2.0
    • DednDave
Re: MASM COMMANDS PROBLEM ON DOSBOX
« Reply #5 on: May 17, 2014, 10:31:45 PM »
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--

  • Administrator
  • Member
  • ******
  • Posts: 6715
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: MASM COMMANDS PROBLEM ON DOSBOX
« Reply #6 on: May 17, 2014, 10:33:33 PM »
Try replacing this,

Code: [Select]
MOV AX,SOURCE
MOV AX,DESTINATION
ADD BX,AX
MOV SUM,BX

with

Code: [Select]
MOV AX,SOURCE
ADD AX,DESTINATION
;;; ADD BX,AX
MOV SUM,AX

Then get the 32 bit dowload MASM32 at the above link.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

dedndave

  • Member
  • *****
  • Posts: 8823
  • Still using Abacus 2.0
    • DednDave
Re: MASM COMMANDS PROBLEM ON DOSBOX
« Reply #7 on: May 17, 2014, 10:34:55 PM »
it assembles and links fine
you have to use Link16.exe, rather than Link.exe - as Gunther mentioned

and, what Hutch said   :P

dedndave

  • Member
  • *****
  • Posts: 8823
  • Still using Abacus 2.0
    • DednDave
Re: MASM COMMANDS PROBLEM ON DOSBOX
« Reply #8 on: May 17, 2014, 10:43:43 PM »
here is a little better version of the 16-bit program

Code: [Select]
        .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

  • Guest
Re: MASM COMMANDS PROBLEM ON DOSBOX
« Reply #9 on: May 17, 2014, 11:26:31 PM »
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

  • Member
  • *****
  • Posts: 3585
  • Forgive your enemies, but never forget their names
Re: MASM COMMANDS PROBLEM ON DOSBOX
« Reply #10 on: May 17, 2014, 11:50:33 PM »
shahnaz,

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
Get your facts first, and then you can distort them.