| |
| |
| |
|
Page: 1 2 3
<gr00ber> i want to update a pointer argument: <gr00ber> void setESP(int** esp); <gr00ber> which I wanna call with: <gr00ber> int* esp; <gr00ber> setESP(&esp); <gr00ber> this asm seems to be flawed: <Robert> Why a double pointer? <gr00ber> setESP: <gr00ber> mov eax,[ebp+4] <gr00ber> mov [eax], esp <gr00ber> ret <gr00ber> Robert, dunno. That's how the linux code does it :-) To get the esp value into a pointer. <gr00ber> don't understand that code, though <Robert> Well.. if you REALLY want the C function to behave like that, do this: <Robert> setESP: <Robert> mov eax,[esp+4] ; not ebp! You have no stack frame here <Robert> mov eax,[eax] <Robert> mov [eax],esp <Robert> ret <Robert> I just can't see why you want this. <gr00ber> I have no idea either. <gr00ber> thanks. <aFlag> me neither <Robert> Heh. <Robert> "I don't know why I want this". <gr00ber> yup <aFlag> i think he's reading linux code <aFlag> and trying to understand <gr00ber> yup <gr00ber> nope <gr00ber> trying to rip of stuff without understanding :-) <aFlag> then he's just reading it <aFlag> hehe <gr00ber> lazy f**k <aFlag> why do you want to rip of stuff? <gr00ber> dunno <aFlag> are you writting your own kernel? <gr00ber> just playing around <gr00ber> me writing a kernel is like George Bush writing a book <gr00ber> result => a piece of crap <aFlag> i bet you can write a decent one if you put some effort <gr00ber> some effort? that's the understatment of the century, isn't it? <Robert> No. <aFlag> it's not that hard writting a kernel, the hard part is all the functionalities you have to write due to all the different stuff computers do <gr00ber> depends on the kernel sofistication i guess <Robert> If I were you, I'd write a simple kernel for a simple computer. <Robert> The PC is not simple. <gr00ber> the linux kernel is a major undertaking because of all the micro optimizations <Robert> Linux is not simple. <Robert> You want to avoid these. <aFlag> like, you have to write stuff for handling video input, firewire, all that kinda stuff <gr00ber> Robert, HA - your solution worked <gr00ber> nice <aFlag> getting threads and a good virtual memory system will require some work <gr00ber> video input? <aFlag> but that's not necessarily the kernel <aFlag> you could have most of it outside the kernel <Robert> gr00ber: It's just that this is a very odd way of doing something this simple. <Trinsic> linux is slow compared to windows. <Robert> gr00ber: Normally you'd just inline mov [variable],esp <gr00ber> well, i guess it's for a reason <Trinsic> though it's more stable. <aFlag> gr00ber, yeah, like that video for linux thing on linux <Robert> Linux is slow? <Robert> Strange. <gr00ber> lol <Robert> I never noticed that. <Robert> Trinsic can't be wrong - only my eyes. <aFlag> linux is fairly fast <gr00ber> I'm writing this on Linux on an 8 year old computer and it flies <Trinsic> ake about 4 minutes to boot. windows xp takes about 35 seconds. <Trinsic> takes <gr00ber> Trinsic, ??? <Robert> Trinsic: Depends how much you load. <aFlag> i think it even beats the bsds in the benchmarks <gr00ber> I boot in less than a minute on this old crap computer <Robert> Yes, same here. <gr00ber> the 2.6 kernel rox <Trinsic> applications are faster too. <Robert> Do you have any case of support for that claim? <Robert> (other than microsoft-sponsored benchmarks) <Robert> any kind of* <aFlag> Trinsic, you are probably loading tons of stuff you don't use <Trinsic> do not trust and you will not be trusted. <aFlag> or that you don't even have hardware for <Trinsic> possibly. <Trinsic> i am using standard suse. <Robert> Hah. <aFlag> there you go <Robert> I removed SuSE on the box of a guy. <Robert> Installed the default install in Debian. <Robert> MUCH faster. <aFlag> i like debian <aFlag> i use it :) <Robert> Even though Debian isn't _that_ minimalist, really. <Robert> It's just infinitly much better than SuSE> <aFlag> well, if you take out discover and compile your own kernel the load time will be as fast as you can get <aFlag> but i don't because i'm lazy hehe <Trinsic> an example is i should be loading postfix, becuase i never use it. <Trinsic> shouldn't <aFlag> and because i don't understand lots of stuff in the kernel's menu thing <gr00ber> Huh. <gr00ber> Does General Protection Fault, error code 10108 mean anything to you? <skuggi> 10108 sorta look like a winsock error code :P <gr00ber> lol <gr00ber> well, with the new fancy intel chip sets with WLAN built in, who know what error codes will pop up <skuggi> mm jag 3 full <skuggi> *hick <iojkl> hello <joshux> are there any good dos programming tutorial ? <xark> joshux: Sure lots. Probably more than 32-bit x86 programming. <aegray> i **** at conditionals <aegray> if i have rsbs r12, r0, r1 lsr #8; bcc addr <aegray> thats: r12 = (r1 >> 8) - r0; <aegray> but when would the carry flag be set? <aegray> if ((r1 >> 8) < r0)? <xark> Hmm, on ARM carry will be clear if the result is >= 0. I think. :) <welson> anyone has read 'Art of ***embly' ? <welson> i'd like to get my feet wet-- in begining reading upon ***embly <aegray> xark: thanks <chille> can i mov a dword from one place in memory to another on x86 with just one instruction or do i have to use registers? <wobster> not with a single but without using the regs. look for LODS ops <chille> okay <intero> what is the diffrence between lea and mov? <dr3f> lea=give you address of something <dr3f> mov = put data somewhere <dr3f> if you worked with c,i can say lea is like & and mov is like = <undesktop> yeah, lea doesn't read the data, it just gives you the address of that data <Robert> Heh. <undesktop> so you can use the CPUs address caclulation facitility to do your own stuff <intero> ah thanks alot everyone! <Robert> The #asm faq should have three entries: "what's lea?", "how do I print a number?" and "how do I write an operating system without actually having to know what I'm doing?" <skuggi> :) <Robert> (note that the first two entries aren't intended to be insulting) <intero> good that you specified <Robert> Hehe. <Robert> It's just that people have been protected from converting string to integers and vice versa. <Robert> So they can't imagine how to do such a simple thing. <Robert> And about lea... I guess it's just something different from what people normally do. <undesktop> maybe people are confused by lea, because you can do the same with add/shr (etc) <dr3f> they confused because,at some compilers like fasm,you can do mov reg,var <dr3f> without using "offset" word <dr3f> and its look the same as lea <undesktop> oh <xark> I thought lea was to multiply by 5. :) <xark> er, was for... <dr3f> lea dont connected with math <intero> xark: leal <xark> intero: Well, that depends on your ***embler
Return to asm or Go to some related
logs:
"change mysql data directory" linux organon-phil"
damn cfdisk Tony Hawks American Wasteland PAL DNAS
|
|