Programming the Microprocessor
Revision as of 22:48, 26 September 2020 by U731219879 rc (talk | contribs)
Use Notepad++ to write your source code.
Download and Install Notepad++ from https://notepad-plus-plus.org/ Open Notepad++ and select File and then select New. (Opens a new window) Select Language and then select the Letter A then select Assembly. Select File again and then Save AS [enter a file name for your program] Make sure it has the .asm extension (yourfilename.asm) then click Save. Make sure you have line numbering turned On. Found under Settings/Preferences/Editing/Display line number. Cut and paste the example code below into Notepad++ at line #1 Select File again and then Save
Example code:
STX #$6ffc ; capture x reg LDX #$55 ; set counter to binary 10101010 count EQU * LDA #$0f ; Turn on half of the LED's 00001111 STA $6000 ; Write value to VIA chip DEX ; Decrease the X register by 1 LDA #$f0 ; Turn on other half of the LED's 11110000 BNE count LDX $6ffc ; Restore X reg to orginal value LDA #$00 ; turn off all LED's 00000000 STA $6000 ; Write value to VIA chip