Files
aqhomecontrol/avr/modules/network/msg/addr-r.asm
2026-04-26 12:47:50 +02:00

43 lines
1.1 KiB
NASM

; ***************************************************************************
; copyright : (C) 2026 by Martin Preuss
; email : martin@libchipcard.de
;
; ***************************************************************************
; * This file is part of the project "AqHome". *
; * Please see toplevel file COPYING of that project for license details. *
; ***************************************************************************
#ifndef AQH_AVR_NETWORK_MSG_ADDR_R_ASM
#define AQH_AVR_NETWORK_MSG_ADDR_R_ASM
; ***************************************************************************
; code
.cseg
; ---------------------------------------------------------------------------
; @routine NETMSG_Address_Read @global
; Read an ADDRESS message.
;
; @param X buffer to read from
; @return R18 command
; @return R19 address to send
; @clobbers R18, R19
NETMSG_Address_Read:
adiw xh:xl, NETMSG_OFFS_CMD
ld r18, X+ ; command
adiw xh:xl, 5 ; skip src addr and uid
ld r19, X+ ; addr
sbiw xh:xl, 9 ; back to msg begin
ret
; @end
#endif