News:

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

translate masm to fasm

Started by lixasafa, September 20, 2005, 03:00:28 PM

Previous topic - Next topic

lixasafa

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           

QvasiModo

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

hutch--

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.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

lixasafa