Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

x86 Assembly Questions

Name: Anonymous 2014-04-26 23:52

$ cat bork.asm

section .data
fuck: dd 0xDEADBEEF

section .text
global _start
_start:
mov dword [fuck],0xABADC0DA

mov eax,1
mov ebx,0
int 0x80


Why doesn't writing to the .data segment segfault? Shouldn't Linux map it to a read-only page?

$ nasm -f elf bork.asm
$ gold -s -o bork-gold bork.asm
$ ld -s -melf_i386 -o bork-ld bork.o
$ du -bh *
432 bork-gold
132 bork.asm
340 bork-ld
608 bork.o


How does such a minimal binary take up 300+ bytes?

Name: Anonymous 2014-05-26 9:38

>>80
can you tell me one portable language that can do this?
you can always use non-portable extencions

Name: Anonymous 2014-05-26 10:09

>>80
"very inefficient"...? REALLY? Honestly, are you 12? I think you must be. It isn't inefficient at all, it's just you're to damned lazy and immature to do anything for yourself if the language doesn't do for you. If you want to tabulate data about functions make a fucking TABLE.

Name: Anonymous 2014-05-26 17:14

>>81

you can always use non-portable extencions
there are no nonportable extensions, besides patching intermediate assembly code.

>>82
If you want to tabulate data about functions make a fucking TABLE.
Table lookup is O(log2(N)). And you have to initialize it, after addresses become known.

Name: Anonymous 2014-05-26 19:00

>>83
Umb, hashtable lookup is O(1) if the size of the key is bounded by a constant. Though this would be interesting to have. A lisp to assembly compiler should implement the documentation string this way. Although I don't know if a page with execute permissions is the best place to store it. It might clog the instruction cache.

Name: Anonymous 2014-05-26 19:19

>>84
Umb, hashtable lookup is O(1)
that O(1) is order of magnitude slower than array[i]'s O(1)

Name: Anonymous 2014-05-26 19:41

>>83
Lookup can be O(1), especially with a non-hash table. Bury the fp in a global struct. (But globals! Functions are global symbols too, deal with it.)

>>85
O(10) is still O(1). You're going to have to switch to cyclomatic complexity if you want to whine about large multipliers.

Name: Anonymous 2014-05-26 20:25

>>86
Computers have finite amount of memory (i.e, they are FSMs), meaning that any computation is O(1), yet this O(1) tells you nothing.

Name: Anonymous 2014-05-26 20:39

>>87
That isn't true. It means many computations could be written as O(1) with a large constant multiplier. Some could not, in fact, because some computations cannot be made to fit in memory in an O(1) form. Others cannot be expressed in a general O(1) form if P!=NP, and even if P=NP, the memory required might exceed what is available.

Name: Anonymous 2014-05-26 21:29

>>87
You must be the Reuleaux triangle faggot from a few years back.

Name: Anonymous 2014-05-26 21:48

>>88

http://en.wikipedia.org/wiki/Coppersmith%E2%80%93Winograd_algorithm
it is not used in practice because it only provides an advantage for matrices so large that they cannot be processed by modern hardware.
so a fast algorithm isn't always useful.

Name: Anonymous 2014-05-26 21:52

So you losers failed computer science and now instead of debating it with colleagues in academia you debate with fellow losers on here?

Name: Anonymous 2014-05-26 21:54

>>90
Why not just calculate the matrices in your head?

Name: Anonymous 2014-05-26 21:57

I can solve the halting problem in my head. You aren't a qualified programmer if you can't as well.

Name: Anonymous 2014-05-26 22:01

>>91

Enjoy wasting your $150,000 on MIT or be a debt-slave your whole miserable office life.

Name: Anonymous 2014-05-26 22:03

>>94
Don't see his posts!

Name: Anonymous 2014-05-26 22:08

Programming is just mental manual labour.

Name: Anonymous 2014-05-26 22:18

After Aaron Swartz was murdered by MIT it was no longer worthy in my eyes. I'd rather receive my education from the underground.

Name: Anonymous 2014-05-26 23:34

>>90
It's not O(1) and can't be generalized to O(1) in finite space, which was the point of >>88. The original point remains that O(k*n) for k=10 is still pretty great.

>>93
That's called a siezure and you should be on medication.

Name: Anonymous 2014-05-27 0:57

>>98
Atheists cant do math, what's new?

Name: Anonymous 2014-05-27 1:11

>>99
Why do you love atheists so much, theist-kun? Have you both considered FUCKING?

Name: >>98 2014-05-27 4:33

I have considered fucking. But not with >>99-san

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List