Archived

This topic is now archived and is closed to further replies.

Link

MAMS assembly

Recommended Posts

i''m learning assembly language for a university test. My teacher what i must use MASM as compiler. it is a old DOS version, and it is composed by only 3 files: LINK.exe MASM.exe TD.exe i would know how compile and link am .ASM file. Please help me. Tnx

Share this post


Link to post
Share on other sites
i''ve tried to compile this code:

cr equ 0dh
lf equ 0ah
tp equ 24h
stack segment para ''stack''
db 100 dup(0) ;dimensiona lo Stack
stack ends
data segment para ''dati''
Messaggio DB ''Salve Mondo'',cr,lf,tp ;dichiarazione del messaggio
data ends
code segment para
main proc far
assume cs:code,ds:data,es:data,ss:stack
mov ah,0fh ; P
int 10h ; R
mov ah,0 ; O
int 10h ; L
mov ax,data ; O
mov ds,ax ; G
mov es,ax ; O
mov ax, SEG Messaggio ; ax = indirizzo del Segmento Dati
mov ds, ax ; ds = ax
mov dx, OFFSET Messaggio ; ds = offset del Segmento Dati
mov ah, 09h ; ah = 09h
int 21h ; chiamata all''interrupt DOS
mov ah, 4Ch ; ah = 4Ch
int 21h ; chiamata all''interrupt DOS
code ends
main endp
end main


but i get 1 error

C:\Documents and Settings\Desktop\Assembly compilatore>masm prog.asm
Microsoft (R) Macro Assembler Version 4.00
Copyright (C) Microsoft Corp 1981, 1983, 1984, 1985. All rights reserved.

Object filename [prog.OBJ]: a
Source listing [NUL.LST]: b
Cross-reference [NUL.CRF]: c
End of file encountered on input file
prog.asm(29) : error 85: End of file, no END directive
End of file encountered on input file
prog.asm(29) : error 85: End of file, no END directive

49874 Bytes symbol space free

1 Warning Errors
1 Severe Errors

what i wrong?
after how can i do to the linkage?

Share this post


Link to post
Share on other sites
You don't have a main label to end..

end main doesn't do anything since there isn't a main label



[edited by - Maega on October 16, 2003 2:32:40 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
It looks like he does have a main label to end, in line 11. Not sure what the "far" on the end of it is for though..

Share this post


Link to post
Share on other sites
Do someone know where get a guide about MASM compiler whatever tutorial or description to compile assembly with this compiler?
Tnx

Share this post


Link to post
Share on other sites
What seems strange to me: the end for the code segment is before the end of the procedure. try to swap the ends and the endp.

[edited by - VolkerG on October 17, 2003 12:44:58 PM]

Share this post


Link to post
Share on other sites
i don''t talk about best ASM tutorial but right some indication to how compile below MASM compiler

Share this post


Link to post
Share on other sites