Author Topic: Error Hello World  (Read 3128 times)

x64Core

  • Member
  • **
  • Posts: 80
Error Hello World
« on: June 01, 2012, 06:25:56 AM »
Hello guys, well, I'm reading about DOS applications... and I can not assemble this hello world... lol

Code: [Select]
        assume  cs:cseg, ds:dseg, ss:sseg
cseg    segment
start:
    mov ax,dseg
    mov ds,ax   
    lea dx,message
    mov ah,09h
    int 21h

    mov ax,4c00h
    int 21h

cseg    ends

dseg    segment byte
    message db  "Hello, World!$"
dseg    ends

sseg    segment stack
        db      100h    dup(?)
sseg    ends
end start

after, I tried with a bat file:

Code: [Select]
@echo off

"\Masm32\Bin\doslnk.exe /NOLOGO,3" "DOSMyHello.obj"

pause

why lol

qWord

  • Member
  • *****
  • Posts: 1454
  • The base type of a type is the type itself
    • SmplMath macros
Re: Error Hello World
« Reply #1 on: June 01, 2012, 06:52:54 AM »
Shouldn't you select a .model and an instruction set? Also, do you call an assembler before linking?

MREAL macros - when you need floating point arithmetic while assembling!

MichaelW

  • Global Moderator
  • Member
  • *****
  • Posts: 1209
Re: Error Hello World
« Reply #2 on: June 01, 2012, 07:32:56 AM »
It works for me, assembling with ML 6.15 and linking with Linker Version 5.60.339.
Code: [Select]
ml /W3 /Fl /Sa /c rhl.asm
link16 /MAP rhl;
These are my normal command lines, but you can eliminate all of the switches except /c.
Well Microsoft, here’s another nice mess you’ve gotten us into.

x64Core

  • Member
  • **
  • Posts: 80
Re: Error Hello World
« Reply #3 on: June 01, 2012, 09:53:37 AM »
oh... Now I'm looking the doc lnk.exe program in my folder.... and I did not find it...
 perhaps radAsm is evil and must be link16? ... I will download the latest version of Masm... thanks guys  :biggrin: