[Lissner BBS FILE 5]

; Documentation of permanently resident AppleWorks routines.

CALLSEG

; Routine to load segments.  READ IT, you'll like it.  It keeps
; track of which Main is in, and whether ornot Organizer is in.
; As segments are loaded from disk, it tries to store a copy
; in bank-switched.  If still in bank switched at the next
; call of this seg, then the copy will come from bank-switched.
; Mucho faster, of course.
;
; Also of interest is that this works differently for my testing, as 
; opposed to the distributed software.  Testing reads individual 
; segments from disk.  Distribution reads segments 01-43 from a
; single file, seg.mn.  Location in seg.mn is a series of three bytes
; pointers at the beginning of seg.mn.  See program /p2/myasm/combine
; for how this is built.


CC2S

; Routine to concatenate two strings.  First string has second added at end


CLEARDA

; ROUTINE TO clear the window within the display area.  Clears from
; PageBegin to PageEnd

CLEARTA

; Routine to check the typeahead and see if anything waiting.  Sets switches
; including FoundEscape,FoundSpace and FoundReturn.


CLEARWINDOW

; ROUTINE TO clear a specific window.  Clears all columns from row X to row Y

                
CountTA

; Counts the number of characters in TypeAhead.  Returns true or false
; in accum, whether there are any.
; Book Host2.  Console driver.

                
ConsDriver

; Puts (accum)  characters, pointed at by CDAddr, out to the console.
; If characters are less than space (x'20') they are control characters.
;  Look in the Device drivers manual for what they do.  Note that the
;  Equates are different for the //e.

Conv1TP

;
; Routine to convert accumulator to printable 3 digit number with prec blanks
; Result goes into accum, X, Y, and into StrWork3.  Preceding zeroes are 
; changed to blanks.

DieNow.  

; Locks up the system, and stores error information.

DoBell

; Rings the bell.  Returns condition code of non-zero (BT will pick it up)


DoGoToXY        

; Moves the cursor to column X, row Y on screen.  

DoHelp

; Writes OA-? for help on bottom of screen

EnterCommand

; Puts something line "Enter your command" on bottom line, left side


FullExit
                
; FullExit calls Organizer.  Get here at beginning, and also returning
; from "Main" routines.  Have to come here because Organizer may not
; be in memory at the conclusion of the Main.  Some "Main" calls
; return directly to the caller in Organizer.
                
                
GetScrLine
                
; Routine gets a line from the screen.  Input: accum has line number;
; Output, 80 characters at FileBuf+256 thru FileBuf+256+79.


GetArgs

; Get a variable number of arguements from bytes past the JSR               
; Accum will have number of bytes to pull.
; Updates the return address by number of bytes.  
; The pulled bytes go to AArg, AArg+1, etc.

GetVBar

; GetVBar lets the user pick an item from the numbered items
; now on the screen.  The user can move the number bar by using
; the up and down arrows.  Accum at entry has the starting number.
; It will almost always be 1, unless the program is smart enough
; to remember what should be used.  Returns in accum the number picked,
; or zero if escape was pressed
                
                
  
HighLight
  
; HighLight inverses characters that are already on the screen.  This
; is used by deletes, moves, etc.  x and y have screen posn, Accum has
; number of bytes.  Accum may be zero, which will just remove all inverse
; from the line.  Always does whole line.  
;
  
IODisable

; For the //e only.  Prevents IO.  Not needed on MAC


IOEnable

; For the //e only.  Allows disk IO.  Not neededd on MAC

MakeIB

; Clears the screen, writes top and bottom solid lines , file name, escape
; road map.

MadeAChange

; MadeAChange posts the changed flag on current file
                
MultByte

; Actual multiply routine for register X times register Y into  MREG (two
bytes)

MultWord

; Routine to multiply two words.  Addresses follow the JSR MultWord
; Result in MReg (4 bytes)

MvLeftRtn

; Moves bytes from left to right.  
; First word following JSR:  To
; next word                  From
; Next word                  Number of bytes

MvRightRtn

Same as MvLeftRtn, but moves from right to left

PopStack

; Removes current item from the Escape road map.   Displays.

                
PleaseEnter     

; Puts something like "Please type your selection: on line 23

PressAny        

; Routine displays "Press any key to continue"

Print

; Print puts (accum) chars to the printer in slot 1.  Address of data
; (not a string) will be in word following JSR
; 00 in accum:  Open the printer
; FE in accum:  Output a carriage return, line feed
; FF in accum:  Close the printer

                
PushStack       
                
                
; Routine to push the escape roadmap, adding a new string to it, arguement is
; new string that goes into the stack
                
ReadKB

; Gets one byte from the keyboard.  In accum.

RestCursor
                
; Routine to restore cursor position to wherever it was after the last 
; WriteCom.  SaveGoToXY can also set this.
                
SaveGoToXY

; Moves cursor to X,Y, and saves these values for future use by RestCursor

                
SetUCC

; Convert accumulator to upper case, not too tough

SetUCS

; Convert a string to upper case

StrCmpRtn

; Routine to compare two strings.         

StrMvRtn        LDA             #4

; Routine to move one string to another

StrWrRtn
                
; Routine to write a string at coordinates given
; Return2 has Hor and Vert, Return 4 has string address
                
TestKB
                
; Routine checks keyboard.  If finds anything, places in typeahead.  Would
; like to ring bell when full, but this would be recursive and kill me.

Wait

; Routine to wait (accum) tenths of a second.  Just sit.
                
WipeOutTA

; Routine to clear the type-ahead
                

Writ1Byte

; Write character in register X at current cursor position.  Move the
; cursor one to the right after.

WriteCom

Writes the string at 0,23.  Saves the next available cursor position
for future use by RestCursor.

                
VBarWrRtn

Writes a string at the given cursor position.  Numbers it, and displays
the number ahead of it.  Saves location, length, and number for subsequent
use by GetVBar
                
Write

Writes the string at wherever the cursor is now.

WritProp

Writes (register Y) character on screen (register x) times.
Examples:    -                                  80
                RTS

WriteRUSure

; Write "Are you sure"  Question mark will be placed by GetYN
