flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > NASM Conversion to FASM Help for a Newbie

Author
Thread Post new topic Reply to topic
robink



Joined: 17 Sep 2003
Posts: 14
robink 22 Sep 2003, 18:53
I know that this has probably been answered before but I am a halt here. Please look at this code and tell me how I can do this - Thank-you.

This is in a file called mylib.mac:

macro Write SIT,SL ;ShowIt,ShowLength
{ mov BX,1 ; Selects DOS file handle 1: Standard Output
mov CX,SL ; ShowLength: Length of string passed in CX
mov DX,SIT ; Showit: Offset address of string passed in DX
mov AH,40H ; Select DOS service 40: Print String
int 21H ; Call DOS
}

Code snippet from main program:

include "MYLIB.MAC"
...

Write Eat1,Eat1Length ; and display first text line

GotoXY 14H,0AH ; Position cursor
Writeln Eat2,Eat2Length ; and display second text line

mov AH,4CH ; Terminate process DOS service
mov AL,0 ; Pass this value back to ERRORLEVEL
int 21H ; Control returns to DOS



LRXY DW 184FH ; 18H = 24D; 4FH = 79D; 0-based XY of LR screen corner

VidOrigin DD 0B8000000H ; Change to 0B0000000H if you have a mono CRT!
Eat1 DB "Eat at Joe's..."
Eat1Length EQU $-Eat1
Eat2 DB "...ten million flies can't ALL be wrong!"
Eat2Length EQU $-Eat2
CRLF DB 0DH,0AH

When I compile the program I get the following error message:

Error: undefined symbol

mov CX,Eat1Length

I am sure a lot of you will recognize this code as coming from Jeff Duntemann's new book. I am trying to learn Assembler and FASM by trying to convert some of the NASM example programs. Any help here would be really appreciated. Thanks,

Robin

_________________
Thanks,

Robin
Post 22 Sep 2003, 18:53
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 22 Sep 2003, 19:06
Use = instead of EQU to define numerical constants.
Post 22 Sep 2003, 19:06
View user's profile Send private message Visit poster's website Reply with quote
robink



Joined: 17 Sep 2003
Posts: 14
robink 22 Sep 2003, 19:18
Thank-you so much for your help. I cannot believe it was that simple. Just a praise for FASM - I have really been enjoying using FASM for my learning of Assembler. Keep up the great work.

_________________
Thanks,

Robin
Post 22 Sep 2003, 19:18
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.