-- Leo's gemini proxy

-- Connecting to abildgaard.com:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini;lang=en-GB

                   __    _ __    __                           __
            ____ _/ /_  (_) /___/ /___ _____ _____ __________/ /___
           / __ `/ __ \/ / / __  / __ `/ __ `/ __ `/ ___/ __  / __ \
          / /_/ / /_/ / / / /_/ / /_/ / /_/ / /_/ / /  / /_/ / /_/ /
          \__,_/_.___/_/_/\__,_/\__, /\__,_/\__,_/_/   \__,_/\____/
                               /____/      Est. 17th of april 2021

The Commodore 64 Quasi HighLevel Game Language Project (neet name huh?)


The 6502, the CPU of my childhood. I've spent countless of hours playing games as Getaway to Apspha, Giana Sisters, Spy Hunter, Match Point, Int.Karate etc, on the Commodore 64.


Its long overdue that i cooked up some homebrew for this platform, because.. im curious, and i want to learn ..and .. well just because.

My first step will be to look under the hood of this tech wonder, and get familiar with the 6502 CPU and, assume the best way to begin is to start programming this device in assember. Assembler has never been my "weapon of choice" when i comes to programming. I have used assembler for creating small software patches, and did a x86 compiler that could do simple arithmetic.


Ultimately I wish to create a programming langauge specifically for the Commodore 64, CPU,SID and VIC-II graphics handling. I will be using the ANTLR4 parser generator, and (prolly) java as the compiler implementation language.

ACME assembler


Tools


Vim

ACME Assembler

Vice (c64 emulator)

ANTLR4 and OpenJDK


All available in the arch package repository.


Todo ..


Define a first version, simple grammar ..

assembler snippets for arithmetic, print to screen

assembler snippets for declarations and assignments (int8, int16, string)

assembler snippets for graphics mode change, and manipulation display ram content.

datastructures array and "sprite".



The 6502 CPU


A - accumulator (8bit)
X - index register (8bit)
Y - index register (8bit)
P - status register (8bit)
PC - program counter (16bit PCH | PCL)
S - stack pointer (9bit)

Accumulator

Handles addition, substraction, shifts, compares.



Adressing modes


Absolute adressing

LDA #$16; loads the decimal value of 31 into the accumulator

as oppsosed to

LDA $16; loads the value on position 31 in ram(ZeroPage) into accumulator.

P the status registers


_________________
|7|6|5|4|3|2|1|0|
|N|V|1|B|D|I|Z|C|
----------------

C - Carry flag, 1 = true

Z - Zero flag, 1 = result

I - IRQB disable, 1 = disabled

D - Decimal mode, 1 = true

B - BRK command, 1 = brk, 0 = IRQB

1 - (not used?)

V - Overflow flag, 1 = true

N - Negative flag, 1 = neg

-- Response ended

-- Page fetched on Mon May 13 17:34:14 2024