0

can someone tell or suggest me the way to write a .com program using masm32 ? I have tried using Exe2Bin command used to convert .exe into .com program but din't get any luck. whenever I run this command use to see error: file cannot be converted. Is there any other method to do this ?

dev
  • 191
  • 1
  • 4
  • 14
  • Why don't you just use [NASM](http://www.nasm.us/) instead? – Michael Sep 08 '13 at 09:53
  • 1
    Nasm is great, but I think there's a way to do it with Masm... Try `.model tiny` and perhaps `/t` on the command line. Memory fails me... – Frank Kotler Sep 08 '13 at 11:25
  • Some info here: http://support.microsoft.com/kb/24954 – Frank Kotler Sep 08 '13 at 11:37
  • `.COM` has several strict requirements, one of them being, as @FrankKotler points out, use of the smallest memory model on the x86 (everything is within one 64k segment). I believe it also has to `org` at `100h`. There may be other restrictions as well. Out of curiosity, why do you need a `.COM`? – lurker Sep 08 '13 at 11:43
  • @mbratch I am able to assemble and link the com program by using .model tiny and org 100h in it. but when I run the command "debug n:prog.com". It fails with the error "file not found". could you help here ? coming to the question y .com ? I need to create .COM as I am new to assembly language and wants to debug each and every instruction using the debug command. – dev Sep 14 '13 at 14:06
  • @Michael I felt masm is widely used and I can easily get enough resources to learn it. so I opted for masm. – dev Sep 14 '13 at 14:09
  • 1
    What is `debug n:prog.com`? Are you in the same directory as your `.com` file? What happens if you are in the same directory and you enter `debug prog.com`? – lurker Sep 14 '13 at 14:10
  • yes I am in the same directory. debug prog.com is just working awesome. this means the command "debug n:prog.com" I was running was wrong or for some other tasks. thanx @mbratch – dev Sep 14 '13 at 14:24
  • Could you point to a `debug` manual page that shows the command line option of `debug n:prog.com`? I'm not familiar with it. – lurker Sep 14 '13 at 14:27
  • @mbratch I have seen this command in the book "IBM PC Assembly Language and Programming [Peter Abel]" which I am following at present. – dev Sep 15 '13 at 07:02

0 Answers0