[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]

B-30. Function Name: SETNAM

Purpose: Set file name
Call address: $FFBD (hex) 65469 (decimal)
Communication registers: A, X, Y
Preparatory routines:
Stack requirements: 2
Registers affected:

Description: This routine is used to set up the file name for the OPEN, SAVE, or LOAD routines. The accumulator must be loaded with the length of the file name. The .X and .Y registers must be loaded with the address of the file name, in standard 6502 low-byte/high-byte format. The address can be any valid memory address in the system where a string of characters for the file name is stored. If no file name is desired, the accumulator must be set to 0, representing a zero file length. The .X and .Y registers can be set to any memory address in that case.

How to Use:

  1. Load the accumulator with the length of the file name.
  2. Load the .X index register with the low order address of the file name.
  3. Load the .Y index register with the high order address.
  4. Call this routine.

EXAMPLE:

   LDA #NAME2-NAME     ;LOAD LENGTH OF FILE NAME
   LDX #<NAME          ;LOAD ADDRESS OF FILE NAME
   LDY #>NAME
   JSR SETNAM

B-31. Function Name: SETTIM

Purpose: Set the system clock
Call address: $FFDB (hex) 65499 (decimal)
Communication registers: A, X, Y
Preparatory routines: None
Error returns: None
Stack requirements: 2
Registers affected: None

Description: A system clock is maintained by an interrupt routine that updates the clock every 1/60th of a second (one "jiffy"). The clock is three bytes long, which gives it the capability to count up to 5,184,000 jiffies (24 hours). At that point the clock resets to zero. Before calling this routine to set the clock, the accumulator must contain the most significant byte, the X index register the next most significant byte, and the Y index register the least significant byte of the initial time setting (in jiffies).

How to Use:

  1. Load the accumulator with the MSB of the 3-byte number to set the clock.
  2. Load the X register with the next byte.
  3. Load the Y register with the LSB.
  4. Call this routine.

EXAMPLE:

  ;SET THE CLOCK TO 10 MINUTES = 3600 JIFFIES
  LDA #0               ;MOST SIGNIFICANT
  LDX #>3600
  LDY #<3600           ;LEAST SIGNIFICANT
  JSR SETTIM

[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]
This page has been created by Sami Rautiainen.
Read the small print. Last updated December 17, 2002.