From: Alan Cox Date: Mon, 25 Sep 2017 14:31:30 +0000 (+0100) Subject: v65c816: fix platform code silliness X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=e3fc161257f1c1ad13fb0fc67935114420f97048;p=FUZIX.git v65c816: fix platform code silliness --- diff --git a/Kernel/platform-v65c816/crt0.s b/Kernel/platform-v65c816/crt0.s index b0d5a730..f49fbbe7 100644 --- a/Kernel/platform-v65c816/crt0.s +++ b/Kernel/platform-v65c816/crt0.s @@ -66,14 +66,14 @@ entry: rep #$10 .i16 - ldx #kstack_top + ldx #kstack_top-1 txs ; Stack (6502 not C) lda #'z' sta $FE20 - ldx #kstackc_top ; C stack - sta sp + ldx #kstackc_top-1 ; C stack + stx sp ldx #__BSS_RUN__ @@ -89,7 +89,7 @@ entry: .a16 lda #__BSS_SIZE__-2 ; must be >=2 bytes or else - stz 0,x + stz a:0,x mvn 0,0 sep #$30 @@ -99,7 +99,7 @@ entry: lda #'x' sta $FE20 -; jsr init_early + jsr init_early lda #'.' sta $FE20 jsr init_hardware @@ -114,23 +114,6 @@ code: sta $FE20 lda #10 sta $FE20 - - rep #$30 - .a16 - .i16 - - ldx #U_DATA - ldy #U_DATA+1 - lda #U_DATA__TOTALSIZE-2 - stz 0,x - mvn KERNEL_FAR,KERNEL_FAR - - sep #$30 - .a8 - .i8 - - lda #'G' - sta $FE20 jsr _fuzix_main ; Should never return sei ; Spin stop: bra stop diff --git a/Kernel/platform-v65c816/v65.s b/Kernel/platform-v65c816/v65.s index a353acce..b800525a 100644 --- a/Kernel/platform-v65c816/v65.s +++ b/Kernel/platform-v65c816/v65.s @@ -108,17 +108,15 @@ common_patch: .i8 init_hardware: - ; set system RAM size for test purposes + ; set system RAM size (FIXME: dynamic probe) rep #$10 .i16 ldx #512 stx _ramsize ldx #512-64 stx _procmem - ldx #syscall_vector - stx syscall - rep #$10 + sep #$10 .i8 rts @@ -163,7 +161,7 @@ _hd_read_data: lda _hd_kmap ; page number pha plb ; data now points into user app - ldy #$00FE + ldy #$FE00 phy pld ; DP is now the I/O space @@ -191,7 +189,7 @@ _hd_write_data: lda _hd_kmap ; page number pha plb ; data now points into user app - ldy #$00FE + ldy #$FE00 phy pld ; DP is now the I/O space