asm engine
#1
Posted 05 May 2006 - 11:28 AM
I've been googling and taking a look at Devmaster.net but I can't really find a game (or just rendering) engine for the assembly medium. Maybe because people are afraid of programming in assembler due to the time spent to write and debug, or maybe people are really only interested in C++ because for some it might be more simple.
I took a look at the revamped TripleBuffer also and the asm resources are okay but none that really fullfills my needs (for description' sake).
My question is if anyone interested in programming in asm knows about any sort of asm engine out there. If any I think it would be a great addition to the programmers community. If there isn't then I think I will have to drop my hopes or start everything from the ground up which would take a lot of time.
Any useful information would be great.
Thanks for your time.
~Sephir.
#3
Posted 05 May 2006 - 03:49 PM
I think all you need is an exciting project to work on, not another language.
#4
Posted 05 May 2006 - 07:26 PM
Quote
Here here.
#5
Posted 05 May 2006 - 08:37 PM
#6
Posted 05 May 2006 - 08:49 PM
"Hostile Encounter RTS" said:
...
* We want to make XBox, Linux and MacOS versions also.
Why the hell would you write all of a game in assembly if you are planning on porting it to completely different architectures? :wallbash: What a porting nightmare!
When they say MacOS, do they mean after Apple switches to Intel chips? :surrender
#7
Posted 06 May 2006 - 12:39 PM
There is a point i want to clarify,This is the learning path of assmbly: after learning some 8086 assembly for dos you will need to go to win32 assembler and after a bit you will find that you are ruled with the same windows APIs which you have in C++ but with much work to do and nearly no performance boost because the compilers makers are much much experianced than you(since you are a hoppiest) so the code generated with compilers will be much optimized than your code.
Assembly is interesting if you want to explore new things which are not represented to you by any higher programming langauge and if you want to learn reverse engineering (Thats why i have learned assembly), But it is not practical for medium to large applications and it will be a time waste.
If you want to learn assembly there is http://win32asm.cjb.net and "The art of assembly" free ebook and reading source codes.
If you want engines that use assembly,i did not hear about any new engine that uses assembly but there is TGE which uses assembly for some textures blending,Doom(gpl),Quake(gpl),and i think Quake 3(gpl).
Sorry for the negative feedback :).
bye
#8
Posted 07 May 2006 - 05:03 AM
Quote
This is a complex matter of oppinion. Here are some of my arguments IMHO:
* We know ASM well. ASM is also very easy to learn
* Speed is of the essence in GAMES. ASM is 100% up to 300% faster than today "optimized" compilers
* There will allways be ASM code in a GAME so: Why NOT write all in ASM?
* ASM is free, cant tell that about Most HLL Compilers
* We dont like BLOATWARE generated by most of today HLL compilers
* Very good tutorials at Iczelion's site and web support from Hiroshimator's Win32ASM messageboard make the difference
* A Game req. maximum control over the hardware and software
* ASM gives total power and maximum flexibility
* It is FUN!
It's interesting how people assume hand-written assembly being always faster. Not that these other reasons why they chose asm are any better..:wallbash:
#9
Posted 07 May 2006 - 08:48 AM
#10
Posted 07 May 2006 - 04:37 PM
Alex
#11
Posted 07 May 2006 - 04:50 PM
juhnu said:
#12
Posted 08 May 2006 - 01:00 AM
That was more like a serious question than it was retorical btw, haven't done any hand-written ASM in ages. The last time I checked an instruction reference manual was when AMD introduced their 3dnow
-
Currently working on: the 3D engine for Tomb Raider.
#13
Posted 08 May 2006 - 02:40 AM
Nick said:
#14
Posted 08 May 2006 - 08:23 AM
.oisyn said:
#15
Posted 08 May 2006 - 09:07 AM
Seriously though, if you want to do it just for fun/learning then go ahead,
but i doubt very strongly that that the speed gain overweights anything else
that higher-level languages offer.
#16
Posted 08 May 2006 - 09:16 AM
#17
Posted 08 May 2006 - 12:29 PM
Dias said:
High-level languages use the lowest common denominator, which is just basic 32-bit operations. Modern processors offer a whole lot more, like complex operations and vector operations.
One example of a complex x86 instruction is 'bsr', which stands for 'bit scan reverse'. It returns the position of the first 1 bit, starting from the most significant bit. This is equivalent to an integer logarithm, and can be very useful in some projects. In a high-level language it takes many operations to compute this value. Vector operations use MMX and SSE. SSE can make many floating-point intensive calculations up to four times faster. Examples of real-life software that use (some) manually written assembly code are: audio and video codexes, physics engines, raytracers, drivers, low-level libraries, etc.
Obviously I agree that writing everything in assembly is useless, but using it in some hotspots can be very rewarding to take the application to a whole new performance level. And even if you have no direct use for it, it's still very valuable for debugging. Issues that can take days to debug at high level can become amost trivial when looking through the assembly code.
#18
Posted 08 May 2006 - 12:44 PM
But avoid using an assembler directly (and skip the assembler specific topics in the tutorial). Instead, use inline assembly in C++ to make life easier:
#include <stdio.h>
int main()
{
int a = 345;
int b;
__asm // Start inline assembly block
{
mov eax, a // Load 'a' from memory into eax register
bsr ebx, eax // Compute integer logarithm (base 2)
mov b, ebx // Store result to memory
}
printf("log2(%d) = %d\n", a, b);
}
#19
Posted 08 May 2006 - 02:00 PM
int main()
{
int a = 354;
int b;
unsigned value = a;
// replicate top bit
value |= value >> 1;
value |= value >> 2;
value |= value >> 4;
value |= value >> 8;
value |= value >> 16;
// count bits
value = ((value & 0xaaaaaaaa) >> 1) + (value & 0x55555555);
value = ((value & 0xcccccccc) >> 2) + (value & 0x33333333);
value = ((value & 0xf0f0f0f0) >> 4) + (value & 0x0f0f0f0f);
value = ((value & 0xff00ff00) >> 8) + (value & 0x00ff00ff);
value = ((value & 0xffff0000) >> 16) + (value & 0x0000ffff);
b = value - 1;
printf("log2(%d) = %d\n", a, :wub:;
}
-
Currently working on: the 3D engine for Tomb Raider.
#20
Posted 08 May 2006 - 02:23 PM
Nick said:
I guess i could agree with that though :)
However i feel theres too many discussions about speed around development forums when there are many other important factors to consider as well.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











