;; Copyright (C) 2011 by Jonathan Appavoo, Boston University ;; ;; Permission is hereby granted, free of charge, to any person obtaining a copy ;; of this software and associated documentation files (the "Software"), to deal ;; in the Software without restriction, including without limitation the rights ;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ;; copies of the Software, and to permit persons to whom the Software is ;; furnished to do so, subject to the following conditions: ;; ;; The above copyright notice and this permission notice shall be included in ;; all copies or substantial portions of the Software. ;; ;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ;; THE SOFTWARE. .alias MEMSTART $0000 .alias CODE $0200 .alias RESETVEC $FFFC .alias MEMEND $FFFF .org MEMSTART ; set the orgin point to memstart which is 0000 ; this ensures that the p65 assembler will create a memory image ; that starts right at the beginning of memory (the address space) .advance CODE ; set the insertion point to where we want our code to be ; In this case we are skipping page 00 and page 01. We place our instructions ; at the beginning of page 02 START: LDX #$00 ; Initialize the X register with 00 -- # is used to indicate that we want the immedidate version ; of loading the X register -- meaning that the address for the value to load into X is PC + 1 ; $00 places the value 00 at PC + 1 -- thus the immediate value being loaded into the X register ; is 0x00 LOOP: INX ; increment the X register JMP LOOP ; jump back to the beginning -- loop forever .advance RESETVEC .word START .advance MEMEND .byte $00