⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 debug.s

📁 u-blox的GPS模块LEA-5x,三本例子为ATMEGA1280对他的操作的程序
💻 S
📖 第 1 页 / 共 2 页
字号:
	ldi R19,3
	movw R16,R12
	xcall mod16u
	ldi R18,100
	ldi R19,0
	xcall div16u
	.dbline 138
;   debug_string[i++]=dtoc(cBuf);
	movw R22,R20
	subi R20,255  ; offset = 1
	sbci R21,255
	xcall _dtoc
	mov R14,R16
	movw R24,R28
	movw R30,R22
	add R30,R24
	adc R31,R25
	std z+0,R14
	.dbline 139
;   cBuf=(lBuf%100)/10;
	ldi R18,100
	ldi R19,0
	movw R16,R12
	xcall mod16u
	ldi R18,10
	ldi R19,0
	xcall div16u
	.dbline 140
;   debug_string[i++]=dtoc(cBuf);
	movw R22,R20
	subi R20,255  ; offset = 1
	sbci R21,255
	xcall _dtoc
	mov R14,R16
	movw R24,R28
	movw R30,R22
	add R30,R24
	adc R31,R25
	std z+0,R14
	.dbline 141
;   cBuf=lBuf%10;
	ldi R18,10
	ldi R19,0
	movw R16,R12
	xcall mod16u
	.dbline 142
;   debug_string[i++]=dtoc(cBuf);
	movw R22,R20
	subi R20,255  ; offset = 1
	sbci R21,255
	xcall _dtoc
	mov R10,R16
	movw R24,R28
	movw R30,R22
	add R30,R24
	adc R31,R25
	std z+0,R10
	.dbline 144
; 
;   debug_send_chars(debug_string,i);
	movw R18,R20
	movw R16,R28
	xcall _debug_send_chars
	.dbline 145
;   debug_send_string("\n",1);
	ldi R18,1
	ldi R19,0
	ldi R16,<L11
	ldi R17,>L11
	xcall _debug_send_string
	.dbline -2
L18:
	.dbline 0 ; func end
	adiw R28,10
	xjmp pop_xgsetF0FC
	.dbsym l debug_string 0 A[10:10]c
	.dbsym r i 20 i
	.dbsym r cBuf 10 c
	.dbsym r lBuf 12 i
	.dbend
	.dbfunc e debug_num_ulong _debug_num_ulong fV
;   debug_string -> y+0
;              i -> R20,R21
;           cBuf -> R10
;           lBuf -> y+18
	.even
_debug_num_ulong::
	xcall push_arg4
	xcall push_xgsetF03C
	sbiw R28,10
	.dbline -1
	.dbline 154
; #else
;     lBuf=0;
; #endif
; }
; /*************************************************
; 
; *************************************************/
; void debug_num_ulong(unsigned long lBuf)
; {
	.dbline 158
; #ifdef DEBUG
;   unsigned char debug_string[10];
;   unsigned char cBuf;
;   unsigned int i=0;
	clr R20
	clr R21
	.dbline 160
; 
;   cBuf=(lBuf%1000000)/100000;
	ldi R24,64
	ldi R25,66
	ldi R26,15
	ldi R27,0
	ldd R16,y+18
	ldd R17,y+19
	ldd R18,y+20
	ldd R19,y+21
	st -y,R27
	st -y,R26
	st -y,R25
	st -y,R24
	xcall mod32u
	ldi R24,160
	ldi R25,134
	ldi R26,1
	ldi R27,0
	st -y,R27
	st -y,R26
	st -y,R25
	st -y,R24
	xcall div32u
	.dbline 161
;   debug_string[i++]=dtoc(cBuf);
	movw R2,R20
	subi R20,255  ; offset = 1
	sbci R21,255
	push R2
	push R3
	xcall _dtoc
	pop R3
	pop R2
	movw R24,R28
	movw R30,R2
	add R30,R24
	adc R31,R25
	std z+0,R16
	.dbline 162
;   cBuf=(lBuf%100000)/10000;
	ldi R24,160
	ldi R25,134
	ldi R26,1
	ldi R27,0
	ldd R16,y+18
	ldd R17,y+19
	ldd R18,y+20
	ldd R19,y+21
	st -y,R27
	st -y,R26
	st -y,R25
	st -y,R24
	xcall mod32u
	ldi R24,16
	ldi R25,39
	ldi R26,0
	ldi R27,0
	st -y,R27
	st -y,R26
	st -y,R25
	st -y,R24
	xcall div32u
	.dbline 163
;   debug_string[i++]=dtoc(cBuf);
	movw R22,R20
	subi R20,255  ; offset = 1
	sbci R21,255
	xcall _dtoc
	mov R12,R16
	movw R24,R28
	movw R30,R22
	add R30,R24
	adc R31,R25
	std z+0,R12
	.dbline 164
;   cBuf=(lBuf%10000)/1000;
	ldi R24,16
	ldi R25,39
	ldi R26,0
	ldi R27,0
	ldd R16,y+18
	ldd R17,y+19
	ldd R18,y+20
	ldd R19,y+21
	st -y,R27
	st -y,R26
	st -y,R25
	st -y,R24
	xcall mod32u
	ldi R24,232
	ldi R25,3
	ldi R26,0
	ldi R27,0
	st -y,R27
	st -y,R26
	st -y,R25
	st -y,R24
	xcall div32u
	.dbline 165
;   debug_string[i++]=dtoc(cBuf);
	movw R22,R20
	subi R20,255  ; offset = 1
	sbci R21,255
	xcall _dtoc
	mov R12,R16
	movw R24,R28
	movw R30,R22
	add R30,R24
	adc R31,R25
	std z+0,R12
	.dbline 166
;   cBuf=(lBuf%1000)/100;
	ldi R24,232
	ldi R25,3
	ldi R26,0
	ldi R27,0
	ldd R16,y+18
	ldd R17,y+19
	ldd R18,y+20
	ldd R19,y+21
	st -y,R27
	st -y,R26
	st -y,R25
	st -y,R24
	xcall mod32u
	ldi R24,100
	ldi R25,0
	ldi R26,0
	ldi R27,0
	st -y,R27
	st -y,R26
	st -y,R25
	st -y,R24
	xcall div32u
	.dbline 167
;   debug_string[i++]=dtoc(cBuf);
	movw R22,R20
	subi R20,255  ; offset = 1
	sbci R21,255
	xcall _dtoc
	mov R12,R16
	movw R24,R28
	movw R30,R22
	add R30,R24
	adc R31,R25
	std z+0,R12
	.dbline 168
;   cBuf=(lBuf%100)/10;
	ldi R24,100
	ldi R25,0
	ldi R26,0
	ldi R27,0
	ldd R16,y+18
	ldd R17,y+19
	ldd R18,y+20
	ldd R19,y+21
	st -y,R27
	st -y,R26
	st -y,R25
	st -y,R24
	xcall mod32u
	ldi R24,10
	ldi R25,0
	ldi R26,0
	ldi R27,0
	st -y,R27
	st -y,R26
	st -y,R25
	st -y,R24
	xcall div32u
	.dbline 169
;   debug_string[i++]=dtoc(cBuf);
	movw R22,R20
	subi R20,255  ; offset = 1
	sbci R21,255
	xcall _dtoc
	mov R12,R16
	movw R24,R28
	movw R30,R22
	add R30,R24
	adc R31,R25
	std z+0,R12
	.dbline 170
;   cBuf=lBuf%10;
	ldi R24,10
	ldi R25,0
	ldi R26,0
	ldi R27,0
	ldd R16,y+18
	ldd R17,y+19
	ldd R18,y+20
	ldd R19,y+21
	st -y,R27
	st -y,R26
	st -y,R25
	st -y,R24
	xcall mod32u
	.dbline 171
;   debug_string[i++]=dtoc(cBuf);
	movw R22,R20
	subi R20,255  ; offset = 1
	sbci R21,255
	xcall _dtoc
	mov R10,R16
	movw R24,R28
	movw R30,R22
	add R30,R24
	adc R31,R25
	std z+0,R10
	.dbline 173
; 
;   debug_send_chars(debug_string,i);
	movw R18,R20
	movw R16,R28
	xcall _debug_send_chars
	.dbline 174
;   debug_send_string("\n",1);
	ldi R18,1
	ldi R19,0
	ldi R16,<L11
	ldi R17,>L11
	xcall _debug_send_string
	.dbline -2
L19:
	.dbline 0 ; func end
	adiw R28,10
	xcall pop_xgsetF03C
	adiw R28,4
	ret
	.dbsym l debug_string 0 A[10:10]c
	.dbsym r i 20 i
	.dbsym r cBuf 10 c
	.dbsym l lBuf 18 l
	.dbend
	.dbfunc e debug_uchar_original_shape _debug_uchar_original_shape fV
;        accii_L -> R10
;        accii_H -> R12
;         ucData -> R10
	.even
_debug_uchar_original_shape::
	st -y,R10
	st -y,R12
	mov R10,R16
	.dbline -1
	.dbline 183
; #else
;     lBuf=0;
; #endif
; }
; /*************************************************
; 
; *************************************************/
; void debug_uchar_original_shape(unsigned char ucData)
; {
	.dbline 184
;   unsigned char accii_H=char_buf[ucData/16];
	ldi R18,16
	ldi R19,0
	mov R16,R10
	clr R17
	xcall div16s
	movw R30,R16
	ldi R24,<_char_buf
	ldi R25,>_char_buf
	add R30,R24
	adc R31,R25
	elpm R12,Z
	.dbline 185
;   unsigned char accii_L=char_buf[ucData-(ucData/16)*16];
	mov R24,R10
	swap R24
	andi R24,#0x0F
	ldi R25,16
	mul R25,R24
	mov R30,R10
	clr R31
	sub R30,R0
	sbc R31,R1
	ldi R24,<_char_buf
	ldi R25,>_char_buf
	add R30,R24
	adc R31,R25
	elpm R10,Z
	.dbline 188
;   //debug_send_char('0');
;   //debug_send_char('x');
;   debug_send_char(accii_H);
	mov R16,R12
	xcall _debug_send_char
	.dbline 189
;   debug_send_char(accii_L);
	mov R16,R10
	xcall _debug_send_char
	.dbline 190
;   debug_send_char(' ');
	ldi R16,32
	xcall _debug_send_char
	.dbline -2
L20:
	.dbline 0 ; func end
	ld R12,y+
	ld R10,y+
	ret
	.dbsym r accii_L 10 c
	.dbsym r accii_H 12 c
	.dbsym r ucData 10 c
	.dbend
	.dbfunc e debug_uchars_original_shape _debug_uchars_original_shape fV
;              i -> R20,R21
;            len -> R10,R11
;         ucData -> R12,R13
	.even
_debug_uchars_original_shape::
	xcall push_xgset303C
	movw R10,R18
	movw R12,R16
	.dbline -1
	.dbline 196
; }
; /*************************************************
; 
; *************************************************/
; void debug_uchars_original_shape(unsigned char *ucData,unsigned int len)
; {
	.dbline 199
;   unsigned int i;
; 
;   for(i=0;i<len;i++)
	clr R20
	clr R21
	xjmp L25
L22:
	.dbline 200
;   {
	.dbline 201
;     debug_uchar_original_shape(ucData[i]);
	movw R30,R20
	add R30,R12
	adc R31,R13
	ldd R16,z+0
	xcall _debug_uchar_original_shape
	.dbline 202
;   }
L23:
	.dbline 199
	subi R20,255  ; offset = 1
	sbci R21,255
L25:
	.dbline 199
	cp R20,R10
	cpc R21,R11
	brlo L22
X2:
	.dbline 203
;   debug_send_string("\n",1);
	ldi R18,1
	ldi R19,0
	ldi R16,<L11
	ldi R17,>L11
	xcall _debug_send_string
	.dbline -2
L21:
	.dbline 0 ; func end
	xjmp pop_xgset303C
	.dbsym r i 20 i
	.dbsym r len 10 i
	.dbsym r ucData 12 pc
	.dbend
	.dbfunc e debug_uint_original_shape _debug_uint_original_shape fV
;       ucData_l -> R10
;       ucData_h -> R12
;         uiData -> R10,R11
	.even
_debug_uint_original_shape::
	xcall push_xgset003C
	movw R10,R16
	.dbline -1
	.dbline 209
; }
; /*************************************************
; 
; *************************************************/
; void debug_uint_original_shape(unsigned int uiData)
; {
	.dbline 212
; 	unsigned char ucData_h,ucData_l;
; 	
; 	ucData_h = (unsigned char)(uiData>>8);
	movw R12,R10
	mov R12,R13
	clr R13
	.dbline 213
; 	debug_uchar_original_shape(ucData_h);
	mov R16,R12
	xcall _debug_uchar_original_shape
	.dbline 215
; 
; 	ucData_l = (unsigned char)uiData;
	.dbline 216
; 	debug_uchar_original_shape(ucData_l);
	mov R16,R10
	xcall _debug_uchar_original_shape
	.dbline -2
L26:
	.dbline 0 ; func end
	xjmp pop_xgset003C
	.dbsym r ucData_l 10 c
	.dbsym r ucData_h 12 c
	.dbsym r uiData 10 i
	.dbend
	.area data(ram, con, rel)
	.dbfile E:\item\GPS-1280\debug.c
L11:
	.blkb 2
	.area idata
	.byte 10,0
	.area data(ram, con, rel)
	.dbfile E:\item\GPS-1280\debug.c
; }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -