Hi,
i'm reading http://nesdev.com/6502guid.txt and i have a couple of questions these were originaly parts of an email thread i started to someone who's been really nice to help me, but i think i might be able to cut him a bit of slack if i post on these boards(thanks blargg)
ok first thing i noticed was in the section about stack pointers in
the third section of the tutorial, not far from the beginning. it says
it keeps info about where to return to after a JSR is executed, and
that this info is kept in low memory from $0100 - $01FF, which is 256
- 511 in decimal format, right? so why does the next statement say,
"The stack grows down from $01FF and makes it possible to nest
subroutines up to 128 levels deep."
erm i'm not exactly sure if this is really 256, my math might be off,
but it's definately more than 128 isn't it? or is it that a subroutine
takes up-2 bits of memory a peice?
ok here's a tricky one, has to do with binary numbers, maybe it's been
a while but i cant remember this trick:
it talks about relative addressing then goes to say that:
If the
value is > $7F (negative) then it is the 2's compliment of the given
value in the negative direction.
i'll pastebin the section:
http://rafb.net/p/L9BOR095.html
why would 0000 0001 would make it -1?
is this just saying that it wraps around? if it's over 256?
and if so, what's the relation of this example to absolute addressing?
i'm reading http://nesdev.com/6502guid.txt and i have a couple of questions these were originaly parts of an email thread i started to someone who's been really nice to help me, but i think i might be able to cut him a bit of slack if i post on these boards(thanks blargg)
ok first thing i noticed was in the section about stack pointers in
the third section of the tutorial, not far from the beginning. it says
it keeps info about where to return to after a JSR is executed, and
that this info is kept in low memory from $0100 - $01FF, which is 256
- 511 in decimal format, right? so why does the next statement say,
"The stack grows down from $01FF and makes it possible to nest
subroutines up to 128 levels deep."
erm i'm not exactly sure if this is really 256, my math might be off,
but it's definately more than 128 isn't it? or is it that a subroutine
takes up-2 bits of memory a peice?
ok here's a tricky one, has to do with binary numbers, maybe it's been
a while but i cant remember this trick:
it talks about relative addressing then goes to say that:
If the
value is > $7F (negative) then it is the 2's compliment of the given
value in the negative direction.
i'll pastebin the section:
http://rafb.net/p/L9BOR095.html
why would 0000 0001 would make it -1?
is this just saying that it wraps around? if it's over 256?
and if so, what's the relation of this example to absolute addressing?