Linked by Thom Holwerda on Fri 5th Apr 2013 16:04 UTC
General Development "For years, PC programmers used x86 assembly to write performance-critical code. However, 32-bit PCs are being replaced with 64-bit ones, and the underlying assembly code has changed. This white paper is an introduction to x64 assembly. No prior knowledge of x86 code is needed, although it makes the transition easier."
Thread beginning with comment 557807
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[5]: Comment by Drumhellar
by transputer_guy on Fri 5th Apr 2013 22:06 UTC in reply to "RE[4]: Comment by Drumhellar"
transputer_guy
Member since:
2005-07-08

I did get Dr Dobbs from time to time, but I also have the Michael Abrash book too (Zenn of code optimization, + graphic prog), a lot similar to the Inner Loops. I like the latter because I was only interested in certain types of asm code like JPEG DCT and well inner loops. Its always near by.

Ultimately I let the C compiler do the work of compiling C fragments that are 1 to 1 to asm opcodes, all inline. It just looks nicer than opting into the uglier asm syntax. I never learnt to use the mmx or sse stuff at all, I copped out.

Reply Parent Score: 2

RE[6]: Comment by Drumhellar
by moondevil on Sat 6th Apr 2013 05:20 in reply to "RE[5]: Comment by Drumhellar"
moondevil Member since:
2005-07-08

On the toy compiler that I am cleaning up, referenced in another post, I am actually porting the runtime from C to Assembly.

It is not big, so the porting effort for new architectures is not much bigger than porting the compiler's backend, removes the dependency on a C compiler for the runtime library and it is fun anyway.

This is not a commercial product, so I can allow myself to do this type of stuff.

Edited 2013-04-06 05:25 UTC

Reply Parent Score: 2

RE[7]: Comment by Drumhellar
by TempleOS on Sat 6th Apr 2013 06:47 in reply to "RE[6]: Comment by Drumhellar"
TempleOS Member since:
2013-04-03

Are you calling my compiler a toy and accusing me of not writing it?

It was a toy when I started in 2004, but now it's good.
http://web.archive.org/web/20040606212724/www.simstructure.hare.com...

I optimized by merging little instructions into big x86_64 ones, but the CPU didn't care because it breaks them back into little instructions.

x86 has "1.5 args" per instruction -- it's CISC. You might as well use 2 instructions for every one and it won't matter.

I started with a stack machine.

1+(2+3)*4


PUSH 1
PUSH 2
PUSH 3
POP A
POP B
A=A+B
PUSH A
PUSH 4
POP A
POP B
A=A*B
PUSH A
POP A
POP B
A=A+B
PUSH A
POP RESULT

Here's a mini x86_64 compiler:
http://www.templeos.org/Wb/Demo/Lectures/MiniCompiler.html

Edited 2013-04-06 06:59 UTC

Reply Parent Score: -1