Difference between revisions of "Programming the Microprocessor"
Line 1: | Line 1: | ||
'''Write your source code.''' | '''Write your source code.''' | ||
+ | Download and Install '''Notepad++''' from https://notepad-plus-plus.org/ | ||
Create a new folder (direcotry) Called VASM6502 | Create a new folder (direcotry) Called VASM6502 | ||
− | |||
Open '''Notepad++''' and select '''File''' and then select '''New'''. (Opens a new window) | 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 '''Language''' and then select the Letter '''A''' then select '''Assembly.''' | ||
+ | Assembly Language file uses the .s extension or .asm | ||
Select '''File''' again and then '''Save AS''' to the folder VASM6502 [enter a file name for your program] | Select '''File''' again and then '''Save AS''' to the folder VASM6502 [enter a file name for your program] | ||
Make sure it has the '''.asm''' extension (yourfilename.asm) then click '''Save'''. | Make sure it has the '''.asm''' extension (yourfilename.asm) then click '''Save'''. | ||
Line 25: | Line 26: | ||
'''Compile your source code Windows 10.''' | '''Compile your source code Windows 10.''' | ||
Download the application VASM from Dr. Volker Barthelmann´s Compiler Page: http://www.compilers.de/vasm.html | Download the application VASM from Dr. Volker Barthelmann´s Compiler Page: http://www.compilers.de/vasm.html | ||
− | Select Binaries of vasm for 6502 for x86-64 (Mac, Windows and Linux): http://www.ibaug.de/vasm/vasm6502.zip | + | '''Select Binaries of vasm for 6502 for x86-64 (Mac, Windows and Linux):''' http://www.ibaug.de/vasm/vasm6502.zip |
Move vasm6502.zip to your new folder VASM6502 and extract the zip file in that folder. | Move vasm6502.zip to your new folder VASM6502 and extract the zip file in that folder. | ||
− | Open the new folder called vasm6502_oldstyle and select your operating system. I will be using Windows folder. (Win) | + | Open the new folder called vasm6502_oldstyle and select your operating system. I will be using Windows folder. (Win\Win10) |
Open WIN folder then Win10 folder and copy the relative path. | Open WIN folder then Win10 folder and copy the relative path. | ||
C:\Users\this-PC\Documents\VASM-6502\vasm6502_oldstyle\win\win10 | C:\Users\this-PC\Documents\VASM-6502\vasm6502_oldstyle\win\win10 | ||
C:\Users\trcai_000\Documents\VASM-6502\vasm6502_oldstyle\win\win10 | C:\Users\trcai_000\Documents\VASM-6502\vasm6502_oldstyle\win\win10 | ||
− | + | VASM6502 compiler is a command line program (CMD) so you need to use the CMD terminal. | |
− | + | Open CMD terminal and change directory to the VASM6502 directory | |
− | + | CD Users\this-PC\Documents\VASM-6502\vasm6502_oldstyle\win\win10 | |
+ | |||
Revision as of 02:11, 27 September 2020
Write your source code.
Download and Install Notepad++ from https://notepad-plus-plus.org/ Create a new folder (direcotry) Called VASM6502 Open Notepad++ and select File and then select New. (Opens a new window) Select Language and then select the Letter A then select Assembly. Assembly Language file uses the .s extension or .asm Select File again and then Save AS to the folder VASM6502 [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
Compile your source code Windows 10.
Download the application VASM from Dr. Volker Barthelmann´s Compiler Page: http://www.compilers.de/vasm.html Select Binaries of vasm for 6502 for x86-64 (Mac, Windows and Linux): http://www.ibaug.de/vasm/vasm6502.zip Move vasm6502.zip to your new folder VASM6502 and extract the zip file in that folder. Open the new folder called vasm6502_oldstyle and select your operating system. I will be using Windows folder. (Win\Win10) Open WIN folder then Win10 folder and copy the relative path. C:\Users\this-PC\Documents\VASM-6502\vasm6502_oldstyle\win\win10 C:\Users\trcai_000\Documents\VASM-6502\vasm6502_oldstyle\win\win10 VASM6502 compiler is a command line program (CMD) so you need to use the CMD terminal. Open CMD terminal and change directory to the VASM6502 directory CD Users\this-PC\Documents\VASM-6502\vasm6502_oldstyle\win\win10