mirror of
https://github.com/cc65/cc65.git
synced 2025-08-10 04:25:21 +00:00
Adjust result to user visible size
git-svn-id: svn://svn.cc65.org/cc65/trunk@3159 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -11,6 +11,9 @@
|
|||||||
|
|
||||||
.include "_heap.inc"
|
.include "_heap.inc"
|
||||||
|
|
||||||
|
.macpack generic
|
||||||
|
.macpack cpu
|
||||||
|
|
||||||
;-----------------------------------------------------------------------------
|
;-----------------------------------------------------------------------------
|
||||||
; Code
|
; Code
|
||||||
|
|
||||||
@@ -18,8 +21,7 @@ __heapblocksize:
|
|||||||
|
|
||||||
; Decrement the block pointer so it points to the admin data
|
; Decrement the block pointer so it points to the admin data
|
||||||
|
|
||||||
sec
|
sub #HEAP_ADMIN_SPACE ; Assume it's less than 256
|
||||||
sbc #HEAP_ADMIN_SPACE ; Assume it's less than 256
|
|
||||||
bcs L1
|
bcs L1
|
||||||
dex
|
dex
|
||||||
L1: sta ptr1
|
L1: sta ptr1
|
||||||
@@ -30,10 +32,20 @@ L1: sta ptr1
|
|||||||
ldy #1
|
ldy #1
|
||||||
lda (ptr1),y
|
lda (ptr1),y
|
||||||
tax
|
tax
|
||||||
|
.if (.cpu .bitand CPU_ISET_65SC02)
|
||||||
|
lda (ptr1)
|
||||||
|
.else
|
||||||
dey
|
dey
|
||||||
lda (ptr1),y
|
lda (ptr1),y
|
||||||
|
.endif
|
||||||
|
|
||||||
|
; Adjust it to the user visible size
|
||||||
|
|
||||||
|
sub #HEAP_ADMIN_SPACE
|
||||||
|
bcs L9
|
||||||
|
dex
|
||||||
|
|
||||||
; Done
|
; Done
|
||||||
|
|
||||||
rts
|
L9: rts
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user