Difference between revisions of "Programming the Microprocessor"
(Created page with "'''Use Notepad++ to write your source code.''' Download Notepad++ from '''Example code:''' STX #$6ffc ; capture x reg LDX #$55 ; set counter to binary 101...") |
|||
| Line 1: | Line 1: | ||
'''Use Notepad++ to write your source code.''' | '''Use Notepad++ to write your source code.''' | ||
| − | Download Notepad++ from | + | Download and Install Notepad++ from https://notepad-plus-plus.org/ |
| + | Open Notepad and select '''File''' and then select '''New''' | ||
| + | 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 yourfilename.'''asm''' extension click '''Save''' | ||
| + | |||
'''Example code:''' | '''Example code:''' | ||
Revision as of 22:25, 26 September 2020
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 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 yourfilename.asm extension click 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 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