added more bigcall/bigjmp as we go along with larger code.

This commit is contained in:
Martin Preuss
2025-06-02 01:02:06 +02:00
parent 1f537849a9
commit 3582659018
8 changed files with 41 additions and 41 deletions

View File

@@ -25,13 +25,13 @@ NETMSG_Device_Write:
st X+, r16 ; msg code
ldd r16, Y+NET_IFACE_OFFS_ADDRESS
st X+, r16 ; src address
rcall NETMSG_Common_AddUidToBuffer ; (R16, R18, R19, R20, R21)
bigcall NETMSG_Common_AddUidToBuffer ; (R16, R18, R19, R20, R21)
ldi zh, HIGH(devInfoBlock*2) ; 6-17: devInfoBlock
ldi zl, LOW(devInfoBlock*2)
ldi r18, 12
bigcall Utils_CopyFromFlash ; (R17, R18, X, Z)
sbiw xh:xl, 20 ; go back to beginning of message (1 byte dst addr, 1 byte length, 18 bytes payload)
rcall NETMSG_CalcAndAddChecksumByte ; (R16, R17, R18, R19, R20, X)
bigcall NETMSG_CalcAndAddChecksumByte ; (R16, R17, R18, R19, R20, X)
sbiw xh:xl, 21 ; go back to beginning of message (1 byte dst addr, 1 byte length, 18 bytes payload, 1 byte crc)
ret
; @end

View File

@@ -27,7 +27,7 @@ NETMSG_MemStats_Write:
st X+, r16 ; src address
; uid
rcall NETMSG_Common_AddUidToBuffer ; (R16, R18, R19, R20, R21)
bigcall NETMSG_Common_AddUidToBuffer ; (R16, R18, R19, R20, R21)
; timestamp (0 for now)
clr r16
st X+, r16
@@ -53,7 +53,7 @@ NETMSG_MemStats_Write:
; current buffers used
push xl
push xh
rcall NET_Buffer_CountUsed ; (r16, r17, r18, X)
bigcall NET_Buffer_CountUsed ; (r16, r17, r18, X)
pop xh
pop xl
st X+, r16
@@ -67,7 +67,7 @@ NETMSG_MemStats_Write:
st X+, r16
sbiw xh:xl, 18 ; go back to beginning of message (1 byte dst addr, 1 byte length, 16 bytes payload)
rcall NETMSG_CalcAndAddChecksumByte ; (R16, R17, R18, R19, R20, X)
bigcall NETMSG_CalcAndAddChecksumByte ; (R16, R17, R18, R19, R20, X)
sbiw xh:xl, 19 ; go back to beginning of message (1 byte dst addr, 1 byte length, 16 bytes payload, 1 byte crc)
ret
; @end

View File

@@ -18,17 +18,17 @@
; @clobbers R16 (R17, R18, R19, R20, R21, Z)
NETMSG_Pong_Write:
st X+, r16 ; dest address
ldi r16, 6 ; msg code+src address+4 payload bytes
st X+, r16 ; msg len
st X+, r16 ; dest address
ldi r16, 6 ; msg code+src address+4 payload bytes
st X+, r16 ; msg len
ldi r16, NETMSG_CMD_PONG
st X+, r16 ; msg code
st X+, r16 ; msg code
ldd r16, Y+NET_IFACE_OFFS_ADDRESS
st X+, r16 ; src address
rcall NETMSG_Common_AddUidToBuffer ; (R16, R18, R19, R20, R21)
st X+, r16 ; src address
bigcall NETMSG_Common_AddUidToBuffer ; (R16, R18, R19, R20, R21)
sbiw xh:xl, 8 ; go back to beginning of message (1 byte dst addr, 1 byte length, 6 bytes payload)
rcall NETMSG_CalcAndAddChecksumByte ; (R16, R17, R18, R19, R20, X)
bigcall NETMSG_CalcAndAddChecksumByte ; (R16, R17, R18, R19, R20, X)
sbiw xh:xl, 9 ; go back to beginning of message (1 byte dst addr, 1 byte length, 6 bytes payload, 1 byte crc)
ret
; @end

View File

@@ -31,7 +31,7 @@ NETMSG_RebootRequestRead:
push xl
push xh
adiw xh:xl, NETMSG_REBOOTREQ_OFFS_UID
rcall NETMSG_CheckUidInMsg ; (r16, r18, r19, r20, r21, X)
bigcall NETMSG_CheckUidInMsg ; (r16, r18, r19, r20, r21, X)
pop xh
pop xl
pop r16

View File

@@ -25,14 +25,14 @@ NETMSG_RecvStats_Write:
st X+, r16 ; msg code
ldd r16, Y+NET_IFACE_OFFS_ADDRESS
st X+, r16 ; src address
rcall NETMSG_Common_AddUidToBuffer ; (R16, R18, R19, R20, R21)
bigcall NETMSG_Common_AddUidToBuffer ; (R16, R18, R19, R20, R21)
adiw yh:yl, NET_IFACE_OFFS_PACKETSIN_LOW
ldi r18, 12
bigcall Utils_Copy_SDRAM ; (R17, R18, X, Y)
sbiw yh:yl, NET_IFACE_OFFS_PACKETSIN_LOW+12
sbiw xh:xl, 20 ; go back to beginning of message (1 byte dst addr, 1 byte length, 18 bytes payload)
rcall NETMSG_CalcAndAddChecksumByte ; (R16, R17, R18, R19, R20, X)
bigcall NETMSG_CalcAndAddChecksumByte ; (R16, R17, R18, R19, R20, X)
sbiw xh:xl, 21 ; go back to beginning of message (1 byte dst addr, 1 byte length, 18 bytes payload, 1 byte crc)
ret
; @end

View File

@@ -25,14 +25,14 @@ NETMSG_SendStats_Write:
st X+, r16 ; msg code
ldd r16, Y+NET_IFACE_OFFS_ADDRESS
st X+, r16 ; src address
rcall NETMSG_Common_AddUidToBuffer ; (R16, R18, R19, R20, R21)
bigcall NETMSG_Common_AddUidToBuffer ; (R16, R18, R19, R20, R21)
adiw yh:yl, NET_IFACE_OFFS_PACKETSOUT_LOW
ldi r18, 6
bigcall Utils_Copy_SDRAM ; (R17, R18, X, Y)
sbiw yh:yl, NET_IFACE_OFFS_PACKETSOUT_LOW+6
sbiw xh:xl, 14 ; go back to beginning of message (1 byte dst addr, 1 byte length, 12 bytes payload)
rcall NETMSG_CalcAndAddChecksumByte ; (R16, R17, R18, R19, R20, X)
bigcall NETMSG_CalcAndAddChecksumByte ; (R16, R17, R18, R19, R20, X)
sbiw xh:xl, 15 ; go back to beginning of message (1 byte dst addr, 1 byte length, 12 bytes payload, 1 byte crc)
ret
; @end