@# Quotes DB     useful, funny, interesting





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



Comments:

<0> can some1 help
<0> i've been trying to build an inline ***embly function to be called from an inline ***embly call..
<0> and it works, but keeps giving me esp errors
<0> i don't know what i'm doing wrong
<0> http://cpp.sourceforge.net/?show=28896
<1> you're not specifying the size of your push'es
<1> sum() is expecting two int's, but it's freeing as much
<1> so your stack is corrupted after the first call
<0> how do i fix it?
<1> I don't know if your compiler understands some sort of size specifier for that
<1> but you could always move the two values to a 32-bit register before pushing
<0> i put "leave" right before "ret"
<0> and the error disappeared
<0> however i don't know what "leave" means
<0> it seems to pair up with "enter" but i am not using enter
<1> you're just making it worse



<1> I still have my login thank you tid
<2> one question, just to see that I'm not messing things up: I wrote a bootloader that loads my program into memory. everything works fine. I set the stackpointer to 7c00 which is as usual. now I kept adding code to my program and at one point it started to freeze. I tracked it down to being a "small" stack problem (stack went over my program, loaded at 500, about 22KB). so I changed the stackpointer to FFFF and now everything works ok.
<2> I know this stack will overwrite the bootloader but since I don't need that anymore, I guess it's not a problem. are there any other issues I need to know about with this setup? according to http://stakface.com/nuggets/index.php?id=10&replyTo=0 there shouldn't be anything else there in memory, between my program, bootloder and stack.
<2> am I right or is that chart wrong?
<0> what does the asm command "ret" do in terms of "mov" ?
<0> what does "ret 8" do ?
<3> hmm
<3> 8 bytes from stack ?
<3> but actually dunno
<3> lol
<4> dextre: there are online x86 ***embly tutorials
<4> why don't you try to find one?
<3> dbtid: what was ret 8 for ?
<3> hehe
<4> i don't know; i abhor intel ***embly.
<3> hmm
<4> i do powerpc, and now, arm4
<3> i#d guess its a ret into another segment
<4> i should say
<4> ARMv4
<4> geez
<4> c-bot intel ***embly tutorial
<5> dbtid, the magic 8 ball says... you're not making any sense; try again.
<4> c-bot google intel ***embly tutorial
<5> dbtid, searching ...
<5> Programmingtutorials.com - Free Online Programming Tutorials, "http://www.programmingtutorials.com/***embly.aspx";
<5> ***embly Language (x86) Resources, "http://cis.csuohio.edu/~somos/asmx86.html";
<5> My Introductory ***embler Tutorial, "http://www.csn.ul.ie/~darkstar/***embler/";
<5> 8086 Microprocessor Emulator with Integrated 8086 ***embler, "http://www.emu8086.com/";
<5> Introduction to Linux Intel ***embly Language, "http://heather.cs.ucdavis.edu/~matloff/50/Linux***embly.html";
<4> have at it
<0> ret 8 cleans up 8 bytes
<0> on return
<0> from the stack
<0> i'm just curious what "ret" does by itself
<0> it seems to be the equivalent of "pop ebp jmp ebp"
<3> call = jmp but put ip into stack
<3> ret == jmp back to location in stack
<3> so i guess if u use call 12345678:12345678
<3> u need ret 8 to go back
<3> hehe
<3> that 'd at least make sense
<3> dextre: then ret 8 should be pop rbp jmp rbp ;]
<3> hehehe
<0> why not ebp
<0> rbp ?
<0> what's that
<3> 64 bit register
<0> and i don't have access to eip
<3> rax rbx rcx rdx ...
<3> ;]
<0> wow cool
<0> call = jmp,, but how do i put the current ip onto stack ?
<3> dunno
<3> push $
<3> ?
<3> push $+3
<3> push $+4
<3> well
<3> something like that
<0> push $ ?



<3> yeah it'll push the offset
<3> $ == current pos
<3> at least for tasm
<3> hehehe
<3> you could probably even use labels
<3> like this
<3> push bla
<3> jmp bla2
<3> bla:
<3> jmp end
<3> bla2:
<3> ret
<3> ;]
<0> i think i got ret to work
<3> watcha trying to do ?
<0> it's "pop ebx jmp ebx" so as to not interfere with eax
<0> i'm trying to understand what is happening on the most basic level
<0> so.. this website i'm reading me tells me that call is "push $+2 jmp _dest_"
<3> hmm
<3> $+2 doesnt make sense at all
<0> push the next instruction, then jmp
<0> yeah :(
<3> that should be offset +2
<0> how do i get the address of the next instruction without labels?
<3> no clue
<3> cpu got access to the eip
<3> you cant use it as register
<3> better use labels instead of having a small dasm running to calculate the size of the opcode
<3> hehehe
<0> okay, i seem to have everything working
<0> i just need one more
<0> ret 8
<0> how does the callee unroll pushed arguments?
<0> i have the 8 there cuz i pushed 2 arguments into the stack before the CALL
<0> so upon return, because i'm using _stdcall, the callee cleans
<0> so ret 8 cleans up 2 32-bit args
<0> add ebp, 8 ?
<3> 8 byte
<0> sub ebp, 8
<0> ?
<3> ?
<0> yah
<0> i'm kinda at loss here
<3> esp == stack pointer
<0> sub esp, 8 ?
<3> dunno
<0> it doesn't like it
<0> i got it
<0> simply pop 3 times
<0> haha
<0> to any reigster
<0> lol
<0> i'm getting a hang of this!
<0> one more question
<0> how do i pop without supplying a register?
<0> can i push and discard?
<0> i mean
<0> pop
<0> pop and discard
<3> ?
<6> dextre? what do you want to know? how does ret clean the arguments from the stack?
<6> lol talking to myself, forgot to scroll =))
<7> it doesnt
<7> the caller cleans arguments in c, not callee...this differs from pascal calling convention, where i believe callee is responsible
<8> indeed
<9> Hey
<9> Any thoughts here on the implementation of a BSP in pure ***embly?
<9> A BSP renderer akin ot Doom.
<4> only that it's harder to do than in a higher level language
<4> if you mean 'board support package'
<9> Well, dbtid, it would be fun.
<4> not my idea of fun
<4> i'm making some mods to u-boot for this board i'm bringing up
<9> Well, I'm obsessed with math ;w


Name:

Comments:

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






Return to #asm
or
Go to some related logs:

#chatzone
Can't open lease database /var/lib/dhcp/dhcpd.leases: Permission denied
#linux
ie page variable
#php
#php
tent_yew_inn
#linux
#AllNiteCafe
#teens



Home  |  disclaimer  |  contact  |  submit quotes