Help Logs Database

Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Ircnet  |  Dalnet
Page: 1 2

<chille> mov 0xdeadbeef, %eax ; 2 cycles?
<chille> mov %eax,0x1337d00d ; 2 cycles?
<chille> can i do that in a even faster way?
<Robert> Ehm.
<chille> hmm... nm
<chille> :X
<chille> wtf
<chille> intel syntax ****s
<chille> :/
<chille> mov eax, [deadbeef] ; 2 cycles?
<chille> mov [0x1337d00d], eax ; 2 cycles?
<chille> i mean like that, i think :)
<chille> -0x
<Robert> Ah.
<Robert> The only way to speed that up would be if you put some instructions between those two.
<Robert> (***uming you have anything that'll have to be performed anyway)
<chille> hmm
<chille> so if i have this, code http://015093881a6781c2.paste.se/
<chille> and want to make a faster one, without loops
<chille> is that possible? o_0
<chille> why is the code above faster if i put another instruction between? is mov executed parallell to the next instruction or something?
<Robert> Basically, yes. But since the second mov depends on the result of the first one in your example, that can't happen.
<chille> damn x86, i don't like it and it don't like me :(
<chille> so for example mov+nop+mov will take excactly as long time as my mov+mov?
<Robert> Hehe.
<Robert> Hm, not sure if that's true.
<Robert> We're talking about a single cycle here though.
<chille> mov eax, [src1]
<chille> mov ebx, [src2]
<chille> mov [dst1], eax
<chille> mov [dst2], ebx
<Robert> That's better, yes.
<chille> will that one be as fast as if i only move src1->dst1?
<Robert> No.
<Robert> But it's faster than if you swap the last two lines.
<Robert> (..I think)
<Robert> This is black magic. :)
<chille> haha, okay
<chille> hmm..
<chille> i guess it is a better idea to learn x86 asm "for real" instead of just trying to tweak some few instructions. do you know any good guide?
<Robert> Check the links in topic. Personally I don't know any.
<chille> haha, okay
<chille> i only used asm on other cpu's. in my world an instruction takes x cycles and the next instruction isn't executed until the first one is done :)
<chille> the only exception is when i use MAC's (multiply accumulate) etc on DSP's
<Robert> Hehe.
<Robert> If you know ***embly language on SOME CPU, I have some good docs for you.
<chille> DSP > *
<chille> yes i do
<Robert> I just feared that you were one of those "HELP THIS DOESN'T LOOK LIKE VISUAL BASIC PLZ DO MY HOMEWORK" guys.
<chille> at least on AVR (8bit MCU), and a bit om motorola's [whatever it's called] and 'C3x (a DSP from TI) :)
<Robert> http://www.cs.nmsu.edu/~pfeiffer/cl***es/473/notes/pentopt.htm
<chille> s/om/on/
<Robert> That's great if you want to know about performance issues.
<Robert> Just not crazy optimisation tricks.
<chille> i know the asm basics. i just don't really get it how the **** x86 works :)
<Robert> http://graphics.stanford.edu/~seander/bithacks.html -- always good to know
<chille> okay :)
<chille> do you have any fpu/sse guide/reference?
<Robert> Yes, one moment.
<Robert> http://nasm.sourceforge.net/doc/html/nasmdoc0.html -- this is always useful. I'll find one with more detail.
<Robert> http://www.intel.com/design/pentium4/manuals/index_new.htm -- I think I used these for that
<chille> damn, i have 36 tabs in my browser :/
<chille> hmm.. what's the opcode for "mov eax, [src]"? o_0
<chille> 8B /r MOV r32,r/m32 2/4 Move r/m dword to dword register
<chille> is it that one?
<imaginator> why don't you dump an ***embled instruction to see? :)
<chille> i tried to dump a diss***embled app, but i didn't find anything useful.
<imaginator> chille: you could put a global label at whatever point you're interested in, and another after it so that you know which address range to dump
<Megan001> I am designing a keypad that outputs 4 bits. When the user enters 7 everything should be fine and my door open, but when any other number is input, a 1 causes an alarm to sound. I designed my circuit but the keypad occasionally outpus 10 - 15. How can I catch that using SE?
<Megan001> any ideas?
<chille> what is SE?
<Megan001> and not or nor
<chille> aha
<chille> hmm
<Megan001> switching expressions
<imaginator> Megan001: are you aware that freenode has #electronics? perhaps that channel could help, if no one here is able to. (I'm not familiar with what you're doing)
<Megan001> here is the problem: http://www.nomorepasting.com/paste.php?pasteID=51122
<furby> hi
<furby> i was wondering if anyone knows were to get MASM
<furby> 6
<xark> furby: It used to come with some DDK from MS.
<furby> but how can i get it now?
<xark> http://users.easystreet.com/jkirwan/new/pctools.html
<xark> or try http://webster.cs.ucr.edu/AsmTools/MASM/
<furby> hmm
<furby> any other sites
<furby> those are the ones i was lolokin at
<xark> furby: The processor pack version won't do?
<furby> hmm is that differnt syntax from the older masms?
<xark> furby: I don't think so, but it requires Windows.
<xark> (I.e., no DOS).
<xark> But it runs from the windows command line (or you can add file.asm to visual studio).
<furby> yeah i just had a asm cl*** in college has an older book and want things to work with lol
<furby> hmm
<furby> hmm wish i could get an older version
<xark> Do you have Visual Studio 6? I don't think it will work standalone (but maybe).
<furby> no i dont have visual any thing lol
<xark> furby: Then I think your option is to try the masm32 "free" version.
<furby> yeah..
<niv_> does anyone here know ***embly on the cray architecture? i'm trying to learn it, under UNICOS 9.0.2
<furby> i emailed my instrutored tonight maybe i can get a copy tomorow
<furby> thanx lateter
<furby> o i like gay ***
<xark> niv_: Sounds like fun. I haven't come across many Cray asm resources...
<niv_> xark: me either. i'm mostly doing dis***embling of my C-code to pick up on the instructions, which is tediuous.
<igor47> when there is a call to a function in ***embly, i'll see something like e8 a7 00 00 00 - how do i know that a7 is the function? how do i link the numbers that come after e8 to a function name?
<xark> igor47: What context? Do you have source code?
<MrP> Hello
<Robert> Hi.
<MrP> How can I get the contents of the AL register as a character instead of hex?
<MrP> These basic concepts are stumping me over and over, never ceases to fail
<Robert> MrP: It's like a photon. It's both - at the same time!
<MrP> Heh
<Robert> Seriously, it's all about how you interpret it.
<MrP> Sure, 0000064 is essentially is character, but how can I get the actual letter from it :)
<Robert> It's already there. You just have to print it.
<Robert> Usually done by writing it to memory, and doing a write() operation on that memory location.
<MrP> hm
<MrP> I'm thinking there is an easier way, because we haven't even gone over memory stuff yet lol
<Robert> Heh.
<Blaz> any suggestions for a nasm IDE on windows ?
<Blaz> hello, of course
<Robert> Hello.
<Robert> I usually use edit.com for that.
<Robert> Of course, the ideal solution is using vim on a nix box.
<Blaz> such a powerful IDE :)
<alexeiM> if coding with C, is the first parameter at ESP or ESP+4 ?
<Goplat> [esp] is the return address, so it's [esp+4]
<Robert> Normally you'll set up a stack frame, leaving the first parameter at [ebp+8], though.
<alexeiM> so if I do a POP the first thing I do, I get the EIP?
<Robert> Yes.
<Robert> Of the caller.
<alexeiM> I thought EIP was pushed before the parameters?
<Robert> No.
<alexeiM> parameters, then EIP?
<Robert> The parameters are pushed manually, then the function is called.
<Robert> Yes.
<alexeiM> crazy
<Robert> Why?
<Goplat> if EIP was pushed first, how would varargs functions know where the EIP is?
<alexeiM> but what is the "First" parameter. I understand C pushed args in reverse?
<alexeiM> so say: "void pushme(int a, int b)"
<Robert> alexeiM: esp+4 is the first, esp+8 the second, etc.
<Goplat> if you call foo(a,b), b is pushed, then a, then EIP
<alexeiM> is a=esp+4 or esp+8 ?
<Goplat> a is esp+4
<Robert> I told you, esp+4


Return to asm
or
Go to some related logs:

archlinux
metal

Copyright © 2005 www.irclogs.ws. All rights reserved. » disclaimer » contact