I'd say code readability is at the level of a Node.js application.
A web server in x86 assembly language
11–20 of 21 posts
Re: A web server in x86 assembly language
#12These Win32 assembly programs are quite cool. I used to dabble with writing small things in it. But I realised a while ago that, as Luyt has already touched on, 95% - 99.x% of the CPU time is spent in the Win32 library code, which is written in C, and which you have to call if you want to do anything significant, eg. put up a GUI. That defeats the performance benefit of writing such programs in asm: like Luyt said th…
Of course, there's always the fun factor :-)
Re: A web server in x86 assembly language
#13I'd say code readability is at the level of a Node.js application.
Re: A web server in x86 assembly language
#14These Win32 assembly programs are quite cool. I used to dabble with writing small things in it. But I realised a while ago that, as Luyt has already touched on, 95% - 99.x% of the CPU time is spent in the Win32 library code, which is written in C, and which you have to call if you want to do anything significant, eg. put up a GUI. That defeats the performance benefit of writing such programs in asm: like Luyt said th…
Also, generally speaking you'd have to be a pretty fine assembler programmer to out-optimise a modern compiler in a meaningful way; either that, or have some knowledge that the compiler doesn't (e.g. data parallelism). Of course, there's always the fun factor :-)
Re: A web server in x86 assembly language
#15These Win32 assembly programs are quite cool. I used to dabble with writing small things in it. But I realised a while ago that, as Luyt has already touched on, 95% - 99.x% of the CPU time is spent in the Win32 library code, which is written in C, and which you have to call if you want to do anything significant, eg. put up a GUI. That defeats the performance benefit of writing such programs in asm: like Luyt said th…
Also, generally speaking you'd have to be a pretty fine assembler programmer to out-optimise a modern compiler in a meaningful way; either that, or have some knowledge that the compiler doesn't (e.g. data parallelism). Of course, there's always the fun factor :-)
Re: A web server in x86 assembly language
#16Earlier quoted context omitted.
Also, generally speaking you'd have to be a pretty fine assembler programmer to out-optimise a modern compiler in a meaningful way; either that, or have some knowledge that the compiler doesn't (e.g. data parallelism). Of course, there's always the fun factor :-)
In terms of out-optimizing a modern compiler, it really depends on what you're optimizing for. For performance, a modern compiler is going to destroy you 99% of the time -- I've been writing x86 assembly for many years and in the vast majority of cases, I can't write faster code than MSVC. However, if code size is what's important, it's easy to beat any compiler. You can often get your code down an order of magnitude…
Re: A web server in x86 assembly language
#17Earlier quoted context omitted.
In terms of out-optimizing a modern compiler, it really depends on what you're optimizing for. For performance, a modern compiler is going to destroy you 99% of the time -- I've been writing x86 assembly for many years and in the vast majority of cases, I can't write faster code than MSVC. However, if code size is what's important, it's easy to beat any compiler. You can often get your code down an order of magnitude…
Why did you use port I/O instead of int 13h?
Re: A web server in x86 assembly language
#18Earlier quoted context omitted.
In terms of out-optimizing a modern compiler, it really depends on what you're optimizing for. For performance, a modern compiler is going to destroy you 99% of the time -- I've been writing x86 assembly for many years and in the vast majority of cases, I can't write faster code than MSVC. However, if code size is what's important, it's easy to beat any compiler. You can often get your code down an order of magnitude…
Why did you use port I/O instead of int 13h?
Re: A web server in x86 assembly language
#19Earlier quoted context omitted.
Also, generally speaking you'd have to be a pretty fine assembler programmer to out-optimise a modern compiler in a meaningful way; either that, or have some knowledge that the compiler doesn't (e.g. data parallelism). Of course, there's always the fun factor :-)
For a large amount of code, like a whole program, maybe. But I think you can still get big gains in small loops or algorithms written and optimized in assembly. Even more so if you optimize for a specific processor and cache. Write the rest of the program in a high level language.
Re: A web server in x86 assembly language
#20 INVOKE SetFilePointer,hFile,FOffset,0,FILE_BEGIN
INVOKE ReadFile,hFile,pMem,FSize,offset NotUsed,0
INVOKE send,wParam,pMem,FSize,0
INVOKE GlobalUnlock,hMem
INVOKE GlobalFree,hMem
INVOKE closesocket,wParam
INVOKE CloseHandle,hFile ;Done with file and socket too.
The guy wrote it in 2001, when he was in high school, and he's done a lot more cool and interesting stuff since then, and it looks like he's graduated to Linux: http://lingcog.iit.edu/~scubed/projects.xmlToo bad he stopped adding new projects to the page in 2007. His "portfolio" page has a few more things since then.