avr: use Heap_AllocAndZero, added OBJ_EmitSignalWithSelector
This commit is contained in:
@@ -100,25 +100,11 @@ Object_Alloc:
|
|||||||
push xh
|
push xh
|
||||||
push r16
|
push r16
|
||||||
push r17
|
push r17
|
||||||
push r24
|
bigcall Heap_AllocAndZero
|
||||||
push r25
|
|
||||||
bigcall Heap_Alloc ; X=mem allocated (r16, r17, r18, r19, r24, r25, X)
|
|
||||||
pop r25
|
|
||||||
pop r24
|
|
||||||
pop r17
|
pop r17
|
||||||
pop r16
|
pop r16
|
||||||
brcc Object_Alloc_ret
|
|
||||||
mov yl, xl
|
|
||||||
mov yh, xh
|
|
||||||
clr r18
|
|
||||||
Object_Alloc_loop:
|
|
||||||
st X+, r18
|
|
||||||
sbiw r25:r24, 1
|
|
||||||
brne Object_Alloc_loop
|
|
||||||
sec
|
|
||||||
Object_Alloc_ret:
|
|
||||||
pop xh
|
pop xh
|
||||||
pop xl
|
pop xl
|
||||||
ret
|
ret
|
||||||
; @end
|
; @end
|
||||||
|
|
||||||
@@ -537,9 +523,25 @@ OBJ_GetRootToY_end:
|
|||||||
; @clobbers any, !Y
|
; @clobbers any, !Y
|
||||||
|
|
||||||
OBJ_EmitSignal:
|
OBJ_EmitSignal:
|
||||||
|
ldd r17, Y+OBJECT_OFFS_SELECTOR
|
||||||
|
rjmp OBJ_EmitSignalWithSelector
|
||||||
|
; @end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; @routine OBJ_EmitSignalWithSelector @global
|
||||||
|
;
|
||||||
|
; @param Z byte address of object (for LPM!)
|
||||||
|
; @param R16 signal number
|
||||||
|
; @param R17 selector
|
||||||
|
; @param xl param1
|
||||||
|
; @param xh param2
|
||||||
|
; @clobbers any, !Y
|
||||||
|
|
||||||
|
OBJ_EmitSignalWithSelector:
|
||||||
push yl
|
push yl
|
||||||
push yh
|
push yh
|
||||||
ldd r17, Y+OBJECT_OFFS_SELECTOR
|
|
||||||
ldd r23, Y+OBJECT_OFFS_TARGET_LO
|
ldd r23, Y+OBJECT_OFFS_TARGET_LO
|
||||||
ldd yh, Y+OBJECT_OFFS_TARGET_HI
|
ldd yh, Y+OBJECT_OFFS_TARGET_HI
|
||||||
mov yl, r23
|
mov yl, r23
|
||||||
|
|||||||
Reference in New Issue
Block a user