From 3b69c2fd21a0da8f9a06112c765d009a287cd765 Mon Sep 17 00:00:00 2001 From: cuz Date: Sat, 13 Dec 2003 15:16:11 +0000 Subject: [PATCH] Small size optimizations git-svn-id: svn://svn.cc65.org/cc65/trunk@2746 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/c128/c128-reu.s | 21 ++++++++++----------- libsrc/c64/c64-reu.s | 21 ++++++++++----------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/libsrc/c128/c128-reu.s b/libsrc/c128/c128-reu.s index 9e7402618..b097e6e9f 100644 --- a/libsrc/c128/c128-reu.s +++ b/libsrc/c128/c128-reu.s @@ -78,35 +78,34 @@ reu_params: .word $0000 ; Host address, lo, hi ; INSTALL: + ldx #$00 ; High byte of return code lda #$55 sta REU_REUADDR cmp REU_REUADDR ; Check for presence of REU bne nodevice - lda #$AA + asl a ; A = $AA sta REU_REUADDR cmp REU_REUADDR ; Check for presence of REU bne nodevice - ldx #>(128*4) ; Assume 128KB + ldy #>(128*4) ; Assume 128KB lda REU_STATUS and #$10 ; Check size bit beq @L1 - ldx #>(256*4) ; 256KB when size bit is set -@L1: stx pagecount+1 + ldy #>(256*4) ; 256KB when size bit is set +@L1: sty pagecount+1 - ldx #$FF - stx curpage - stx curpage+1 ; Invalidate the current page - inx + ldy #$FF + sty curpage + sty curpage+1 ; Invalidate the current page txa ; X = A = EM_ERR_OK rts ; No REU found nodevice: - lda #EM_ERR_NO_DEVICE - rts + lda #EM_ERR_NO_DEVICE +; rts ; Run into UNINSTALL instead ; ------------------------------------------------------------------------ ; UNINSTALL routine. Is called before the driver is removed from memory. diff --git a/libsrc/c64/c64-reu.s b/libsrc/c64/c64-reu.s index 62c7bbc2a..4fd5e3db7 100644 --- a/libsrc/c64/c64-reu.s +++ b/libsrc/c64/c64-reu.s @@ -77,35 +77,34 @@ reu_params: .word $0000 ; Host address, lo, hi ; INSTALL: + ldx #$00 ; High byte of return code lda #$55 sta REU_REUADDR cmp REU_REUADDR ; Check for presence of REU bne nodevice - lda #$AA + asl a ; A = $AA sta REU_REUADDR cmp REU_REUADDR ; Check for presence of REU bne nodevice - ldx #>(128*4) ; Assume 128KB + ldy #>(128*4) ; Assume 128KB lda REU_STATUS and #$10 ; Check size bit beq @L1 - ldx #>(256*4) ; 256KB when size bit is set -@L1: stx pagecount+1 + ldy #>(256*4) ; 256KB when size bit is set +@L1: sty pagecount+1 - ldx #$FF - stx curpage - stx curpage+1 ; Invalidate the current page - inx + ldy #$FF + sty curpage + sty curpage+1 ; Invalidate the current page txa ; X = A = EM_ERR_OK rts ; No REU found nodevice: - lda #EM_ERR_NO_DEVICE - rts + lda #EM_ERR_NO_DEVICE +; rts ; Run into UNINSTALL instead ; ------------------------------------------------------------------------ ; UNINSTALL routine. Is called before the driver is removed from memory. -- 2.39.5