Index

Function Name: MEMBOT

Purpose: Set bottom of memory
Call address: $FF9C (hex) 65436 (decimal)
Communication registers:X, Y
Preparatory routines: None
Error returns: None
Stack requirements: None
Registers affected: X, Y

Description: This routine is used to set the bottom of the memory. If the accumulator carry bit is set when this routine is called, a pointer to the lowest byte of RAM is returned in the X and Y registers. On the unexpanded Commodore 64 the initial value of this pointer is $0800 (2048 in decimal). If the accumulator carry bit is clear (-O) when this routine is called, the values of the X and Y registers are transferred to the low and high bytes, respectively, of the pointer to the beginning of RAM.

How to Use:
TO READ THE BOTTOM OF RAM

  1. Set the carry.
  2. Call this routine.
TO SET THE BOTTOM OF MEMORY
  1. Clear the carry.
  2. Call this routine.

EXAMPLE:

   ;MOVE BOTTOM OF MEMORY UP 1 PAGE
   SEC         ;READ MEMORY BOTTOM
   JSR MEMBOT
   INY
   CLC         ;SET MEMORY BOTTOM TO NEW VALUE
   JSR MEMBOT