logs archiveIRC Archive / Undernet / #asm / 2007 / February / 8 / 1
Ever|asT
where is _sin!
i need him
MrOlsen
hi
dbtid
hi
MrOlsen
how are you?
dbtid
fine, but frustrated
MrOlsen
yeah? Whats up
dbtid
this nand flash doesn't work like it's supposed to...
MrOlsen
oh?
dbtid
i should read back EC for the first byte, but i get 2C
and the bits aren't stuck off because the next byte comes back DA
         

MrOlsen
are you using an emulated version
or actual?
dbtid
actual part, of course
if it was emulated, i could change the emulator...
MrOlsen
lol
that wouldn't fix your problem
;)
are you initializing it right
dbtid
sigh
i don't mean to be rude, but answering a lot of questions about it right now would be pointless
this part was jus soldered on to the board
*just
MrOlsen
ok
I'm not sure what you're making either ;)
dbtid
yeah, i know
turns out the DA is correct
the 2c is not thought
should be EC
but the fact that i get DA means that the upper 2 address bits are NOT stuck on 0
however, this part requires FIVE read cycles, not 2
every other nand flash i've looked at only requires 2 cycles
a mfr code and a device code
MrOlsen
ok... well I'm not sure I'd contact the manufacturer
dbtid
no, i won't
we are having problems with this board
that's all there is to it
MrOlsen
ok
dbtid
but i've been working on this issue for a long time
it's not at all obvious what the problem is
isolating individual factors hasn't shown anything
and now i have to pin this stupid thing up to a logic analyzer
and that is not going to be fun
depends on where they put the control lines
but since it's pin compatible with other parts, i just know they did it badly
at least it's not BGA
MrOlsen
I take your word for it... think it's time for a vacation? :)
dbtid
heh
MrOlsen
vacation a nice break no thinking about any projects some fun in the sun...
maybe not :)
you know this fios has alot of echo on it's voice calls
i wonder why
dextre
hello
http://cpp.sourceforge.net/?show=28825
edcba
ebp-4 and ebp-8
for local variables usually
dextre
i get 0xcccccccc for the 2nd local variable when i use ebp-4
some1 in the C++ channel tells me i should turn off optimizations in my program
but it's off
and i still can't get the #
Asmodee`
check the assembly output of the compiler to determine where it's actually putting the variables
dbtid
/op edcba Asmodee`
edcba
thanks
dbtid
yw
         

Asmodee`
ooo so close to losing the chan
i should put an eggdrop in here...
dbtid
not sure what happened to c-bot
i'll check
dextre
this is strange.. ebp-8 is my first variable
Asmodee`
why is c-bot not just a tcl script for an eggdrop?
dextre
the books all say ebp-4
dbtid
i did not write it; i don't know.
Asmodee`
yes, that's what a book would tell you, but the compiler may be doing some weird alignment type stuff
im going to setup an eggdrop and add ops to it, that way if you need an automated op and c-bot isnt here you can use it
dbtid
i can always make c-bot come back
it's a matter of the connection dropping
that's all
Asmodee`
who can op themselves through c-bot?
dbtid
Asmodee`: i can, and right now, that's all that's important :)
i could set you up
i have to talk with Q though
dextre
you are right.. the compiler is doing something weird
Asmodee`
this is why Tamama told you what he did...
you can't trust compilers
dbtid
they lie!
Asmodee`
it may be that you get it to work now, but then you change some C/C++ code and the compiler will change the offsets of the variables
dextre
i think the argument list stays the same
it's the local variables
those are lost in translation
interesting.. upon function exit, it compares ebp to esp
and it calls some stack checking routine
and before it pops ebp and moves ebp back into esp, it stores the return value in eax
is it always eax?
Asmodee`
im sure if you change it's calling convention then that would change
dextre
i'm making everything _cdecl for simplicity
of course.. i have no idea what i'm doing
what's it mean when it goes: push 1
push 2
push 3
is there some unnamed register i don't need to specify for passing arguments into a function?
tiocsti
push immediate is perfectly legal
dextre
where does it go?
it saves it somewhere
right?
i am seeing some weird sh*t
ok
i think i know how it works now
before u do anything, it uses pushes all the function arguments with "push immediate"
then it invokes "call" on the function
then it arrives at some function table,
at which point there's another jmp instruction
and it goes into the body
there's the "push ebp", "mov ebp, esp"
and it becomes unreadable
and if there's local variables.. it invokes "rep stos"
and sets the values
finally, on the way out
if there's a return value
it stores it in eax
and then "mov esp, ebp", "pop ebp"
finally "ret"
what really boggles my mind is.. i see the arguments passed into the function using "push immediate"
but i don't see any "pop immediate"
the compiler simply references the variables by name.. with square brackets
tiocsti
the caller does that, generally
usually at the end of the procedure too
for performance reasons
the mob esp, ebp and pop ebp and ret at the end of the procedure will restore the stack, taking care of any stack used to call functions as well as local variables and such
so pops, as such, arent needed much
its smart enough to track it correctly
dextre
so eax is sort of a scratch pad for exiting functions
tiocsti
yes
dextre
eax is also used for pointer data dereferencing
"&a = 3;" turns into 2 lines in asm: "lea eax, dword ptr [a]" and "mov [eax], 3"
and consistently, it's always eax..
isn't ebx ever used?
tiocsti
sure
if it's needed
complicated programs will use all the registers
dextre
i can only see eax and ebx being used together when u write something like "&a = &b"
tiocsti
the register allocation depends on the complexity of the expression, of course
dextre
if i write my own assembly.. must i use "rep stos" ? can i do without it?
tiocsti
theres more than one way to copy bytes
dextre
when calling a c++ function in asm, i just push the arguments
and invoke "call"
and retrieve the result from eax, right?
tiocsti
yeah
dextre
it tells me the value of ESP was not properly saved
what does this mean?
tiocsti
without seeing the code, i dont know
1 2 next »