📄 debugtrace.lst
字号:
\ 000001 8A82 MOV DPL,R2
\ 000003 8B83 MOV DPH,R3
\ 000005 A3 INC DPTR
\ 000006 A3 INC DPTR
\ 000007 A3 INC DPTR
\ 000008 22 RET
\ In segment BANKED_CODE, align 1, keep-with-next
\ ?Subroutine0:
\ 000000 12.... LCALL ?Subroutine2 & 0xFFFF
\ ??CrossCallReturnLabel_5:
\ 000003 A3 INC DPTR
\ 000004 A3 INC DPTR
\ 000005 A3 INC DPTR
\ 000006 A3 INC DPTR
\ 000007 22 RET
129
130 /*********************************************************************
131 * @fn debug_str
132 *
133 * @brief
134 *
135 * This feature allows modules to display a debug text string as
136 * applications execute in real-time. This feature will output to
137 * the serial port for display in the Z-Test tool.
138 *
139 * This feature will most likely be compiled out in the production
140 * code in order to save code space.
141 *
142 * @param byte *str_ptr - pointer to null-terminated string
143 *
144 * @return void
145 */
\ In segment BANKED_CODE, align 1, keep-with-next
146 void debug_str( byte *str_ptr )
\ debug_str:
147 {
\ 000000 74F2 MOV A,#-0xe
\ 000002 12.... LCALL ?BANKED_ENTER_XDATA
\ 000005 ; Saved register size: 14
\ 000005 ; Auto size: 0
\ 000005 8A.. MOV ?V0 + 0,R2
\ 000007 8B.. MOV ?V0 + 1,R3
148 mtDebugStr_t *msg;
149 byte mln;
150 byte sln;
151
152 // Text string length
153 sln = (byte)osal_strlen( (void*)str_ptr );
\ 000009 ; Setup parameters for call to function osal_strlen
\ 000009 90.... MOV DPTR,#(osal_strlen & 0xffff)
\ 00000C 74.. MOV A,#((osal_strlen >> 16) & 0xff)
\ 00000E 12.... LCALL ?BCALL ; Banked call to: DPTR()
\ 000011 EA MOV A,R2
\ 000012 F5.. MOV ?V0 + 3,A
154
155 // Debug string message length
156 mln = sizeof ( mtDebugStr_t ) + sln;
157
158 // Get a message buffer to build the debug message
159 msg = (mtDebugStr_t *)osal_msg_allocate( mln );
\ 000014 ; Setup parameters for call to function osal_msg_allocate
\ 000014 7405 MOV A,#0x5
\ 000016 25.. ADD A,?V0 + 3
\ 000018 FA MOV R2,A
\ 000019 7B00 MOV R3,#0x0
\ 00001B 90.... MOV DPTR,#(osal_msg_allocate & 0xffff)
\ 00001E 74.. MOV A,#((osal_msg_allocate >> 16) & 0xff)
\ 000020 12.... LCALL ?BCALL ; Banked call to: DPTR()
\ 000023 8A.. MOV ?V0 + 4,R2
\ 000025 8B.. MOV ?V0 + 5,R3
\ 000027 AE.. MOV R6,?V0 + 4
\ 000029 AF.. MOV R7,?V0 + 5
160 if ( msg )
\ 00002B EE MOV A,R6
\ 00002C 7001 JNZ ??debug_str_0
\ 00002E EF MOV A,R7
\ ??debug_str_0:
\ 00002F 605A JZ ??debug_str_1
161 {
162 // Message type, length
163 msg->hdr.event = CMD_DEBUG_STR;
\ 000031 7406 MOV A,#0x6
\ 000033 8E82 MOV DPL,R6
\ 000035 8F83 MOV DPH,R7
\ 000037 F0 MOVX @DPTR,A
164 msg->sln = sln;
\ 000038 A3 INC DPTR
\ 000039 A3 INC DPTR
\ 00003A E5.. MOV A,?V0 + 3
\ 00003C F0 MOVX @DPTR,A
165
166 // Append message, no terminator
167 msg->pString = (uint8 *)(msg+1);
\ 00003D EE MOV A,R6
\ 00003E 2403 ADD A,#0x3
\ 000040 0A INC R2
\ 000041 0A INC R2
\ 000042 0A INC R2
\ 000043 EF MOV A,R7
\ 000044 3400 ADDC A,#0x0
\ 000046 FB MOV R3,A
\ 000047 EE MOV A,R6
\ 000048 2405 ADD A,#0x5
\ 00004A F8 MOV R0,A
\ 00004B EF MOV A,R7
\ 00004C 3400 ADDC A,#0x0
\ 00004E F9 MOV R1,A
\ 00004F 8A82 MOV DPL,R2
\ 000051 8B83 MOV DPH,R3
\ 000053 E8 MOV A,R0
\ 000054 F0 MOVX @DPTR,A
\ 000055 A3 INC DPTR
\ 000056 E9 MOV A,R1
\ 000057 F0 MOVX @DPTR,A
168 osal_memcpy ( msg->pString, str_ptr, sln );
\ 000058 ; Setup parameters for call to function osal_memcpy
\ 000058 75..00 MOV ?V0 + 2,#0x0
\ 00005B 78.. MOV R0,#?V0 + 0
\ 00005D 12.... LCALL ?PUSH_XSTACK_I_THREE
\ 000060 AC.. MOV R4,?V0 + 3
\ 000062 7D00 MOV R5,#0x0
\ 000064 8A82 MOV DPL,R2
\ 000066 8B83 MOV DPH,R3
\ 000068 E0 MOVX A,@DPTR
\ 000069 FA MOV R2,A
\ 00006A A3 INC DPTR
\ 00006B E0 MOVX A,@DPTR
\ 00006C FB MOV R3,A
\ 00006D 90.... MOV DPTR,#(osal_memcpy & 0xffff)
\ 000070 74.. MOV A,#((osal_memcpy >> 16) & 0xff)
\ 000072 12.... LCALL ?BCALL ; Banked call to: DPTR()
\ 000075 7403 MOV A,#0x3
\ 000077 12.... LCALL ?DEALLOC_XSTACK8
169
170 osal_msg_send( MT_TaskID, (uint8 *)msg );
\ 00007A ; Setup parameters for call to function osal_msg_send
\ 00007A EE MOV A,R6
\ 00007B FA MOV R2,A
\ 00007C EF MOV A,R7
\ 00007D FB MOV R3,A
\ 00007E 90.... MOV DPTR,#MT_TaskID
\ 000081 E0 MOVX A,@DPTR
\ 000082 F9 MOV R1,A
\ 000083 90.... MOV DPTR,#(osal_msg_send & 0xffff)
\ 000086 74.. MOV A,#((osal_msg_send >> 16) & 0xff)
\ 000088 12.... LCALL ?BCALL ; Banked call to: DPTR()
171 }
172 } // debug_str()
\ ??debug_str_1:
\ 00008B 7F06 MOV R7,#0x6
\ 00008D 02.... LJMP ?BANKED_LEAVE_XDATA
173
174 /*********************************************************************
175 *********************************************************************/
176 #endif // MT_TASK
Maximum stack usage in bytes:
Function ISTACK PSTACK XSTACK
-------- ------ ------ ------
debug_msg 1 0 22
-> osal_msg_allocate 0 0 36
-> osal_msg_send 0 0 36
debug_str 1 0 17
-> osal_strlen 0 0 28
-> osal_msg_allocate 0 0 28
-> osal_memcpy 0 0 34
-> osal_msg_send 0 0 28
Segment part sizes:
Function/Label Bytes
-------------- -----
debug_msg 184
?Subroutine1 4
?Subroutine2 9
?Subroutine0 8
debug_str 144
349 bytes in segment BANKED_CODE
349 bytes of CODE memory
Errors: none
Warnings: none
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -