mirror of
https://github.com/cc65/cc65.git
synced 2025-01-19 17:31:31 +00:00
Save a few bytes
git-svn-id: svn://svn.cc65.org/cc65/trunk@3344 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
fd9226fe4a
commit
d8fa43d7a6
@ -75,19 +75,16 @@ _free: sta ptr2
|
|||||||
; Is the argument NULL? If so, bail out.
|
; Is the argument NULL? If so, bail out.
|
||||||
|
|
||||||
ora ptr2+1 ; Is the argument NULL?
|
ora ptr2+1 ; Is the argument NULL?
|
||||||
bne @L0 ; Jump if no
|
bne @L1 ; Jump if no
|
||||||
rts ; Bail out if yes
|
rts ; Bail out if yes
|
||||||
|
|
||||||
; There's a pointer below the user space that points to the real start of the
|
; There's a pointer below the user space that points to the real start of the
|
||||||
; raw block. The first word of the raw block is the total size of the block.
|
; raw block. We will decrement the high pointer byte and use an offset of 254
|
||||||
; Remember the block size in ptr1.
|
; to save some code. The first word of the raw block is the total size of the
|
||||||
|
; block. Remember the block size in ptr1.
|
||||||
|
|
||||||
@L0: lda ptr2
|
@L1: dec ptr2+1 ; Decrement high pointer byte
|
||||||
sub #2
|
ldy #$FF
|
||||||
sta ptr2
|
|
||||||
bcs @L1
|
|
||||||
dec ptr2+1
|
|
||||||
@L1: ldy #1
|
|
||||||
lda (ptr2),y ; High byte of real block address
|
lda (ptr2),y ; High byte of real block address
|
||||||
tax
|
tax
|
||||||
dey
|
dey
|
||||||
|
Loading…
x
Reference in New Issue
Block a user