Apple II User Manual

Page of 257
    *   The program then swaps the bytes of the integer.
    *   Finally, the program converts the result to floating point and returns to BASIC (JMP
        C0D3).  Address $C0D3 was found in locations $B008, $B009.  (Address $C0D3 may
        vary with different versions of BASIC.  Be sure to check locations $B008 and $B009
        for the correct address.
               <1>
                0A26    *=A00
                0A00 A0 LDY #00
                0A02 A2 LDX #00
                0A04 B5 LDA A9,X
                0A06 20 JSR EA46
                0A09 20 JSR E83E
                0A0C E8 INX
                0A0D E0 CPX #06
                0A0F D0 BNE 0A04
                0A11 20 JSR E9F0
                0A14 C0 CPY #00
                0A16 F0 BEQ 0A1F
                0A13 A5 LDA AD
                0A18 A4 LDY AC
                0A1C 4C JMP C0D3
                0A1F 20 JSR BF00
                0A22 C8 INY
                0A23 D0 BNE 0A02
                0A25 00 BRK
                0A26
Figure F-2 Assembly Language Subroutine
Figure F-3 shows the print-out for various values of "N".
                <6>
                OK
                RUN
                NUMBER? 128
                88 80 00 00 00 00
                88 00 00 00 80 00
                -32768
                NUMBER? 1
                81 80 00 00 00 00
                81 00 00 00 01 00
                 256
                NUMBER? 4097
                8D 80 06 00 00 00
                8D 00 00 10 01 00
                 272
                NUMBER? 256
                89 80 00 00 00 00
                89 00 00 01 00 00
                 1
Figure F-3.  Output for Example
G  STORING AIM 65 BASIC PROGRAMS ON CASSETTE
AIM 65 BASIC Programs can be stored on cassette tape by using BASIC's SAVE and LOAD
commands, or by using the AIM 65 Editor.  Before employing either procedure be sure to care-
fully observe the recorder installation and operation procedures given in Section 9 of the
AIM 65 User's Guide.
RECORDING ON CASSETTE USING THE BASIC SAVE COMMAND
The procedure to store a BASIC program is:
    1.  Install a cassette in the recorder, and manually position the tape to the program record