Start:
-; Save the zero page locations we need
+; Save the zero-page locations that we need.
ldx #zpspace-1
L1: lda sp,x
dex
bpl L1
-; Switch to second charset. The routine that is called by BSOUT to switch the
-; character set will use FNLEN as temporary storage - YUCK! Since the
-; initmainargs routine, which parses the command line for arguments needs this
+; Switch to the second charset. The routine that is called by BSOUT to switch the
+; character set will use FNLEN as temporary storage -- YUCK! Since the
+; initmainargs routine, which parses the command line for arguments, needs that
; information, we need to save and restore it here.
; Thanks to Stefan Haubenthal for this information!
pla
sta FNLEN ; Restore FNLEN
-; Clear the BSS data
+; Clear the BSS data.
jsr zerobss
-; Save system stuff and setup the stack
+; Save some system stuff; and, set up the stack.
tsx
stx spsave ; Save the system stack ptr
lda MEMSIZE+1
sta sp+1 ; Set argument stack ptr
-; Call module constructors
+; Call the module constructors.
jsr initlib
-; Push arguments and call main()
+; Push the command-line arguments; and, call main().
jsr callmain
-; Call module destructors. This is also the _exit entry.
+; Call the module destructors. This is also the exit() entry.
_exit: pha ; Save the return code on stack
jsr donelib
-; Copy back the zero page stuff
+; Copy back the zero-page stuff.
ldx #zpspace-1
L2: lda zpsave,x
dex
bpl L2
-; Store the program return code into ST
+; Store the program return code into BASIC's status variable.
pla
sta ST
-; Restore the stack pointer
+; Restore the stack pointer.
ldx spsave
txs ; Restore stack pointer
-; Back to basic
+; Back to BASIC.
rts