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

📄 main.ls

📁 STM8s
💻 LS
📖 第 1 页 / 共 2 页
字号:
 865                     ; 209 	GPIO_WriteHigh(LCDCONT,LCD162A_E);
 867  0176 4b08          	push	#8
 868  0178 ae500a        	ldw	x,#20490
 869  017b cd0000        	call	_GPIO_WriteHigh
 871  017e 84            	pop	a
 872                     ; 212  delay_ms(1);   //最少需要650um
 874  017f ae0001        	ldw	x,#1
 875  0182 cd0000        	call	_delay_ms
 877                     ; 213 temp=GPIO_ReadInputData(PortDATA);
 879  0185 ae5005        	ldw	x,#20485
 880  0188 cd0000        	call	_GPIO_ReadInputData
 882  018b 6b01          	ld	(OFST+0,sp),a
 883                     ; 214 GPIO_WriteLow(LCDCONT,LCD162A_E);
 885  018d 4b08          	push	#8
 886  018f ae500a        	ldw	x,#20490
 887  0192 cd0000        	call	_GPIO_WriteLow
 889  0195 84            	pop	a
 890                     ; 215   GPIO_Init(PortDATA, (GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6 |GPIO_PIN_7 |GPIO_PIN_0), GPIO_MODE_OUT_PP_LOW_FAST );
 892  0196 4be0          	push	#224
 893  0198 4bff          	push	#255
 894  019a ae5005        	ldw	x,#20485
 895  019d cd0000        	call	_GPIO_Init
 897  01a0 85            	popw	x
 898                     ; 216 if(temp&0x80)
 900  01a1 7b01          	ld	a,(OFST+0,sp)
 901  01a3 a580          	bcp	a,#128
 902  01a5 2705          	jreq	L723
 903                     ; 217  return ( 1);
 905  01a7 a601          	ld	a,#1
 908  01a9 5b01          	addw	sp,#1
 909  01ab 81            	ret
 910  01ac               L723:
 911                     ; 219  return ( 0);
 913  01ac 4f            	clr	a
 916  01ad 5b01          	addw	sp,#1
 917  01af 81            	ret
1009                     ; 21 @far @interrupt void GPIOC5(void)
1009                     ; 22 {
1011                     	switch	.text
1012  01b0               f_GPIOC5:
1014       00000006      OFST:	set	6
1015  01b0 3b0002        	push	c_x+2
1016  01b3 be00          	ldw	x,c_x
1017  01b5 89            	pushw	x
1018  01b6 3b0002        	push	c_y+2
1019  01b9 be00          	ldw	x,c_y
1020  01bb 89            	pushw	x
1021  01bc be02          	ldw	x,c_lreg+2
1022  01be 89            	pushw	x
1023  01bf be00          	ldw	x,c_lreg
1024  01c1 89            	pushw	x
1025  01c2 5206          	subw	sp,#6
1028                     ; 25 	 u16 Conversion_Value = 0;
1030  01c4 1e05          	ldw	x,(OFST-1,sp)
1031                     ; 26 	 lcd162a_cls();
1033  01c6 cd0034        	call	_lcd162a_cls
1035                     ; 27 GPIO_WriteReverse(GPIOD, (GPIO_PIN_0 | GPIO_PIN_2 | GPIO_PIN_3 ));
1037  01c9 4b0d          	push	#13
1038  01cb ae500f        	ldw	x,#20495
1039  01ce cd0000        	call	_GPIO_WriteReverse
1041  01d1 84            	pop	a
1042                     ; 29     Conversion_Value = ADC1_GetConversionValue();
1044  01d2 cd0000        	call	_ADC1_GetConversionValue
1046  01d5 1f05          	ldw	(OFST-1,sp),x
1047                     ; 32 		Conversion_Value=Conversion_Value*4.83/1024*1000;
1049  01d7 1e05          	ldw	x,(OFST-1,sp)
1050  01d9 cd0000        	call	c_uitof
1052  01dc ae0018        	ldw	x,#L304
1053  01df cd0000        	call	c_fmul
1055  01e2 ae0014        	ldw	x,#L314
1056  01e5 cd0000        	call	c_fdiv
1058  01e8 ae0010        	ldw	x,#L324
1059  01eb cd0000        	call	c_fmul
1061  01ee cd0000        	call	c_ftoi
1063  01f1 1f05          	ldw	(OFST-1,sp),x
1064                     ; 33 		qian=Conversion_Value/1000;
1066  01f3 1e05          	ldw	x,(OFST-1,sp)
1067  01f5 90ae03e8      	ldw	y,#1000
1068  01f9 65            	divw	x,y
1069  01fa 01            	rrwa	x,a
1070  01fb 6b01          	ld	(OFST-5,sp),a
1071  01fd 02            	rlwa	x,a
1072                     ; 34 		bai=(Conversion_Value%1000)/100;
1074  01fe 1e05          	ldw	x,(OFST-1,sp)
1075  0200 90ae03e8      	ldw	y,#1000
1076  0204 65            	divw	x,y
1077  0205 51            	exgw	x,y
1078  0206 a664          	ld	a,#100
1079  0208 62            	div	x,a
1080  0209 01            	rrwa	x,a
1081  020a 6b02          	ld	(OFST-4,sp),a
1082  020c 02            	rlwa	x,a
1083                     ; 35 		shi=(Conversion_Value%100)/10;
1085  020d 1e05          	ldw	x,(OFST-1,sp)
1086  020f a664          	ld	a,#100
1087  0211 62            	div	x,a
1088  0212 5f            	clrw	x
1089  0213 97            	ld	xl,a
1090  0214 a60a          	ld	a,#10
1091  0216 62            	div	x,a
1092  0217 01            	rrwa	x,a
1093  0218 6b03          	ld	(OFST-3,sp),a
1094  021a 02            	rlwa	x,a
1095                     ; 36 		ge=(Conversion_Value%10);
1097  021b 1e05          	ldw	x,(OFST-1,sp)
1098  021d a60a          	ld	a,#10
1099  021f 62            	div	x,a
1100  0220 5f            	clrw	x
1101  0221 97            	ld	xl,a
1102  0222 9f            	ld	a,xl
1103  0223 6b04          	ld	(OFST-2,sp),a
1104                     ; 42 		lcd162a_DispOneChar(1,1,qian+48); 
1106  0225 7b01          	ld	a,(OFST-5,sp)
1107  0227 ab30          	add	a,#48
1108  0229 88            	push	a
1109  022a ae0001        	ldw	x,#1
1110  022d a601          	ld	a,#1
1111  022f 95            	ld	xh,a
1112  0230 cd0056        	call	_lcd162a_DispOneChar
1114  0233 84            	pop	a
1115                     ; 43 		lcd162a_DispOneChar(1,2,46); 
1117  0234 4b2e          	push	#46
1118  0236 ae0002        	ldw	x,#2
1119  0239 a601          	ld	a,#1
1120  023b 95            	ld	xh,a
1121  023c cd0056        	call	_lcd162a_DispOneChar
1123  023f 84            	pop	a
1124                     ; 44 		lcd162a_DispOneChar(1,3,bai+48); 
1126  0240 7b02          	ld	a,(OFST-4,sp)
1127  0242 ab30          	add	a,#48
1128  0244 88            	push	a
1129  0245 ae0003        	ldw	x,#3
1130  0248 a601          	ld	a,#1
1131  024a 95            	ld	xh,a
1132  024b cd0056        	call	_lcd162a_DispOneChar
1134  024e 84            	pop	a
1135                     ; 45 		lcd162a_DispOneChar(1,4,shi+48); 
1137  024f 7b03          	ld	a,(OFST-3,sp)
1138  0251 ab30          	add	a,#48
1139  0253 88            	push	a
1140  0254 ae0004        	ldw	x,#4
1141  0257 a601          	ld	a,#1
1142  0259 95            	ld	xh,a
1143  025a cd0056        	call	_lcd162a_DispOneChar
1145  025d 84            	pop	a
1146                     ; 46 		lcd162a_DispOneChar(1,5,ge+48); 
1148  025e 7b04          	ld	a,(OFST-2,sp)
1149  0260 ab30          	add	a,#48
1150  0262 88            	push	a
1151  0263 ae0005        	ldw	x,#5
1152  0266 a601          	ld	a,#1
1153  0268 95            	ld	xh,a
1154  0269 cd0056        	call	_lcd162a_DispOneChar
1156  026c 84            	pop	a
1157                     ; 52 		ADC1_ClearFlag (ADC1_FLAG_AWS9 );
1159  026d a619          	ld	a,#25
1160  026f cd0000        	call	_ADC1_ClearFlag
1162                     ; 54 }
1165  0272 5b06          	addw	sp,#6
1166  0274 85            	popw	x
1167  0275 bf00          	ldw	c_lreg,x
1168  0277 85            	popw	x
1169  0278 bf02          	ldw	c_lreg+2,x
1170  027a 85            	popw	x
1171  027b bf00          	ldw	c_y,x
1172  027d 320002        	pop	c_y+2
1173  0280 85            	popw	x
1174  0281 bf00          	ldw	c_x,x
1175  0283 320002        	pop	c_x+2
1176  0286 80            	iret
1218                     ; 59 void xwDelay(void)
1218                     ; 60 {
1220                     	switch	.text
1221  0287               _xwDelay:
1223  0287 5204          	subw	sp,#4
1224       00000004      OFST:	set	4
1227                     ; 61 	int i=2;
1229  0289 ae0002        	ldw	x,#2
1230  028c 1f01          	ldw	(OFST-3,sp),x
1231                     ; 62 	int j=200;
1233  028e ae00c8        	ldw	x,#200
1234  0291 1f03          	ldw	(OFST-1,sp),x
1236  0293 200f          	jra	L554
1237  0295               L364:
1238                     ; 63 	while(i--)while(j--);
1240  0295 1e03          	ldw	x,(OFST-1,sp)
1241  0297 1d0001        	subw	x,#1
1242  029a 1f03          	ldw	(OFST-1,sp),x
1243  029c 1c0001        	addw	x,#1
1244  029f a30000        	cpw	x,#0
1245  02a2 26f1          	jrne	L364
1246  02a4               L554:
1249  02a4 1e01          	ldw	x,(OFST-3,sp)
1250  02a6 1d0001        	subw	x,#1
1251  02a9 1f01          	ldw	(OFST-3,sp),x
1252  02ab 1c0001        	addw	x,#1
1253  02ae a30000        	cpw	x,#0
1254  02b1 26e2          	jrne	L364
1255                     ; 64 }
1258  02b3 5b04          	addw	sp,#4
1259  02b5 81            	ret
1302                     ; 68 main()
1302                     ; 69 {
1303                     	switch	.text
1304  02b6               _main:
1306  02b6 89            	pushw	x
1307       00000002      OFST:	set	2
1310                     ; 70     u8 *p1="Hello,world.YSU";
1312  02b7 ae0000        	ldw	x,#L505
1313  02ba 1f01          	ldw	(OFST-1,sp),x
1314                     ; 71 		GPIO_Init(GPIOD, (GPIO_PIN_0 | GPIO_PIN_2 | GPIO_PIN_3 ), GPIO_MODE_OUT_PP_LOW_FAST );
1316  02bc 4be0          	push	#224
1317  02be 4b0d          	push	#13
1318  02c0 ae500f        	ldw	x,#20495
1319  02c3 cd0000        	call	_GPIO_Init
1321  02c6 85            	popw	x
1322                     ; 72 		GPIO_Init(GPIOC, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, GPIO_MODE_OUT_PP_LOW_FAST );
1324  02c7 4be0          	push	#224
1325  02c9 4b0e          	push	#14
1326  02cb ae500a        	ldw	x,#20490
1327  02ce cd0000        	call	_GPIO_Init
1329  02d1 85            	popw	x
1330                     ; 73  GPIO_Init(GPIOB, (GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6 |GPIO_PIN_7 |GPIO_PIN_0), GPIO_MODE_OUT_PP_LOW_FAST );
1332  02d2 4be0          	push	#224
1333  02d4 4bff          	push	#255
1334  02d6 ae5005        	ldw	x,#20485
1335  02d9 cd0000        	call	_GPIO_Init
1337  02dc 85            	popw	x
1338                     ; 80 	ADC1_DeInit();
1340  02dd cd0000        	call	_ADC1_DeInit
1342                     ; 82 	ADC1_Init(ADC1_CONVERSIONMODE_CONTINUOUS,ADC1_CHANNEL_9,ADC1_PRESSEL_FCPU_D2,ADC1_EXTTRIG_TIM,DISABLE,ADC1_ALIGN_RIGHT, ADC1_SCHMITTTRIG_CHANNEL9, DISABLE);
1344  02e0 4b00          	push	#0
1345  02e2 4b09          	push	#9
1346  02e4 4b08          	push	#8
1347  02e6 4b00          	push	#0
1348  02e8 4b00          	push	#0
1349  02ea 4b00          	push	#0
1350  02ec ae0009        	ldw	x,#9
1351  02ef a601          	ld	a,#1
1352  02f1 95            	ld	xh,a
1353  02f2 cd0000        	call	_ADC1_Init
1355  02f5 5b06          	addw	sp,#6
1356                     ; 84 	ADC1_StartConversion();
1358  02f7 cd0000        	call	_ADC1_StartConversion
1360                     ; 85 	EXTI_SetTLISensitivity(EXTI_SENSITIVITY_RISE_ONLY);
1362  02fa a601          	ld	a,#1
1363  02fc cd0000        	call	_EXTI_SetTLISensitivity
1365                     ; 87 	GPIO_Init(GPIOD,GPIO_PIN_7,GPIO_MODE_IN_FL_IT);
1367  02ff 4b20          	push	#32
1368  0301 4b80          	push	#128
1369  0303 ae500f        	ldw	x,#20495
1370  0306 cd0000        	call	_GPIO_Init
1372  0309 85            	popw	x
1373                     ; 88 	lcd162a_Reset();
1375  030a cd00b2        	call	_lcd162a_Reset
1377                     ; 89   lcd162a_cls();
1379  030d cd0034        	call	_lcd162a_cls
1381                     ; 92     lcd162a_ePutstr(1,1,p1);    
1383  0310 1e01          	ldw	x,(OFST-1,sp)
1384  0312 89            	pushw	x
1385  0313 ae0001        	ldw	x,#1
1386  0316 a601          	ld	a,#1
1387  0318 95            	ld	xh,a
1388  0319 cd0065        	call	_lcd162a_ePutstr
1390  031c 85            	popw	x
1391  031d               L705:
1393  031d 20fe          	jra	L705
1406                     	xdef	_main
1407                     	xdef	_xwDelay
1408                     	xdef	f_GPIOC5
1409                     	xdef	_delay_us
1410                     	xdef	_delay_ms
1411                     	xdef	_LCD_BUSY
1412                     	xdef	_lcd162a_ePutstr
1413                     	xdef	_lcd162a_WriteData
1414                     	xdef	_lcd162a_WriteCommand
1415                     	xdef	_lcd162a_LocateXY
1416                     	xdef	_lcd162a_cls
1417                     	xdef	_lcd162a_DispOneChar
1418                     	xdef	_lcd162a_Reset
1419                     	xref	_EXTI_SetTLISensitivity
1420                     	xref	_ADC1_ClearFlag
1421                     	xref	_ADC1_GetConversionValue
1422                     	xref	_ADC1_StartConversion
1423                     	xref	_ADC1_Init
1424                     	xref	_ADC1_DeInit
1425                     	xref	_GPIO_ReadInputData
1426                     	xref	_GPIO_WriteReverse
1427                     	xref	_GPIO_WriteLow
1428                     	xref	_GPIO_WriteHigh
1429                     	xref	_GPIO_Write
1430                     	xref	_GPIO_Init
1431                     .const:	section	.text
1432  0000               L505:
1433  0000 48656c6c6f2c  	dc.b	"Hello,world.YSU",0
1434  0010               L324:
1435  0010 447a0000      	dc.w	17530,0
1436  0014               L314:
1437  0014 44800000      	dc.w	17536,0
1438  0018               L304:
1439  0018 409a8f5c      	dc.w	16538,-28836
1440                     	xref.b	c_lreg
1441                     	xref.b	c_x
1442                     	xref.b	c_y
1462                     	xref	c_ftoi
1463                     	xref	c_fdiv
1464                     	xref	c_fmul
1465                     	xref	c_uitof
1466                     	end

⌨️ 快捷键说明

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