X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=libsrc%2Fcommon%2Fmodload.s;h=63776f1c8ea17af25042b83666e115d6a1afd039;hb=4f6110604326357d378f373b917b92c7ad92997e;hp=ac04a39870be89424698f60177d920dd9cd9e67d;hpb=298767d71ad0be05952827b52730527325960832;p=cc65 diff --git a/libsrc/common/modload.s b/libsrc/common/modload.s index ac04a3987..63776f1c8 100644 --- a/libsrc/common/modload.s +++ b/libsrc/common/modload.s @@ -200,17 +200,16 @@ CleanupAndExit: ; Check if we have to free the allocated block - lda Module - ora Module+1 - beq @L1 ; Jump if no memory allocated - lda Module ldx Module+1 - jsr _free ; Free the allocated block + bne @L1 + tay ; Test high byte + beq @L2 +@L1: jsr _free ; Free the allocated block ; Restore the register bank -@L1: jsr RestoreRegBank +@L2: jsr RestoreRegBank ; Restore the error code and return to the caller @@ -390,7 +389,7 @@ Opt: jsr ReadByte ; Read the length byte bne OSError jsr ReadByte ; Get the operating system - cmp #O65_OS_CC65_MODULE + cmp #O65_OS_CC65 bne OSError ; Wrong operating system jsr ReadByte ; Get the version number, expect zero