2020/c64/main.asm

82 lines
1.2 KiB
NASM

// vim: filetype=kickass
#import "math.inc"
BasicUpstart2(main)
.align $100
* = * "Square table"
square1_lo:
.fill 512, 0
square1_hi:
.fill 512, 0
square2_lo:
.fill 512, 0
square2_hi:
.fill 512, 0
* = * "Day 1 input"
day01_input:
.import text "../rust/inputs/day01"
.byte 0
//* = $8000 "Cartridge ROM"
//* = $a000 "Basic ROM"
* = $c000
.const SCREEN_RAM = $0400
.const COLOR_RAM = $d800
.const kernal_scinit = $ff81
.const kernal_chrout = $ffd2
.const kernal_write_byte = $e716
.const zp_temp = $02
.const cursor_pointer_lo = $05
.const cursor_pointer_hi = $06
.macro move_16_imm(dst_lo, dst_hi, src) {
lda #<src
sta dst_lo
lda #>src
sta dst_hi
}
//
// main
//
main:
jsr clear_screen
// Swap out BASIC and kernal
sei
lda %00110000
sta $01
jsr generate_multiplication_tables
// Test division by 10
lda #$cc
sta udivmod32_dividend + 0
lda #$28
sta udivmod32_dividend + 1
lda #$f9
sta udivmod32_dividend + 2
lda #$07
sta udivmod32_dividend + 3
jsr print_decimal_u32
!loop:
jmp !loop-
buffer:
.fill $0400, 0
#import "day01.asm"
#import "screen.asm"
#import "math.asm"