flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Help with a NASM -> FASM macro conversion

Author
Thread Post new topic Reply to topic
crc



Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc 18 Jan 2004, 15:02
I've been porting SEDForth to FASM, but have run into difficulty with one of the core macros that it uses.

%macro code 1
$1:
%endmacro

How would I code this using FASM?
Post 18 Jan 2004, 15:02
View user's profile Send private message Visit poster's website Reply with quote
VitalOne



Joined: 29 Jul 2003
Posts: 54
Location: USA
VitalOne 18 Jan 2004, 19:54
I'm not sure what the macro exactly does but here's what I've got:
Code:
macro code arg1 {
arg1:
}
    


So now you could do code start or something.
Post 18 Jan 2004, 19:54
View user's profile Send private message AIM Address Yahoo Messenger Reply with quote
VitalOne



Joined: 29 Jul 2003
Posts: 54
Location: USA
VitalOne 18 Jan 2004, 19:56
To make it easier for conversion, this also does the same:
Code:
macro code 1 {
1:
}
    
Post 18 Jan 2004, 19:56
View user's profile Send private message AIM Address Yahoo Messenger Reply with quote
crc



Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc 19 Jan 2004, 04:48
Thanks for your help. The macro you supplied works perfectly for what I needed to finish the port of SEDForth to FASM. While there are a few (minor) problems left to fix, it compiles the handful of small test programs easily now. I've attached a copy here for those who want to look at it.


Description: This is the initial port of SEDForth to FASM. It *does* have a few minor problems, but works at least as well as the NASM version, at least in my quick tests.
Download
Filename: sedforth-fasm.tar.gz
Filesize: 14.62 KB
Downloaded: 709 Time(s)

Post 19 Jan 2004, 04:48
View user's profile Send private message Visit poster's website Reply with quote
ronware



Joined: 08 Jan 2004
Posts: 179
Location: Israel
ronware 19 Jan 2004, 06:15
crc wrote:
Thanks for your help. The macro you supplied works perfectly for what I needed to finish the port of SEDForth to FASM. While there are a few (minor) problems left to fix, it compiles the handful of small test programs easily now. I've attached a copy here for those who want to look at it.

Excellent!

I am porting RetroForth, and I want it to work on both Windows and Linux. Cool...
Post 19 Jan 2004, 06:15
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger Reply with quote
crc



Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc 19 Jan 2004, 06:37
Well, porting RetroForth over will be a much larger task than porting SEDForth (which is why I started with a SEDForth port). As far as I know, you'll have to redo the entire dictionary macro system, a big pain since it is heavily dependent on NASM's xdefine macro functionality. I'll help where I can once I finish the 6.20 release (which brings a lot of cleanups to the core codebase). If you can get RetroForth ported over to FASM, please share the source - I'd love to see it Smile
Post 19 Jan 2004, 06:37
View user's profile Send private message Visit poster's website Reply with quote
ronware



Joined: 08 Jan 2004
Posts: 179
Location: Israel
ronware 19 Jan 2004, 06:46
crc wrote:
Well, porting RetroForth over will be a much larger task than porting SEDForth (which is why I started with a SEDForth port). As far as I know, you'll have to redo the entire dictionary macro system, a big pain since it is heavily dependent on NASM's xdefine macro functionality. I'll help where I can once I finish the 6.20 release (which brings a lot of cleanups to the core codebase). If you can get RetroForth ported over to FASM, please share the source - I'd love to see it Smile

I am at the point where I have an executable which crashes Sad

But I think it should be pretty soon... (if I didn't have lots of other things to do, like paying work Smile
Post 19 Jan 2004, 06:46
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger Reply with quote
crc



Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc 19 Jan 2004, 07:35
Quote:
I am at the point where I have an executable which crashes

But I think it should be pretty soon... (if I didn't have lots of other things to do, like paying work


If you send me a copy of the code you've got, I'll see if I can help you get it working. I have a decent amount of free time right now. If you've already got it to assemble you're doing good! Congratulations on your current progress.
Post 19 Jan 2004, 07:35
View user's profile Send private message Visit poster's website Reply with quote
ronware



Joined: 08 Jan 2004
Posts: 179
Location: Israel
ronware 19 Jan 2004, 18:21
crc wrote:
Quote:
I am at the point where I have an executable which crashes

But I think it should be pretty soon... (if I didn't have lots of other things to do, like paying work


If you send me a copy of the code you've got, I'll see if I can help you get it working. I have a decent amount of free time right now. If you've already got it to assemble you're doing good! Congratulations on your current progress.

I sent you a copy via email - I didn't want to post something half-baked on the board.

Thanks, and all the best.
Post 19 Jan 2004, 18:21
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger 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.