Index

Function Name: PLOT

Purpose: Read/set cursor location
Call address: $FFF0 (hex) 65520 (decimal)
Preparation:

	Registers:	.X = cursor line
			.Y = cursor column
	Memory:		system map
	Flags:		.C = 0 -> set cursor position
			.C = 1 -> get cursor position
	Calls:		none
Results:
	Registers:	.X = cursor line
			.Y = cursor column
	Memory:		TBLX, PNTR updated
	Flags:		.C = 1 -> error

Description: PLOT is an Editor routine that has been slightly changed from previous CBM systems. Instead of using absolute coordinates when referencing the cursor position, PLOT now uses relative coordinates, based upon the current screen window. The following local Editor variables are useful:
SCBOT$E4->window bottom
SCTOP$E5->Window top
SCLF$E6->window left side
SCRT$E7->window right side
TBLX$EB->cursor line
PNTR$EC->Cursor column
LINES$ED->maximum screen height
COLUMNS$EE->maximum screen width
When called with the carry status set, PLOT returns the current cursor position relative to the current window origin (not screen origin). When called with the carry status clear, PLOT attempts to move the cursor to the indicated line and column relative to the current window origin (not screen origin). PLOT will return a clear carry status if the cursor was moved, and a set carry status if the requested position was outside the current window (no change has been made).

EXAMPLE:

	SEC
	JSR	$FFF0	;read current position
	INX		;move down one line
	INY		;move right one space
	CLC
	JSR	$FFF0	;set cursor position
	BCS	error	;new position outside window