avr: use Heap_AllocAndZero, added OBJ_EmitSignalWithSelector

This commit is contained in:
Martin Preuss
2026-04-21 00:00:14 +02:00
parent 0eeff3634c
commit 00bb83ef4e

View File

@@ -100,23 +100,9 @@ Object_Alloc:
push xh
push r16
push r17
push r24
push r25
bigcall Heap_Alloc ; X=mem allocated (r16, r17, r18, r19, r24, r25, X)
pop r25
pop r24
bigcall Heap_AllocAndZero
pop r17
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 xl
ret
@@ -537,9 +523,25 @@ OBJ_GetRootToY_end:
; @clobbers any, !Y
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 yh
ldd r17, Y+OBJECT_OFFS_SELECTOR
ldd r23, Y+OBJECT_OFFS_TARGET_LO
ldd yh, Y+OBJECT_OFFS_TARGET_HI
mov yl, r23