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."
Permalink for comment 557823
To read all comments associated with this story, please click here.
RE[7]: Comment by Drumhellar
by TempleOS on Sat 6th Apr 2013 06:47 UTC 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