wdc compiler help needed
Posted: Tue Oct 08, 2019 9:39 am
Hi all, after a long time i decided to pull out my w65c265sxb board again.
i started with the 'led blink' from http://www.mikekohn.net/micro/modern_6502.php.
follow directives, used the naken_asm compiler... and yes result, it works.
not a real fan of the "new" code style from naken_asm
so i decided to translate it to wdc compiler style... and here the troubles begin.
i can compile it, but it will not run on the board...
my guess it's some where in the 8/16 bit of the a/x/y
or in the mode where you switch between 8/16 bit part
where do i go wrong... here is the code...
(ps i just want to run it in 8 bit mode, 65c02 mode that is.. but have no clue how to set 8/16 bit modes in the wdc compiler)
i started with the 'led blink' from http://www.mikekohn.net/micro/modern_6502.php.
follow directives, used the naken_asm compiler... and yes result, it works.
not a real fan of the "new" code style from naken_asm
so i decided to translate it to wdc compiler style... and here the troubles begin.
i can compile it, but it will not run on the board...
my guess it's some where in the 8/16 bit of the a/x/y
or in the mode where you switch between 8/16 bit part
where do i go wrong... here is the code...
(ps i just want to run it in 8 bit mode, 65c02 mode that is.. but have no clue how to set 8/16 bit modes in the wdc compiler)
Code: Select all
CHIP 65816
LONGI OFF
LONGA OFF
org $1000
start:
; Disable interrupts to protect from ROM routines running
;sei
; Set native mode
;clc
;xce
; Set A to 8-bit
;sep #$20
; Set X/Y to 16-bit
;rep #$10
main:
sei
cld
go: jsr delay
jsr on
jsr delay
jsr off
jmp go
; on led
on: lda #$00
sta $df23
rts
; led off
off: lda #$ff
sta $df23
rts
delay: ldy #$10
delay1: ldx #$ff
delay2: dex
bne delay2
dey
bne delay1
rts