Game BoyTM CPU Manual 3.2.3. Program Counter3.2.3. Program CounterOn power up, the GameBoy Program Counter isinitialized to $100 (100 hex) and the instruction foundat this location in ROM is executed.The Program Counter from this point on is controlled,indirectly, by the program instructions themselves thatwere generated by the programmer of the ROM cart.3.2.4. Stack PointerA big key to understanding programming in assemblylanguage on the GameBoy is understanding the concept ofa stack pointer. A familiarity with assembly languagefor other processors helps greatly as the concepts arethe same.The GameBoy Stack Pointer is used to keep track of thetop of the "stack". The stack is used for savingvariables, saving return addresses, passing argumentsto subroutines, and various other uses that might beconceived by the individual programmer.The instructions CALL, PUSH, and RST all putinformation onto the stack. The instructions POP, RET,and RETI all take information off of the stack.(Interrupts put a return address on the stack andremove it at their completion as well.)As information is put onto the stack, the stack growsdownward in RAM memory. As a result, the Stack Pointershould always be initialized at the highest location ofRAM space that has been allocated for use by the stack.For instance, if a programmer wishes to locate theStack Pointer at the top of low RAM space ($C000-$DFFF)he would set the Stack Pointer to $E000 using theby DP Page 63