6 ms·
Well, you could edit machine code directly, or do the next best thing and write in assembler: cmp eax, 100 jle LESSTHAN mv 10, edx ret LESSTH
by wtracy 13y ago
Well, you could edit machine code directly, or do the next best thing and write in assembler:
cmp eax, 100
jle LESSTHAN
mv 10, edx
ret
LESSTHAN:
mv 5, edx
ret
I doubt that's what the author had in mind, though.
- sheetjs 13y agoI'm surprised the author didn't write a shorter C example: return price > 100 ? 10 : 5;
- yohanatan 13y agoActually LLVM assembly might be a better choice these days.
- deleted 13y ago[deleted]
- waps 13y agoA real programmer would write : 83 f8 64 7e 06 ba 0a 00 00 00 c3 ba 05 00 00 00 c3 Or even : 10000011 11111000 01100100 01111110 00000110 10111010 00001010 00000000 00000000 00000000 11000011 10111010 00000101 00000000 00000000 00000000 11000011 I'd do better still, but I lost my butterfly somewhere.
- sklivvz1971 13y agoA real programmer would hand assemble a LISP interpreter and then pass it the LISP source. Come on.