Posts

Showing posts from October, 2022

6502 Math and Strings Lab

Image
 Lab 3 Tim Lin In this LAB, I learn how to write a simple assembler. Since assembly language is complex, I need to refer to the sample code. Example: Etch-a-Sketchtm Style Drawing .  The function of this code is that clicking the C key will display a pixel dot in the middle of the screen. I modified it so that only the four uppercase letters H,E,L,O can be clicked to display the pixel dots. In the process, I struggled to find out the meaning of various characters. For example, the letter O is 4F in computer characters, in the form of a number + letter. ; zero-page variable locations define ROW $20 ; current row define COL $21 ; current column define POINTER $10 ; ptr: start of row define POINTER_H $11 ; constants define DOT $01 ; dot colour define CURSOR $e ; blue colour ldy #$00 ; put help text on screen print: lda help,y beq setup sta $f000,y iny bne print setup: lda #$0f ; set initial ROW,COL sta ROW sta COL dra