@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2



Comments:

<0> hi all
<0> in linux asm (at&t): If, for example, I have in my .data section a: .double 4.0 and I'm debugging the program in gdb, how can I check that the floating-point value at 'a' is still 4.0?
<1> use insight? :P
<1> and add a watch
<0> if it were a: .long 4 then I could just print/x a then x/xw the address that print gave me
<1> no idea :P
<1> << too lazy to use gdb from terminal ;)
<1> i prefer a gui :P
<0> never used a gdb gui before...
<0> a lot of people think I'm a ways behind the times, but I still code in vi
<0> which gui do you use?
<0> welcome back
<1> thanks
<1> stupid router :(
<0> heh
<1> i use insight as a gdb frontend



<0> don't know if you saw or not, but I asked which gdb gui you use
<2> ddd is fairly nice, too
<1> yeah
<2> and gdb comes with a text ui these days, iirc
<2> gdb -tui or smth
<1> but not on win32 :P
<2> i think ddd comes with cygwin?
<1> no i guess
<1> i run cygwin/mingw+msys
<1> never seen ddd
<1> nor encountered a win32 port anywher
<1> e*
<0> ty
<2> http://cygwin.com/packages/ddd/
<1> umm
<1> that must be new then :P
<1> thanks, will check it out ;)
<1> kinda useful to have more than 1 debugger frontend i guess
<1> insight is clumsy on win32
<1> totally
<3> what exactly does a lea ?
<1> http://help-site.com/local/ASMTUT.TXT
<4> that's not really a good overview of lea
<1> :P
<1> but a nice start :P
<4> lea allows you to exploit the addressing logic's power to do arithmetic
<4> like addition and multiplication by some constants very fast
<4> and of course it also allows you to store intermediate addresses :D
<4> ah, lea also doesn't touch flags which is nice in many cases
<0> santiy check... why can't I fld %st0 to push another copy of %st0 onto the stack?
<5> node_6: you get an error from the ***embler for that?
<0> as -a isn't giving me bytecodes for it (indicates a problem)....
<0> "bad register name"
<0> ahh... drop the 0
<0> there is no %st0.... %st, %st1, %st2, etc.
<5> oh
<6> has anyone ever debugged dynamically created ***embly code :D
<7> yes and ?
<6> i need some hints
<6> gdb isnt very helpfull
<6> i have a recompile which recompiles mips-code into x86-code
<6> recompiler*
<6> at runtime of course
<6> and gdb isnt a great help there since there are no debugging symbols in the code etc
<0> doesn't gcc 3.4.3 support extended asm?
<0> __asm__ ("movl $1, %0" : "=r" (make_me_one) : "0" : "0" ); gives "parse error before : token"
<8> i have some asm that worked on 32bit x86, but 64bit x86 i got this: /tmp/ccPiqxnF.s:7: Error: suffix or operands invalid for `pop'
<8> does anybody know how to fix this?
<8> " pop %eax \n" this is the code
<0> try popq instead
<0> wait...
<0> on 64-bit architecture, is eax still 32-bit?
<8> i'm no asm coder , hehe, so i don't really know
<0> if popq gives an error - or if line produces strange results - try popl instead
<6> pop %eax doesnt work
<6> you need pop %rax
<9> Anyone know how to impliment exception handling in ***embly language?
<10> __mikem, yes, in general terms
<9> Is there like a register that I have contain the address of the function to jump to when theres an error or something
<10> I guess that'd be a simple way of doing something like exception handling, jump to a special error routine that resets the stack pointer.



<9> Yes, but how do I set it up
<10> Make a special error routine that resets the stack pointer to a known value.
<10> Then jump to it if you have an error.
<10> Or are you thinking of trapping divide-by-zero, that sort of thing?
<9> Yes
<9> THats what I mean
<9> Normally that kind of exceptiono is fatal
<9> so I don't even get a chance to test the exception flag
<10> I've only ever set up signal handlers under C; doing so is an OS-specific kind of thing. Once you find the basic method for your particular system, it should be pretty straightforward whether in C or in asm.
<9> Is there an api independent approach
<10> The commonest one I know of is the posix approach, but that's api-dependent by definition.
<9> what I mean is, the api itself has to ultimately do something on the ***embly level that impliments the exception handling, what I mean is how does say the crt impliment it though
<10> The api has to cooperate with the OS in this regard. As I say, I've only ever used C for it. If I had to do it today, I'd go and see what's under those particular covers.
<9> I guess that makes sence since it is ultimately the OS that decides what to do with a program that just caused an exception
<10> That's true.
<9> I am actually reading my brothers old College Text Book on Operating systems
<10> Which book?
<9> A modern Perspective by Gary Nutt
<10> I haven't read that one.
<9> I am going to be a Doctor of computer science when I grow up
<10> As good a goal as any, __mikem. :)
<0> Doctor of Computer Science => Philosophy Ph.D. at my U
<0> make's sense though considering all the psych courses you have to sit thru
<0> can you not fld constants? (ie. fld $3) .. do you have to my_const: .double 3 then fldl my_const ?
<0> I have a single object file compiled from asm source that I link into my primarily-C-source binary. I have found that using /any/ level of optimization (-O1) causes a segfault. Any idea how to remedy this?
<11> where might i find documentation for the sys_sync and/or sys_fsync syscalls?
<12> Hi !
<12> How can I know what registers are to be erased/modified by a function call ?
<12> It seems that printf nukes ebx and ecx when I call it...
<12> Isn't it jsut supposed to put its result in eax ?
<10> Code defensively.
<12> Quartus, well...I just dont feel like saving/restoring the whole bunch of registers at each call... It kinda slows the code...
<10> Sure, that sounds like overkill.
<10> However, printf isn't exactly light anyway, so in that particular case you'd be hard-pressed to notice a slowdown.
<12> indeed, calling printf must be done after saveing the 4 main regs... that ****s.
<13> hi
<13> if i add 2 variables, where is the result stored?
<10> Is that a zen thing, like the sound of one hand clapping? :)
<14> add eax,90: eax += 90;
<13> where is the result stored after i add 2 variableS?
<12> cplusplus2, i guess you just had the anwer
<12> cplusplus2, but this depends on your architecture of course.
<7> you add an amount to a variable
<7> you don't add 2 variables
<10> Well, you certainly can add two variables, and, say, print the result. Or store the result in another variable. Or discard it.
<10> Or p*** it to a function.
<14> yah
<10> Or send it down a communcations line, or record it on media.
<12> add r1,r2,r3 <-- ain't you adding r2 and r3 ? (and adding this amount to r1...)
<14> that would add r2 and r3 and put it in r1.
<14> i think.
<13> @axioplase: X86 archiecture!
<12> cplusplus2, you didn't say...
<13> yes i away away from comp.
<10> cplusplus2: when you add two variables, no matter what architecture, the result goes wherever you choose to put it.
<13> i made:
<13> mov eax,var1
<13> mov ebx,var2
<13> add eax,ebx
<12> in eax
<13> ah
<13> cant u put it into ebx?
<10> You can't be serious. Can he be serious?
<4> yeah
<4> not knowing ***ociativity
<12> yes I can
<12> add %ebx,%eax
<4> ;)
<13> ok thx Axioplase
<12> (never depress again that little button)
<4> hmm axioplase, actually, judging from the % marks, that is AT&T, with left-to-right input-to-output ordering, so actually it would put it into eax again...
<12> oggis_, no
<4> one can also use lea to put a sum to an arbitrary register but it's slower by far
<12> It's because I'm coding in ASM for GCC...


Name:

Comments:

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






Return to #asm
or
Go to some related logs:

#lisp
phing gentoo install
consolechars gentoo
+linux +clariion +parted
freenode autoop
devid ndiswrapper
two slits fluxbox
#gentoo
#suse
ftp+openzaurus



Home  |  disclaimer  |  contact  |  submit quotes