From 83c63a65c3766daaafbcd6a48b7cfb472b2de21e Mon Sep 17 00:00:00 2001 From: Marco van den Heuvel Date: Wed, 2 Dec 2015 00:14:56 -0800 Subject: [PATCH] optimized the sei/cli pairing a bit. --- libsrc/c128/emd/c128-efnram.s | 27 +++++++++++++-------------- libsrc/c128/emd/c128-ifnram.s | 31 +++++++++++++++---------------- 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/libsrc/c128/emd/c128-efnram.s b/libsrc/c128/emd/c128-efnram.s index 4d179da83..78882fa6e 100755 --- a/libsrc/c128/emd/c128-efnram.s +++ b/libsrc/c128/emd/c128-efnram.s @@ -64,7 +64,6 @@ window: .res 256 ; Memory "window" ; INSTALL: - sei ldx #0 stx ptr1 ldx #$80 @@ -74,20 +73,22 @@ INSTALL: stx STAVEC ldy #0 ldx #MMU_CFG_EXT_FROM + sei jsr FETCH tax inx txa sta tmp1 ldx #MMU_CFG_EXT_FROM + sei jsr STASH ldx #MMU_CFG_EXT_FROM jsr FETCH + cli cmp tmp1 beq @ram_present lda #EM_ERR_NO_DEVICE - cli rts @ram_present: @@ -96,7 +97,6 @@ INSTALL: stx curpage+1 ; Invalidate the current page inx txa ; A = X = EM_ERR_OK - cli ; rts ; Run into UNINSTALL instead ; ------------------------------------------------------------------------ @@ -123,8 +123,7 @@ PAGECOUNT: ; by the driver. ; -MAP: sei - sta curpage +MAP: sta curpage stx curpage+1 ; Remember the new page clc @@ -135,6 +134,7 @@ MAP: sei lda #window ; Return the window address - cli rts ; ------------------------------------------------------------------------ @@ -163,8 +163,7 @@ USE: sta curpage ; ------------------------------------------------------------------------ ; COMMIT: Commit changes in the memory window to extended storage. -COMMIT: sei - lda curpage ; Get the current page +COMMIT: lda curpage ; Get the current page ldx curpage+1 bmi done ; Jump if no page mapped @@ -176,6 +175,7 @@ COMMIT: sei lda #EM_ERR_NO_DEVICE - cli rts @ram_present: @@ -96,7 +97,6 @@ INSTALL: stx curpage+1 ; Invalidate the current page inx txa ; A = X = EM_ERR_OK - cli ; rts ; Run into UNINSTALL instead ; ------------------------------------------------------------------------ @@ -123,8 +123,7 @@ PAGECOUNT: ; by the driver. ; -MAP: sei - sta curpage +MAP: sta curpage stx curpage+1 ; Remember the new page clc @@ -135,6 +134,7 @@ MAP: sei lda #window ; Return the window address - cli rts ; ------------------------------------------------------------------------ @@ -163,8 +163,7 @@ USE: sta curpage ; ------------------------------------------------------------------------ ; COMMIT: Commit changes in the memory window to extended storage. -COMMIT: sei - lda curpage ; Get the current page +COMMIT: lda curpage ; Get the current page ldx curpage+1 bmi done ; Jump if no page mapped @@ -176,6 +175,7 @@ COMMIT: sei lda #