mirror of
https://github.com/cc65/cc65.git
synced 2024-06-25 13:29:41 +00:00
helloworldasm
This commit is contained in:
parent
7029c8ca88
commit
a858b58df5
|
@ -136,8 +136,8 @@ plasma: plasma.c
|
||||||
nachtm: nachtm.c
|
nachtm: nachtm.c
|
||||||
$(CL) -t $(SYS) -O -o nachtm -m nachtm.map nachtm.c
|
$(CL) -t $(SYS) -O -o nachtm -m nachtm.map nachtm.c
|
||||||
hello: hello.s
|
hello: hello.s
|
||||||
#$(AS) '--cpu 6502' hello.s -o hello.obj -l hello.lst
|
|
||||||
$(CL) -t $(SYS) -C c64-asm.cfg -u __EXEHDR__ hello.s -o hello.prg
|
$(CL) -t $(SYS) -C c64-asm.cfg -u __EXEHDR__ hello.s -o hello.prg
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
# Rule to make a CBM disk with all samples. Needs the c1541 program that comes
|
# Rule to make a CBM disk with all samples. Needs the c1541 program that comes
|
||||||
# with the VICE emulator.
|
# with the VICE emulator.
|
||||||
|
|
|
@ -1,152 +1,18 @@
|
||||||
;;https://www.lemon64.com/forum/viewtopic.php?t=33082
|
|
||||||
.segment "CODE"
|
|
||||||
.macpack cbm
|
.macpack cbm
|
||||||
scrcode
|
|
||||||
;; top of border is line 50, bottom of visible screen is line 250
|
|
||||||
top = $32
|
|
||||||
bottom = $fa
|
|
||||||
start:
|
start:
|
||||||
;; lower case char mode
|
lda #14
|
||||||
lda #$06
|
jsr $ffd2
|
||||||
ora $d018
|
|
||||||
sta $d018
|
|
||||||
ldx #$00
|
|
||||||
showms:
|
|
||||||
lda message,x ;setup message
|
|
||||||
;; start the horrible case conversion routine
|
|
||||||
rol
|
|
||||||
rol
|
|
||||||
bcc ucase64
|
|
||||||
rol
|
|
||||||
bcc ucase32 ;64 and 32 bit set
|
|
||||||
ror ;sub 96 from chr
|
|
||||||
ror
|
|
||||||
ror
|
|
||||||
sec
|
|
||||||
sbc #$60
|
|
||||||
jmp caseok
|
|
||||||
ucase32:
|
|
||||||
ror
|
|
||||||
ucase64:
|
|
||||||
ror
|
|
||||||
ror
|
|
||||||
caseok: ; is it really all necessary!
|
|
||||||
sta $0400,x
|
|
||||||
inx
|
|
||||||
cpx #$28
|
|
||||||
bne showms
|
|
||||||
|
|
||||||
sei
|
|
||||||
lda #$7f
|
|
||||||
sta $dc0d ;block cia1 interrupts
|
|
||||||
sta $dd0d ;block cia2 interrupts
|
|
||||||
|
|
||||||
lda #$01
|
|
||||||
sta $d01a ;enable raster interrupts
|
|
||||||
|
|
||||||
jsr setupraster1
|
ldy #0
|
||||||
cli
|
loop:
|
||||||
rts
|
lda message,y
|
||||||
|
beq done
|
||||||
raster1:
|
sta $0400,y
|
||||||
nop
|
iny
|
||||||
nop
|
bne loop
|
||||||
nop
|
done:
|
||||||
nop
|
rts
|
||||||
nop
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
lda #$00
|
|
||||||
sta $d020 ;do some flashy border stuff
|
|
||||||
|
|
||||||
lda #$01
|
message:
|
||||||
sta $d019
|
scrcode "Hello, World!@"
|
||||||
|
|
||||||
;; setup the next raster point
|
|
||||||
sei
|
|
||||||
jsr colourwash
|
|
||||||
jsr setupraster2
|
|
||||||
cli
|
|
||||||
jmp $ea31 ;call next interrupt
|
|
||||||
|
|
||||||
raster2:
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
lda #$02
|
|
||||||
sta $d020 ;do some flashy border stuff
|
|
||||||
|
|
||||||
lda #$01
|
|
||||||
sta $d019
|
|
||||||
|
|
||||||
;; setup the next raster point
|
|
||||||
sei
|
|
||||||
jsr setupraster1
|
|
||||||
cli
|
|
||||||
jmp $ea31 ;call next interrupt
|
|
||||||
|
|
||||||
setupraster1:
|
|
||||||
lda #<raster1
|
|
||||||
ldx #>raster1
|
|
||||||
sta $0314 ;change the interrupt vector
|
|
||||||
stx $0315
|
|
||||||
|
|
||||||
;; setup the raster point
|
|
||||||
;; top
|
|
||||||
lda #$1b
|
|
||||||
sta $d011
|
|
||||||
lda #top
|
|
||||||
sta $d012 ;interrupt at raster line 0
|
|
||||||
rts
|
|
||||||
|
|
||||||
setupraster2:
|
|
||||||
lda #<raster2
|
|
||||||
ldx #>raster2
|
|
||||||
sta $0314 ;change the interrupt vector
|
|
||||||
stx $0315
|
|
||||||
|
|
||||||
;; setup the raster point
|
|
||||||
;; bottom
|
|
||||||
lda #$1b
|
|
||||||
sta $d011
|
|
||||||
lda #bottom
|
|
||||||
sta $d012 ;interrupt at raster line 0
|
|
||||||
rts
|
|
||||||
|
|
||||||
colourwash:
|
|
||||||
lda colour+$00
|
|
||||||
sta colour+$28
|
|
||||||
ldx #$00
|
|
||||||
cycle:
|
|
||||||
lda colour+$01,x
|
|
||||||
sta colour+$00,x
|
|
||||||
lda colour,x
|
|
||||||
sta $d800,x
|
|
||||||
inx
|
|
||||||
cpx #$28
|
|
||||||
bne cycle
|
|
||||||
rts
|
|
||||||
|
|
||||||
colour: ;colour data tables
|
|
||||||
.byte $09,$09,$02,$02,$08
|
|
||||||
.byte $08,$0a,$0a,$0f,$0f
|
|
||||||
.byte $07,$07,$01,$01,$01
|
|
||||||
.byte $01,$01,$01,$01,$01
|
|
||||||
.byte $01,$01,$01,$01,$01
|
|
||||||
.byte $01,$01,$01,$07,$07
|
|
||||||
.byte $0f,$0f,$0a,$0a,$08
|
|
||||||
.byte $08,$02,$02,$09,$09
|
|
||||||
.byte $00,$00,$00,$00,$00
|
|
||||||
|
|
||||||
message: ;data for message
|
|
||||||
.byte " The C64 was made "
|
|
||||||
.byte "by Dr Rubbix !!!"
|
|
||||||
.byte " "
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user