flat assembler
Message board for the users of flat assembler.

Index > High Level Languages > generate data structures

Author
Thread Post new topic Reply to topic
edfed



Joined: 20 Feb 2006
Posts: 4352
Location: Now
edfed 18 May 2013, 15:04
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???
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: 1178
Location: Unknown
HaHaAnonymous 18 May 2013, 16:09
[ Post removed by author. ]


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: 843
Location: Jakarta, Indonesia
TmX 18 May 2013, 17:08
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: 1178
Location: Unknown
HaHaAnonymous 18 May 2013, 17:37
[ Post removed by author. ]


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: 843
Location: Jakarta, Indonesia
TmX 19 May 2013, 02:31
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: 1659
Location: Toronto, Canada
AsmGuru62 19 May 2013, 10:57
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
typedef 19 May 2013, 15:41
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
typedef 19 May 2013, 15:44
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: 1178
Location: Unknown
HaHaAnonymous 19 May 2013, 16:17
[ Post removed by author. ]


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: 2341
Location: Usono (aka, USA)
rugxulo 23 May 2013, 21:57
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


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

Website powered by rwasa.