📄 main.ls
字号:
877 ; 214 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 ; 215 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 ; 216 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 ; 217 if(temp&0x80)
900 01a1 7b01 ld a,(OFST+0,sp)
901 01a3 a580 bcp a,#128
902 01a5 2705 jreq L723
903 ; 218 return ( 1);
905 01a7 a601 ld a,#1
908 01a9 5b01 addw sp,#1
909 01ab 81 ret
910 01ac L723:
911 ; 220 return ( 0);
913 01ac 4f clr a
916 01ad 5b01 addw sp,#1
917 01af 81 ret
977 ; 24 void xwDelay(void)
977 ; 25 {
978 switch .text
979 01b0 _xwDelay:
981 01b0 5204 subw sp,#4
982 00000004 OFST: set 4
985 ; 26 int i=20;
987 01b2 ae0014 ldw x,#20
988 01b5 1f01 ldw (OFST-3,sp),x
989 ; 27 int j=10000;
991 01b7 ae2710 ldw x,#10000
992 01ba 1f03 ldw (OFST-1,sp),x
994 01bc 200f jra L763
995 01be L573:
996 ; 28 while(i--)while(j--);
998 01be 1e03 ldw x,(OFST-1,sp)
999 01c0 1d0001 subw x,#1
1000 01c3 1f03 ldw (OFST-1,sp),x
1001 01c5 1c0001 addw x,#1
1002 01c8 a30000 cpw x,#0
1003 01cb 26f1 jrne L573
1004 01cd L763:
1007 01cd 1e01 ldw x,(OFST-3,sp)
1008 01cf 1d0001 subw x,#1
1009 01d2 1f01 ldw (OFST-3,sp),x
1010 01d4 1c0001 addw x,#1
1011 01d7 a30000 cpw x,#0
1012 01da 26e2 jrne L573
1013 ; 29 }
1016 01dc 5b04 addw sp,#4
1017 01de 81 ret
1020 bsct
1021 0000 _nian:
1022 0000 000007dc dc.l 2012
1023 0004 _yue:
1024 0004 0c dc.b 12
1025 0005 _ri:
1026 0005 0c dc.b 12
1027 0006 _shi:
1028 0006 0c dc.b 12
1029 0007 _fen:
1030 0007 0c dc.b 12
1031 0008 _hour:
1032 0008 0c dc.b 12
1033 0009 _min:
1034 0009 0d dc.b 13
1075 .const: section .text
1076 0000 L04:
1077 0000 00000064 dc.l 100
1078 0004 L24:
1079 0004 00000190 dc.l 400
1080 0008 L44:
1081 0008 000003e8 dc.l 1000
1082 000c L64:
1083 000c 0000000a dc.l 10
1084 ; 35 @far @interrupt void Time2YiChu (void)
1084 ; 36 {
1085 scross on
1086 switch .text
1087 01df f_Time2YiChu:
1089 01df 3b0002 push c_x+2
1090 01e2 be00 ldw x,c_x
1091 01e4 89 pushw x
1092 01e5 3b0002 push c_y+2
1093 01e8 be00 ldw x,c_y
1094 01ea 89 pushw x
1095 01eb be02 ldw x,c_lreg+2
1096 01ed 89 pushw x
1097 01ee be00 ldw x,c_lreg
1098 01f0 89 pushw x
1101 ; 38 miao++;
1103 01f1 3c02 inc _miao
1104 ; 39 if(miao==60)
1106 01f3 b602 ld a,_miao
1107 01f5 a13c cp a,#60
1108 01f7 2604 jrne L114
1109 ; 40 {miao=0;
1111 01f9 3f02 clr _miao
1112 ; 41 fen++;
1114 01fb 3c07 inc _fen
1115 01fd L114:
1116 ; 43 if(fen==60)
1118 01fd b607 ld a,_fen
1119 01ff a13c cp a,#60
1120 0201 2604 jrne L314
1121 ; 44 {fen=0;
1123 0203 3f07 clr _fen
1124 ; 45 shi++;
1126 0205 3c06 inc _shi
1127 0207 L314:
1128 ; 47 if(shi==24)
1130 0207 b606 ld a,_shi
1131 0209 a118 cp a,#24
1132 020b 2604 jrne L514
1133 ; 48 {shi=0;
1135 020d 3f06 clr _shi
1136 ; 49 ri++;
1138 020f 3c05 inc _ri
1139 0211 L514:
1140 ; 51 if(yue==0||yue==1||yue==3||yue==5||yue==7||yue==8||yue==10||yue==12)
1142 0211 3d04 tnz _yue
1143 0213 272a jreq L124
1145 0215 b604 ld a,_yue
1146 0217 a101 cp a,#1
1147 0219 2724 jreq L124
1149 021b b604 ld a,_yue
1150 021d a103 cp a,#3
1151 021f 271e jreq L124
1153 0221 b604 ld a,_yue
1154 0223 a105 cp a,#5
1155 0225 2718 jreq L124
1157 0227 b604 ld a,_yue
1158 0229 a107 cp a,#7
1159 022b 2712 jreq L124
1161 022d b604 ld a,_yue
1162 022f a108 cp a,#8
1163 0231 270c jreq L124
1165 0233 b604 ld a,_yue
1166 0235 a10a cp a,#10
1167 0237 2706 jreq L124
1169 0239 b604 ld a,_yue
1170 023b a10c cp a,#12
1171 023d 261e jrne L714
1172 023f L124:
1173 ; 52 {if(ri==32)
1175 023f b605 ld a,_ri
1176 0241 a120 cp a,#32
1177 0243 2606 jrne L734
1178 ; 53 {ri=1;
1180 0245 35010005 mov _ri,#1
1181 ; 54 yue++;
1183 0249 3c04 inc _yue
1184 024b L734:
1185 ; 56 if(yue==13)
1187 024b b604 ld a,_yue
1188 024d a10d cp a,#13
1189 024f 260c jrne L714
1190 ; 57 {yue=1;
1192 0251 35010004 mov _yue,#1
1193 ; 58 nian++;
1195 0255 ae0000 ldw x,#_nian
1196 0258 a601 ld a,#1
1197 025a cd0000 call c_lgadc
1199 025d L714:
1200 ; 62 if(yue==4||yue==6||yue==9||yue==11)
1202 025d b604 ld a,_yue
1203 025f a104 cp a,#4
1204 0261 2712 jreq L544
1206 0263 b604 ld a,_yue
1207 0265 a106 cp a,#6
1208 0267 270c jreq L544
1210 0269 b604 ld a,_yue
1211 026b a109 cp a,#9
1212 026d 2706 jreq L544
1214 026f b604 ld a,_yue
1215 0271 a10b cp a,#11
1216 0273 261e jrne L344
1217 0275 L544:
1218 ; 63 {if(ri==31)
1220 0275 b605 ld a,_ri
1221 0277 a11f cp a,#31
1222 0279 2606 jrne L354
1223 ; 64 {ri=1;
1225 027b 35010005 mov _ri,#1
1226 ; 65 yue++;
1228 027f 3c04 inc _yue
1229 0281 L354:
1230 ; 67 if(yue==13)
1232 0281 b604 ld a,_yue
1233 0283 a10d cp a,#13
1234 0285 260c jrne L344
1235 ; 68 {yue=1;
1237 0287 35010004 mov _yue,#1
1238 ; 69 nian++;
1240 028b ae0000 ldw x,#_nian
1241 028e a601 ld a,#1
1242 0290 cd0000 call c_lgadc
1244 0293 L344:
1245 ; 72 if(nian%4==0&&nian%100!=0||nian%400==0)
1247 0293 b603 ld a,_nian+3
1248 0295 a503 bcp a,#3
1249 0297 2611 jrne L364
1251 0299 ae0000 ldw x,#_nian
1252 029c cd0000 call c_ltor
1254 029f ae0000 ldw x,#L04
1255 02a2 cd0000 call c_lumd
1257 02a5 cd0000 call c_lrzmp
1259 02a8 2611 jrne L164
1260 02aa L364:
1262 02aa ae0000 ldw x,#_nian
1263 02ad cd0000 call c_ltor
1265 02b0 ae0004 ldw x,#L24
1266 02b3 cd0000 call c_lumd
1268 02b6 cd0000 call c_lrzmp
1270 02b9 2614 jrne L754
1271 02bb L164:
1272 ; 73 {if(yue==2&&ri==30)
1274 02bb b604 ld a,_yue
1275 02bd a102 cp a,#2
1276 02bf 2620 jrne L764
1278 02c1 b605 ld a,_ri
1279 02c3 a11e cp a,#30
1280 02c5 261a jrne L764
1281 ; 75 ri=1;
1283 02c7 35010005 mov _ri,#1
1284 ; 76 yue++;
1286 02cb 3c04 inc _yue
1287 02cd 2012 jra L764
1288 02cf L754:
1289 ; 80 else if(yue==2&&ri==29)
1291 02cf b604 ld a,_yue
1292 02d1 a102 cp a,#2
1293 02d3 260c jrne L764
1295 02d5 b605 ld a,_ri
1296 02d7 a11d cp a,#29
1297 02d9 2606 jrne L764
1298 ; 82 ri=1;
1300 02db 35010005 mov _ri,#1
1301 ; 83 yue++;
1303 02df 3c04 inc _yue
1304 02e1 L764:
1305 ; 88 time=nian;//年
1307 02e1 be02 ldw x,_nian+2
1308 02e3 bf05 ldw _time+2,x
1309 02e5 be00 ldw x,_nian
1310 02e7 bf03 ldw _time,x
1311 ; 89 lcd162a_DispOneChar(1,1,'2');
1313 02e9 4b32 push #50
1314 02eb ae0001 ldw x,#1
1315 02ee a601 ld a,#1
1316 02f0 95 ld xh,a
1317 02f1 cd0056 call _lcd162a_DispOneChar
1319 02f4 84 pop a
1320 ; 90 lcd162a_DispOneChar(1,2,'0');
1322 02f5 4b30 push #48
1323 02f7 ae0002 ldw x,#2
1324 02fa a601 ld a,#1
1325 02fc 95 ld xh,a
1326 02fd cd0056 call _lcd162a_DispOneChar
1328 0300 84 pop a
1329 ; 91 if(i==1)
1331 0301 b601 ld a,_i
1332 0303 a101 cp a,#1
1333 0305 266e jrne L374
1334 ; 93 lcd162a_DispOneChar(1,3,32);
1336 0307 4b20 push #32
1337 0309 ae0003 ldw x,#3
1338 030c a601 ld a,#1
1339 030e 95 ld xh,a
1340 030f cd0056 call _lcd162a_DispOneChar
1342 0312 84 pop a
1343 ; 94 lcd162a_DispOneChar(1,4,32);
1345 0313 4b20 push #32
1346 0315 ae0004 ldw x,#4
1347 0318 a601 ld a,#1
1348 031a 95 ld xh,a
1349 031b cd0056 call _lcd162a_DispOneChar
1351 031e 84 pop a
1352 ; 95 delay_ms(200);
1354 031f ae00c8 ldw x,#200
1355 0322 cd0000 call _delay_ms
1357 ; 96 lcd162a_DispOneChar(1,3,48+(u8)(((time%1000)%100)/10));
1359 0325 ae0003 ldw x,#_time
1360 0328 cd0000 call c_ltor
1362 032b ae0008 ldw x,#L44
1363 032e cd0000 call c_lumd
1365 0331 ae0000 ldw x,#L04
1366 0334 cd0000 call c_lumd
1368 0337 ae000c ldw x,#L64
1369 033a cd0000 call c_ludv
1371 033d b603 ld a,c_lreg+3
1372 033f ab30 add a,#48
1373 0341 88 push a
1374 0342 ae0003 ldw x,#3
1375 0345 a601 ld a,#1
1376 0347 95 ld xh,a
1377 0348 cd0056 call _lcd162a_DispOneChar
1379 034b 84 pop a
1380 ; 97 lcd162a_DispOneChar(1,4,48+(u8)(((time%1000)%100)%10));
1382 034c ae0003 ldw x,#_time
1383 034f cd0000 call c_ltor
1385 0352 ae0008 ldw x,#L44
1386 0355 cd0000 call c_lumd
1388 0358 ae0000 ldw x,#L04
1389 035b cd0000 call c_lumd
1391 035e ae000c ldw x,#L64
1392 0361 cd0000 call c_lumd
1394 0364 b603 ld a,c_lreg+3
1395 0366 ab30 add a,#48
1396 0368 88 push a
1397 0369 ae0004 ldw x,#4
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -