Difference between revisions of "Programming the Microprocessor"

From media_wiki
Jump to: navigation, search
Line 1: Line 1:
 
'''Write your source code.'''
 
'''Write your source code.'''
 +
Create a new folder (direcotry) Called VASM6502
 
  Download and Install '''Notepad++''' from https://notepad-plus-plus.org/
 
  Download and Install '''Notepad++''' from https://notepad-plus-plus.org/
 
  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.'''  
  Select '''File''' again and then '''Save AS''' [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'''.
 
  Make sure you have line numbering turned '''On'''. Found under '''Settings/Preferences/Editing/Display line number'''.   
 
  Make sure you have line numbering turned '''On'''. Found under '''Settings/Preferences/Editing/Display line number'''.   
Line 23: Line 24:
  
 
'''Compile your source code Windows 10.'''
 
'''Compile your source code Windows 10.'''
Create a new folder (direcotry) Called VASM6502
 
 
  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

Revision as of 01:43, 27 September 2020

Write your source code.

Create a new folder (direcotry) Called VASM6502
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 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)
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





65C02 Vintage Computer Build