@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13



Comments:

<0> yup
<1> it was registers registers registers :D
<0> so you need to be pretty specific.
<1> faster but the interrupts were slow as hell :P
<1> I corrected myself to lib
<1> c
<0> system call arguments are p***ed like a function on linux. but not so on netbsd/openbsd.
<0> but both use sysv-style i386 calls.
<1> syscalls are p***ed via regs on linux
<1> heh, dos = linux! :O
<2> OrageTide: syscalls are p***ed via a system similar to stdcall on *BSD from what I have read on www.linux***embly.org
<0> LordZid, i know. i wrote a syscall tracer for the linux kernel for i386 and powerpc
<1> this bsd example uses stack
<2> while linux uses a format similar to DOS for calling params, except when there are too many to fit
<0> it's very function like. though
<3> uh, c doesn't have a calling convention.



<1> twkm: We're waaay past that
<3> any argument can be evaluated in any order.
<1> stop taking the coversation back in time plz
<0> and when you run out of registers for parameters you just p*** on the stack
<1> out of registers?
<0> twkm, we've moved p***ed that.
<0> ehhe
<1> who needs the debug registers free, there's loads of those!
<1> Alipha: Know how all that sub esp, 12 pop ebp crap works?
<0> anyways i don't remember the i386 conventions confidently enough from memory to tell you with more than maybe 80% certainty. i'd recommend just hitting google. there is a nice document on it floating around
<3> hmm, scrolling was weird.
<3> still is weird.
<0> (i haven't do i386 asm programming in about 18 months, been in ppc, mips and 6502 world lately)
<0> twkm, what are you scrolling?
<1> OrngeTide: my only question was which way printf wanted me to push, liff answered that before any of this :P
<0> yea. i just wanted to know if you were asking for i386. and then i got on a tangent.
<3> hmm, trackbar seems to have gone nuts.
<3> ahh, reloading it seems to have worked.
<3> LordZid: yeah -- sorry.
<1> twkm: you time traveler!
<1> Alipha wake up
<3> naw, i've already seen the sports almanac 2000.
<4> LordZid: what about it?
<1> Alipha: i wanna know what ebp is for
<3> "framing"
<4> LordZid: not really appropriate conversation for #c but -shrugs-
<1> I never once touched bp when I was using asm
<1> who cares, **** all else usualy goes on here :P
<0> so true
<0> i was talking about wangs yesterday.
<1> I take it printf pops based on count of codes in the first param
<0> well you don't pop them. you just index the stack.
<4> LordZid: in reality, the function itself does no popping. it uses ebp (or esp) to access the parameters
<1> ye
<4> LordZid: the caller of the function will pop them after the function ends (which really is just add esp, num_of_bytes)
<1> esp+4 = param[1] ?
<0> you get your parameters on the stack. grow it to fit in your local variables. and index the stack to access both parameters and local variables (they are almost the same in this case)
<4> LordZid: yes. though if you're doing "framing" then typically you do: push ebp / mov ebp <- esp / mov eax <- [ebp+8] # first param
<1> why's that? :/
<4> (i'm using <- as to not confuse people which direction the "mov" is doing, since different ***emblers go different ways)
<5> i get the impression that people in programming groups focus a lot on the code's design, speed, etc
<1> the intel syntax says mov here, plz
<5> but, in the business world, i notice that people care more about functionality rather than stuffing 16 variables into a single `int`
<2> and we all know that AT&T eats babies
<2> so intel it is
<2> anyways I'm going to sleep now
<4> LordZid: at&t is the other way
<1> farhan: ****ers, you can fit 32
<1> Alipha: and anyone using AT&T should be shot and killed
<5> hahaha
<5> im doing some touchup on this php code and the guy who wrote it said that he wants it to work, he doesn't necessarily care if its sloppy or not
<1> heh
<1> sounds like a cool job
<1> I'd quite enjoy it
<5> well, its volunteer
<1> Alipha: remember when veg wrote that program and a load of us tried to get it as small as possible?
<1> I think I whipped TJ by a few bytes
<5> lol
<5> replace all printf()'s with write(0.....)



<0> i like fdprintf() i wish it was standard.
<1> printf to the printer! ;)
<5> what's that?
<1> file descriptor printf at a guess
<5> err, single line
<0> yea. it goes to the file descriptor. so you don't need a FILE*
<5> write(fd, buffer, sprintf(buffer, "blah blah") );
<5> that'll do it
<1> erm
<0> farhan, i don't think you know what sprintf returns
<1> wot OrngeTide said
<0> anyways. fdprintf doesn't need a buffer.
<1> that looks more like perl :P
<5> OrngeTide : how so?
<1> farhan: return codes
<0> farhan, you're using an int as a pointer.
<0> ohh. wait. he's right
<5> no
<0> that's very clever.
<1> he is?
<5> sprintf() returns an int
<5> an integer to the length of the string, on success
<0> LordZid, write(fd, ptr, len)
<5> unless im mistaken...
<1> that's what I thought
<1> heh, that's not bad then
<0> farhan, well i take it all back. i like that trick
<1> I've probably used crap like it
<0> although fdprintf doesn't need a buffer, iirc.
<0> LordZid, i'll start using crap like that in my next socket app
<1> OrngeTide: It just saves one temp var to make the code horrible to read
<1> espec if sprintf is taking 13 params
<0> and damn if i get a short write() because i don't care
<5> i've used some pretty ugly code before though....like for(;*ptr;ptr++);
<5> stuff like that
<1> and each param is a function call with 4 more
<0> LordZid, nah. it's not horrible to read.
<1> farhan: loop til you gpf? :P
<0> just put the sprintf on it's own line. i break up big printfs onto many lines anyways
<5> gpf what's that?
<1> I never wrap my code
<1> if it doesn't fit onto 1024 it's too long
<0> farhan, that's not ugly. i use that a hundred times a day
<5> that'll get your pointer to the end of a string
<1> general protection fault, usualy caused by accessing memory you shouldn't
<1> only if you break the loop correctly :P
<0> i do like for(;isspace(*curr);curr++) ;
<1> that's nicer
<1> iswhitespace
<5> OrngeTide : hahahaha, that's evil
<0> there is no iswhitespace in C
<1> and?
<6> ispinkspace()
<1> OrngeTide: I hear the next version of gcc lets you write your own functions!
<0> or curr+=strcspn(curr, " \t\r\n");
<5> i once did "*ptr+3" without thinking about it. only some 3 months later did i change it to ptr[3]
<0> LordZid, wow.
<5> err, sorry, no *
<5> just ptr+3
<0> LordZid, I think functions that start with is are reserved.
<7> #define iswhitespace isspace
<0> if not they should be.
<1> I *hate* the way ptr + 3 = ptr + 12 if ptr is an int
<7> Huh?
<1> but it has more uses than I hate it for
<1> than things I hate it for*
<5> LordZid : i find that EXTREMELY useful
<1> It is
<5> LordZid : you could always use a char pointer
<1> but I still don't like it
<4> LordZid: stop coding ***embly in c :-P
<1> I like my good ol *((char *)tits) crap


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #c
or
Go to some related logs:

#stocks
#photoshop
postyourgirls.com
#politics
#politics
#netbsd
#goal
/etc/x11/xorgs.conf
#gamedev
kocksaugen



Home  |  disclaimer  |  contact  |  submit quotes