From cc46c682901410cb13a07646bc7fca4222e0eff9 Mon Sep 17 00:00:00 2001 From: hugova Date: Thu, 15 May 2025 16:18:50 +0200 Subject: [PATCH] optimize new memcpy --- wip-hugo/routines/memory/memcpy.s | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/wip-hugo/routines/memory/memcpy.s b/wip-hugo/routines/memory/memcpy.s index 4001096..de752f6 100644 --- a/wip-hugo/routines/memory/memcpy.s +++ b/wip-hugo/routines/memory/memcpy.s @@ -13,12 +13,16 @@ change_length: DEC length BNE loop - ;;check if length hi byte is 0. if it is end this - LDA length + 1 - BEQ loop_end - DEC length +1 - JMP loop + BPL loop + JMP loop_end + + ;;;;check if length hi byte is 0. if it is end this + ;;LDA length + 1 + ;;BEQ loop_end + + ;;DEC length +1 + ;;JMP loop y_overflow: LDY #$00 INC B_start + 1