News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

How to generate a .COM file?

Started by cqzhy1986, February 26, 2009, 08:59:35 AM

Previous topic - Next topic

cqzhy1986

It's very kind of all of you  :U I have learnt a lot.

jj2007

Quote from: sinsi on February 27, 2009, 09:30:46 AM
Where did 8 bytes come from?
The Hello World cheat - the smallest executable that can say Hello World:
.model tiny

.code
org 100h
start: mov ah, 09h ; write string to STDOUT
mov dx, offset 82h ; get command line
int 21h ; show it... ;-)
ret
end start


"Cheat" because you have to pass the Hello World via the command line (with a trailing $) :bg

herge


Hi jj2007:

Would it be a good idea to put a
  db "$",0
after the ret instruction on the off
chance they don't put a $ at the
end of the command line.
I suspect it might be a run away
looking for a $ that's not there.

Regards herge
// Herge born  Brussels, Belgium May 22, 1907
// Died March 3, 1983
// Cartoonist of Tintin and Snowy

Vortex

Cao Huanyin,

You can use the free linker from Digital Mars to create .COM files.