hi guys,
i am new guest to asm, masm and fasm
i want to learn and started with simple program first
however, i wish i could use fasm compiler to compile my masm coding
below, is my masm coding (refer from ibm book) and im trying to change the way of fasm coding
however, its still error at last line, end.
could someone tell me what wrong with its or so many wrong with it?? :'(
im using flat assembler 1.64
----my masm coding-------------------------------------------------------------------------
.model small
.stack 64
.data
.data
DATA1 DB 52H
DATA2 DB 29H
SUM DB ?
.code
main proc far
MOV AX,@DATA
MOV DS,AX
MOV AL,DATA1
MOV BL,DATA2
ADD AL,BL
MOV SUM,AL
MOV AH,4CH
INT 21H
endp
main endp
end main
--------------------- ::)-what im trying to change----------------------------------------------------
format PE GUI 4.0
entry start
DATA1 DB 52H
DATA2 DB 29H
SUM DB ?
;.code
main:
call proc
MOV AX,@DATA
MOV DS,AX
MOV AL,DATA1
MOV BL,DATA2
ADD AL,BL
MOV [SUM],AL
MOV AH,4CH
INT 21H
finish:
end main
FASM doesn't need the "end" directive, just MASM does. Simply remove the offending line.
The program you're trying to assemble is for DOS, but you're telling FASM it's for Windows - that won't work either.
Also your entry point (the place where the computer will start executing your instructions) in your example is called "main", so it should say "entry main" instead of "entry start".
Finally, remove the "call proc" line, since you don't have any procedure named "proc" that you can call there.
Hope that helps! Feel free to ask any more questions. :U
lixasafa,
I moved your posting to the 16 bit forum so you would get more replies. Many of the guys who use FASM started with MASM so they have already done the work you are looking for so it may be worth the effort to join the FASM forum as well and ask in there and from memory some of the macros available in FASM are designed to make it easier to build MASM style code in FASM.
okeh..i will get thru it..tq