Page 1 of 1

pceas .BSS directive

Posted: Sun Apr 12, 2015 8:23 am
by Debvgger
Hi, shouldn't the first bytes declared after the first .BSS directive be allocated into $2000 ? Checking the disassembly in Mednafen's debugger shows the address is $2200.

Are the first 512 bytes reserved for some reason? I'm checking the documentation but I can't find anything about that. Am I breaking something if I put a .ORG $2000 after the first .BSS ?

Re: pceas .BSS directive

Posted: Sun Apr 12, 2015 9:57 am
by MooZ
Indeed, .bss starts at $2200.
The first 256 bytes of $2000 is the zero page. You can declare stuffs there using the .zp directive.
Next comes the stack ($2100 - $21ff included). There's no directive. You can still read/write there but you'll most likely shoot yourself in the foot as it's used to store returns addresses, and everything you pushed there with the pha/phx/phy/etc... instructions.

Re: pceas .BSS directive

Posted: Mon Apr 13, 2015 12:53 pm
by Debvgger
Ok, understood. I think I'm too used to manage these things by hand :lol: