]> git.sur5r.net Git - cc65/blobdiff - libsrc/pet/crt0.s
Merge pull request #130 from greg-king5/caps-lock
[cc65] / libsrc / pet / crt0.s
index e828870ab573d1bdb113be191e4479d2c6ebb236..66aed0366f912dcf687849afbbae2116043e4492 100644 (file)
@@ -21,7 +21,7 @@
 
 Start:
 
-; Save the zero page locations we need
+; Save the zero-page locations that we need.
 
         ldx     #zpspace-1
 L1:     lda     sp,x
@@ -29,9 +29,9 @@ 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!
 
@@ -43,11 +43,11 @@ L1:     lda     sp,x
         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
@@ -57,20 +57,20 @@ L1:     lda     sp,x
         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
@@ -78,17 +78,17 @@ 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