flat assembler
Message board for the users of flat assembler.

Index > DOS > Two features I would like in FASM (just suggestions)

Author
Thread Post new topic Reply to topic
Cas



Joined: 26 Feb 2004
Posts: 82
Location: Argentina
Cas
The first one, I'm not sure if it is really not possible, so if anybody knows a way to already do that, I will appreciate your telling me.
The idea is something like the LOAD directive, but that lets you load a whole file (binary) at the desired location. That would be very useful, in my case, for example, when building a blitter. I want to include the palettes inside the routine code file.
Rolling Eyes
The second one, I'm sure it doesn't exist yet.
Sometimes I want to make a program that can be compiled in two or more different ways, then I use a constant and change it everytime I want to compile it in a different way, but I think that it would be good that you could specify the value of such a constant in the command line. For example:

FASM input.asm output.com myconstant=5 anotherconstant=17

This way, I could build a batch file that automatically builds all the files I need or I wouldn't need to change the source file to recompile it.

Embarassed I hope it is not very crazy to propose this. In any case, it is only a suggestion. Worse would be not to say. Cool

_________________
«Earth is my country; science is my religion» - Christian Huygens
Post 24 Apr 2004, 06:56
View user's profile Send private message Yahoo Messenger MSN Messenger Reply with quote
Tommy



Joined: 17 Jun 2003
Posts: 489
Location: Norway
Tommy
First request: use the file-directive... Wink

Cheers,
Tommy
Post 24 Apr 2004, 07:23
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7751
Location: Kraków, Poland
Tomasz Grysztar
For the first one, look at the first question in FAQ.

For the second problem, I can propose the following solution: create few header files with the constant and macros declarations, and in your main file include a header this way:
Code:
include "%myheader%.inc"    

then in your batch you need to set MYHEADER variable to contain the name of header file you want to use, for example if you wanted to compile your source with HDR17.INC file as a header, you would do it this way:
SET MYHEADER=HDR17
FASM INPUT.ASM OUTPUT.COM
Post 24 Apr 2004, 12:00
View user's profile Send private message Visit poster's website Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1137
Location: Russian Federation
comrade
The latter feature using SET and INCLUDE crashes FASM like so:

test.asm:
Code:
include "%xyztest%.inc"    


test.inc:
Code:
nop    


build.bat:
Code:
@echo off
set xyztest=test
fasm.exe test.asm test.com    


Crash is in EXPRESSI.INC:
Code:
15: mov     al,[esi]
16: cmp     al,1Ah
17: je      expression_number
18: cmp     al,22h
19: je      expression_number
20: cmp     al,'('
21: je      expression_number
22: mov     al,11h
23: stos    byte [edi]
24: or      eax,-1
25: stos    dword [edi] <--- HERE (access violation on [edi])
26: jmp     expression_number_ok    


It works in FASMW.EXE only if XYZTEST is defined in FASMW.INI in [Environment] section. But if it is defined using DOS "SET" command, FASMW.EXE also crashes in same spot.

System is Windows 2000 Professional SP4 5.00.2195

If you specify a large memory settings (like -m16384) to fasm.exe, crash comes almost immediately. Otherwise, it waits a bit then crashes.


Description:
Download
Filename: crash.zip
Filesize: 377 Bytes
Downloaded: 271 Time(s)


_________________
comrade (comrade64@live.com; http://comrade.ownz.com/)


Last edited by comrade on 27 Apr 2004, 02:32; edited 5 times in total
Post 27 Apr 2004, 02:12
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1137
Location: Russian Federation
comrade
On Linux it does not work at all:
Code:
-bash-2.05b$ set xyztest=test
-bash-2.05b$ xyztest=test
-bash-2.05b$ set
BASH=/bin/bash
MACHTYPE=i386-redhat-linux-gnu
...
USER=comrade
_=
xyztest=test
-bash-2.05b$ ./fasm test.asm test.com
flat assembler  version 1.52
test.asm [1]:
include "%xyztest%.inc"
error: file not found.    

_________________
comrade (comrade64@live.com; http://comrade.ownz.com/)
Post 27 Apr 2004, 02:24
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7751
Location: Kraków, Poland
Tomasz Grysztar
It was a bug that revealed itself only with some particular variable name and contents combinations - please check the updated 1.52 release.
Post 27 Apr 2004, 06:21
View user's profile Send private message Visit poster's website Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1137
Location: Russian Federation
comrade
Works fine now thanks. I think you forgot to update fasmw152.zip, it still has old preproce.inc.

_________________
comrade (comrade64@live.com; http://comrade.ownz.com/)
Post 28 Apr 2004, 02:06
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7751
Location: Kraków, Poland
Tomasz Grysztar
No, it's OK. Perhaps you had it cached or something like that.
Post 28 Apr 2004, 06:51
View user's profile Send private message Visit poster's website 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-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.