hi this is my first program assembly : hello.asm
.model small
.stack 100
.data
CLRF db 13,10,'$'
MSG db 'Hello!$'
.code
MAIN Proc
;khoi dau thanh ghi DS
mov AX,@Data
mov DS,AX
;ve dau dong moi dung ham 9 cua INT 21H
mov AH,9
lea DX,CLRF
INT 21H
;hien thi loi chao dung ham 9 cua INT 21H
mov AH,9
lea DX,MSG
INT 21H
;ve dau dong moi dung ham 9 cua INT 21H
mov AH,9
lea DX,CLRF
INT 21H
;tro ve DOS dung ham 4CH cua INT 21H
mov AH,4CH
INT 21H
MAIN Endp
End MAIN
i wrote by masm32v9.0 but have some errors when i write : ml hello.asm
link : error segment reference in fix up record
hello.obj: fatal error link1123 : failure during conversion to cof : file invalid or corrupt
when i click project->assembler asm file it has a error
C:\masm32\bin\hello.asm(9) : error A2006: undefined symbol : DGROUP
so i don't to solve these problem
can you helpme
Hi andaihiep,
your question just does not belong here.
You are trying to build a 16bit program for DOS and so you should ask your question in the "16 bit DOS Programming (http://www.masm32.com/board/index.php?board=24.0)"-subforum.
Regards :wink
andaihiep,
You need a 16-bit linker to link this. The 32-bit linker included in the MASM32 package will not work. And if your next question is "where can I get one", I don't currently know. The one that used to be available is no longer.
Thank you very much . I have found the linker for 16bit at the link on the top right : forum links and website, now I can write some small program
I'm not used to seeing ..
lea DX, ...
the 16-bit 8086 can't lea into DX ..
so this assembles much more bytes than the "legacy" instruction ..
mov DX, OFFSET yourlabel
..
LEA DX,SomeLabel works
however, if it is a hard label, MOV DX,offset SomeLabel is faster
LEA should be used when some calculation is required:
lea dx,[bx+8]