flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > High Level Languages > generate data structures

Author
Thread Post new topic Reply to topic
edfed



Joined: 20 Feb 2006
Posts: 4155
Location: Thank you :D
generate data structures
i am working on fool concept implementation in c++ (sorry Embarassed i don't code a lot in fasm these times, planning to know c++ a little better for food).

what is boring (and the word is far less than reality) is that you MUST deal with Types.

always, always, and again always. even with pointers to pointers... Sad

you might think, you just have to use void pointers to pointers...

lol, it is an error, if you do it, you will have to cast systematically everything to the Type of what is really your void**


then, i am a little disapointed by the c++ to build test data structures and will use fasm to do the job, it was the idea since the begining, but now, it is a little tricky to apply the idea into a makefile.

now, the problem is, can i use make to launch fasm on a source file from the project (under netbeans using mingw) and that's all?

how can i tell netbeans to use fasm to compile my data structures???

_________________
Smile fool
Post 18 May 2013, 15:04
View user's profile Send private message Visit poster's website Reply with quote
HaHaAnonymous



Joined: 02 Dec 2012
Posts: 1173
Location: Unknown
Stupid post removed.


Last edited by HaHaAnonymous on 28 Feb 2015, 20:31; edited 1 time in total
Post 18 May 2013, 16:09
View user's profile Send private message Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 768
Location: Jakarta, Indonesia
Do you mean "how to assemble fasm source via netbeans"?

I think the easiest (?) way is by using makefile
https://cnd.netbeans.org/cnd-tutorial.html#ExistingMakefile
https://cnd.netbeans.org/cnd-tutorial.html#CreateMakefileProject

I do occasionally use NetBeans, but only for Java-related project. Never tried it personally.
Post 18 May 2013, 17:08
View user's profile Send private message Reply with quote
HaHaAnonymous



Joined: 02 Dec 2012
Posts: 1173
Location: Unknown
Stupid post removed.


Last edited by HaHaAnonymous on 28 Feb 2015, 20:30; edited 1 time in total
Post 18 May 2013, 17:37
View user's profile Send private message Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 768
Location: Jakarta, Indonesia

HaHaAnonymous wrote:
To compile projects are real nightmare if you didn't create them from scratch. Makefile here, makefile there, wait some hours, install here, install there, ops target system is not the same, wait more hours.



Then blame the UNIX folks who invented make. The legacy is keep going until now. Very Happy

Makefile has at least 2 advantage though:
1. Separate compilation. If a file is not updated, then it will not be re-compiled.
This can reduce compilation time, which is especially helpful in building large softwares.

2. Parallel execution. More CPU cores to utilise = shorter compilation time.


HaHaAnonymous wrote:

They can't be as easy as: compile this.



At least this is possible in Java. Assume that you don't use 3rd party libraries, then all you have to do is compile the file that contains the main() method. And the compiler will handle the rest for you.
Post 19 May 2013, 02:31
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1381
Location: Toronto, Canada
A lot of type-casting in a C++ project is usually a sign of an improper design.
Post 19 May 2013, 10:57
View user's profile Send private message Send e-mail Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000

HaHaAnonymous wrote:

Quote:
I think the easiest (?) way is by using makefile


Another important disadvantage of these high level languages. To compile projects are real nightmare if you didn't create them from scratch. Makefile here, makefile there, wait some hours, install here, install there, ops target system is not the same, wait more hours.

They can't be as easy as: compile this.


it depends on what kind of developer you are. If you don't know your own compiler then.. OOPS !
Post 19 May 2013, 15:41
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
Re: generate data structures

edfed wrote:
how can i tell netbeans to use fasm to compile my data structures???


Just make a tool to generate your structures and save them into .bins then load then whenever needed or reserve some space in the exe then inject them at run time using Ollydbg.

Many ways to skin this cat here
Post 19 May 2013, 15:44
View user's profile Send private message Reply with quote
HaHaAnonymous



Joined: 02 Dec 2012
Posts: 1173
Location: Unknown
Stupid post removed.


Last edited by HaHaAnonymous on 28 Feb 2015, 20:25; edited 1 time in total
Post 19 May 2013, 16:17
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2096
Location: Usono (aka, USA)
Re: generate data structures

edfed wrote:
i am working on fool concept implementation in c++ (sorry Embarassed i don't code a lot in fasm these times, planning to know c++ a little better for food).



There's nothing wrong (and certainly not surprising) in someone using C++ these days. Heck, I just noticed on Amazon.com that Bjarne's 4th edition book was just published a few days ago (though 1368 pages, ouch! poor poor trees, heheh).


Quote:

what is boring (and the word is far less than reality) is that you MUST deal with Types.

always, always, and again always. even with pointers to pointers... Sad

you might think, you just have to use void pointers to pointers...

lol, it is an error, if you do it, you will have to cast systematically everything to the Type of what is really your void**



A lot of languages struggle with types, esp. C-based ones. I think this is a side effect of being directly inspired by B, which was inspired by BCPL. Back then, everything was (basically) an integer.

Strong typing is supposed to prevent errors (or at least catch them at compile time). It's also supposed to be more efficient at runtime as you only use what you need.

What sounds like your biggest struggle here is declaring types, not just using them. There are tools (e.g. cdecl) that will help you understand what types you want or are trying to use.

Though, quite honestly, you may have better luck with more strict languages. IIRC, languages like ML and Modula-3 claimed to have superior type systems, but I'm not really an expert (esp. on the former).


Quote:

then, i am a little disapointed by the c++ to build test data structures and will use fasm to do the job, it was the idea since the begining, but now, it is a little tricky to apply the idea into a makefile.

now, the problem is, can i use make to launch fasm on a source file from the project (under netbeans using mingw) and that's all?

how can i tell netbeans to use fasm to compile my data structures???



C++, same as C, doesn't have proper modules, even if they do mostly shun the preprocessor. If you want a language that does, you won't be using C++. (There are workarounds, of course, and good [simple?] design can avoid most of the pain. Sometimes I think Makefiles make things 1000x worse than just compiling from scratch: slower but at least it doesn't break.)

In fact, since you're mentioning data structures, you know that Niklaus Wirth was considered a so-called expert on that? He even wrote a Pascal-based book about it (newer version is freely available online as .PDF but now using Oberon language).

In short, you may have to study GNUmakefile syntax a bit. It's not too hard, but sometimes I think we overthink things. For simplicity, you may wish to design things in a modular language first (and/or just link it into your main C++ project, many of them can do so via cdecl libs).

Sorry if this isn't more directly helpful.
Post 23 May 2013, 21:57
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


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.