From 3582659018aae5320b43900fb08e457e56cbda29 Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Mon, 2 Jun 2025 01:02:06 +0200 Subject: [PATCH] added more bigcall/bigjmp as we go along with larger code. --- avr/apps/network/main.asm | 24 ++++++++++++------------ avr/apps/network/stats.asm | 24 ++++++++++++------------ avr/modules/network/msg/device-w.asm | 4 ++-- avr/modules/network/msg/memstats-w.asm | 6 +++--- avr/modules/network/msg/pong-w.asm | 14 +++++++------- avr/modules/network/msg/reboot-r.asm | 2 +- avr/modules/network/msg/recvstats-w.asm | 4 ++-- avr/modules/network/msg/sendstats-w.asm | 4 ++-- 8 files changed, 41 insertions(+), 41 deletions(-) diff --git a/avr/apps/network/main.asm b/avr/apps/network/main.asm index d440e20..54c43b8 100644 --- a/avr/apps/network/main.asm +++ b/avr/apps/network/main.asm @@ -124,7 +124,7 @@ AppNetwork_HandleMsg_handleRangeMsg: rjmp AppNetwork_HandleMsg_clcRet AppNetwork_HandleMsg_handleAddrMsg: - rcall NETMSG_Address_Read ; R18=cmd, R19=addr(R18, R19) + bigcall NETMSG_Address_Read ; R18=cmd, R19=addr(R18, R19) mov r16, r18 subi r16, NETMSG_CMD_NEED_ADDRESS ldi zl, LOW(appNetworkMsgTable) @@ -175,18 +175,18 @@ appNetworkHandlePingRequest: adiw xh:xl, NETMSG_OFFS_SRCADDR ld r17, X push r17 - rcall NET_Buffer_Alloc ; (R16, R17, X) + bigcall NET_Buffer_Alloc ; (R16, R17, X) pop r17 - brcc appNetworkHandlePingRequest_end ; jmp on error - push r16 ; buffer num - mov r16, r17 ; DEST addr + brcc appNetworkHandlePingRequest_end ; jmp on error + push r16 ; buffer num + mov r16, r17 ; DEST addr adiw xh:xl, 1 ldi yl, LOW(netInterfaceData) ldi yh, HIGH(netInterfaceData) - rcall NETMSG_Pong_Write ; (R16, R17, R18, R19, R20, X) + bigcall NETMSG_Pong_Write ; (R16, R17, R18, R19, R20, X) sbiw xh:xl, 1 - pop r16 ; buffer num - rcall NET_Interface_AddOrReleaseOutMsg ; (R16, R17, R18, X) + pop r16 ; buffer num + bigcall NET_Interface_AddOrReleaseOutMsg ; (R16, R17, R18, X) appNetworkHandlePingRequest_end: ret @@ -393,16 +393,16 @@ appNetworkHandleMsgDenyAddr_end: ; @clobbers R16 (R17, R18, R19, R20, R21, X) appNetworkSendAddrMsg: - rcall NET_Buffer_Alloc ; (R16, R17, X) + bigcall NET_Buffer_Alloc ; (R16, R17, X) brcc appNetworkSendAddrMsg_end adiw xh:xl, 1 push r16 - rcall NETMSG_Address_Write ; (R16, R17, R18, R19, R20, R21) + bigcall NETMSG_Address_Write ; (R16, R17, R18, R19, R20, R21) pop r16 sbiw xh:xl, 1 - rcall NET_Interface_AddOutgoingMsgNum ; (R17, R18, X) + bigcall NET_Interface_AddOutgoingMsgNum ; (R17, R18, X) brcs appNetworkSendAddrMsg_end - rcall NET_Buffer_ReleaseByNum ; (R16, X) + bigcall NET_Buffer_ReleaseByNum ; (R16, X) clc appNetworkSendAddrMsg_end: ret diff --git a/avr/apps/network/stats.asm b/avr/apps/network/stats.asm index 2b2d6bb..c50f7f1 100644 --- a/avr/apps/network/stats.asm +++ b/avr/apps/network/stats.asm @@ -18,14 +18,14 @@ ; @clobbers R16, X (R17, R18, R19, R20, R21, Z) AppNetwork_SendTxdStats: - rcall NET_Buffer_Alloc ; (R16, R17, X) + bigcall NET_Buffer_Alloc ; (R16, R17, X) brcc AppNetwork_SendTxdStats_end push r16 adiw xh:xl, 1 - rcall NETMSG_SendStats_Write ; (R16, R17, R18, R19, R20, R21, Z) + bigcall NETMSG_SendStats_Write ; (R16, R17, R18, R19, R20, R21, Z) sbiw xh:xl, 1 pop r16 - rcall NET_Interface_AddOrReleaseOutMsg ; (R16, R17, R18, X) + bigcall NET_Interface_AddOrReleaseOutMsg ; (R16, R17, R18, X) AppNetwork_SendTxdStats_end: ret ; @end @@ -39,14 +39,14 @@ AppNetwork_SendTxdStats_end: ; @clobbers R16, X (R17, R18, R19, R20, R21, Z) AppNetwork_SendRxdStats: - rcall NET_Buffer_Alloc ; (R16, R17, X) + bigcall NET_Buffer_Alloc ; (R16, R17, X) brcc AppNetwork_SendRxdStats_end push r16 adiw xh:xl, 1 - rcall NETMSG_RecvStats_Write ; (R16, R17, R18, R19, R20, R21, Z) + bigcall NETMSG_RecvStats_Write ; (R16, R17, R18, R19, R20, R21, Z) sbiw xh:xl, 1 pop r16 - rcall NET_Interface_AddOrReleaseOutMsg ; (R16, R17, R18, X) + bigcall NET_Interface_AddOrReleaseOutMsg ; (R16, R17, R18, X) AppNetwork_SendRxdStats_end: ret ; @end @@ -60,14 +60,14 @@ AppNetwork_SendRxdStats_end: ; @clobbers R16, X (R17, R18, R19, R20, R21, Z) AppNetwork_SendMemStats: - rcall NET_Buffer_Alloc ; (R16, R17, X) + bigcall NET_Buffer_Alloc ; (R16, R17, X) brcc AppNetwork_SendMemStats_end push r16 adiw xh:xl, 1 - rcall NETMSG_MemStats_Write ; (R16, R17, R18, R19, R20, R21) + bigcall NETMSG_MemStats_Write ; (R16, R17, R18, R19, R20, R21) sbiw xh:xl, 1 pop r16 - rcall NET_Interface_AddOrReleaseOutMsg ; (R16, R17, R18, X) + bigcall NET_Interface_AddOrReleaseOutMsg ; (R16, R17, R18, X) AppNetwork_SendMemStats_end: ret ; @end @@ -81,14 +81,14 @@ AppNetwork_SendMemStats_end: ; @clobbers R16, X (R17, R18, R19, R20, R21, Z) AppNetwork_SendDevice: - rcall NET_Buffer_Alloc ; (R16, R17, X) + bigcall NET_Buffer_Alloc ; (R16, R17, X) brcc AppNetwork_SendDevice_end push r16 adiw xh:xl, 1 - rcall NETMSG_Device_Write ; (R16, R17, R18, R19, R20, R21, Z) + bigcall NETMSG_Device_Write ; (R16, R17, R18, R19, R20, R21, Z) sbiw xh:xl, 1 pop r16 - rcall NET_Interface_AddOrReleaseOutMsg ; (R16, R17, R18, X) + bigcall NET_Interface_AddOrReleaseOutMsg ; (R16, R17, R18, X) AppNetwork_SendDevice_end: ret ; @end diff --git a/avr/modules/network/msg/device-w.asm b/avr/modules/network/msg/device-w.asm index a1e7ec2..c173d0b 100644 --- a/avr/modules/network/msg/device-w.asm +++ b/avr/modules/network/msg/device-w.asm @@ -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 diff --git a/avr/modules/network/msg/memstats-w.asm b/avr/modules/network/msg/memstats-w.asm index 7317936..2bbfa66 100644 --- a/avr/modules/network/msg/memstats-w.asm +++ b/avr/modules/network/msg/memstats-w.asm @@ -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 diff --git a/avr/modules/network/msg/pong-w.asm b/avr/modules/network/msg/pong-w.asm index 650bece..5a70f9b 100644 --- a/avr/modules/network/msg/pong-w.asm +++ b/avr/modules/network/msg/pong-w.asm @@ -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 diff --git a/avr/modules/network/msg/reboot-r.asm b/avr/modules/network/msg/reboot-r.asm index a99bcf9..29af0f2 100644 --- a/avr/modules/network/msg/reboot-r.asm +++ b/avr/modules/network/msg/reboot-r.asm @@ -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 diff --git a/avr/modules/network/msg/recvstats-w.asm b/avr/modules/network/msg/recvstats-w.asm index d170d74..451c3c0 100644 --- a/avr/modules/network/msg/recvstats-w.asm +++ b/avr/modules/network/msg/recvstats-w.asm @@ -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 diff --git a/avr/modules/network/msg/sendstats-w.asm b/avr/modules/network/msg/sendstats-w.asm index f33d612..594b9ad 100644 --- a/avr/modules/network/msg/sendstats-w.asm +++ b/avr/modules/network/msg/sendstats-w.asm @@ -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