]> cloudbase.mooo.com Git - avrcpm.git/blobdiff - avr/heap.asm
* cpm/BIOS.MAC
[avrcpm.git] / avr / heap.asm
index 0ff38e4a7dfbacb948321182cabfd0081e6916a8..e144369a0c4ab6118c877d32a1d0bab34798c139 100644 (file)
@@ -28,25 +28,25 @@ hp_top: .byte       2
 
 .if HEAP_DEBUG
 hp_print_free:
-       push    temp4
-       push    temp3
+       push    r15
+       push    r14
        push    temp2
        push    temp
        printstring ", bytes free: "
-       lds     temp3,hp_top
-       lds     temp4,hp_top+1
+       lds     r14,hp_top
+       lds     r15,hp_top+1
        ldi     temp,0
        ldi     temp2,0
-       sub     temp,temp3
-       sbc     temp2,temp4
-       ldi     temp3,0
-       ldi     temp4,0
+       sub     temp,r14
+       sbc     temp2,r15
+       clr     r14
+       clr     r15
        rcall   print_ultoa
        printstring " "
        pop     temp
        pop     temp2
-       pop     temp3
-       pop     temp4
+       pop     r14
+       pop     r15
        ret
 .endif         
 
@@ -80,30 +80,30 @@ hp_dbg1:
 ; return 0 if not enough space
 
 heap_get:
-       push    temp4
-       push    temp3
+       push    r15
+       push    r14
 .if HEAP_DEBUG
        push    temp2
        push    temp
        printnewline
        printstring "Heap get: "
-       ldi     temp3,0
-       ldi     temp4,0
+       clr     r14
+       clr     r15
        rcall   print_ultoa
        pop     temp
        pop     temp2   
 .endif         
-       lds     temp3,hp_top
-       lds     temp4,hp_top+1
-       add     temp,temp3
-       adc     temp2,temp4
+       lds     r14,hp_top
+       lds     r15,hp_top+1
+       add     temp,r14
+       adc     temp2,r15
        brcs    hp_full
                
 ; zero flag clear here
 
        sts     hp_top,temp
        sts     hp_top+1,temp2
-       movw    temp,temp3
+       movw    temp,r14
        rjmp    hp_get_ex
 hp_full:
        clr     temp
@@ -114,11 +114,11 @@ hp_get_ex:
        printstring "Error: "
 hp_get_dbg1:
        rcall   hp_print_free
-       mov     temp3,temp      ;restore zero flag
-       or      temp3,temp2
+       mov     r14,temp        ;restore zero flag
+       or      r14,temp2
 .endif
-       pop     temp3
-       pop     temp4
+       pop     r14
+       pop     r15
        ret