版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
.純?yōu)閭€人思路,無特殊,驚人語句….初學(xué)完的;程序功能:最原始簡單版俄羅斯方塊;硬件連接:接雙色點(diǎn)陣;晶振型號:12M;單片機(jī):STC89C52;編寫時間:;編程人:HANGBITP2.0;點(diǎn)陣行輸入HWBITP2.1HZBITP2.2LIEBITP2.3;點(diǎn)陣列輸入LWBITP2.4LZBITP2.5WEIBITP2.6DUANBITP2.7XIANEQUP1BiaoXBIT20H.0Biao_zBIT20H.1;按鍵是否按下標(biāo)志Biao_yBIT20H.2Biao_xBIT20H.3Dou_zBIT20H.4;按鍵相應(yīng)標(biāo)志位Ying_zBIT20H.5.Dou_yBIT20H.6Ying_yBIT20H.7Dou_xBIT21H.0Ying_xBIT21H.1Biao_ZYBIT21H.2Biao_ztBIT21H.3;開始、暫停標(biāo)志KEY_zBITP0.0;左、右、旋轉(zhuǎn)按鍵KEY_yBITP0.1KEY_xBITP0.2ORG0000HAJMPStartORG0003HAJMPInt0_serORG000BHAJMPT0_serORG0030H;*************************Start:MOVR0,#08HMOVR1,#51HMOVR3,#03HMOVR4,#08H.//MOV46H,#99MOV40H,#03HMOV30H,#0FEHMOV33H,#0FEHMOV37H,#80HMOVTMOD,#01HMOVTH0,#(65536-10000)/256MOVTL0,#(65536-10000)MOD256SETBEASETBEX0SETBET0SETBIT0SETBTR0;*****************************Main:CALLZhanting;暫停響應(yīng)CALLXianshi;點(diǎn)陣顯示CALLCMkey_z;左移按鍵CALLCMkey_y;右移按鍵CALLCMkey_x;旋轉(zhuǎn)按鍵CALLPanduan_z;判斷是否可以左移CALLPanduan_y;判斷是否可以右移.CALLPanduan_x;判斷是否可以旋轉(zhuǎn)CALLPanduan_xia;判斷是否可以下移CALLPanduan_xh;判斷消行CALLSaomiao_xh;掃描消行CALLJifen;計(jì)算分值CALLJifenXianshi;分值顯示ORLPCON,#01HAJMPMain;*****************************Zhanting:JBBiao_zt,Out_zt;判斷是否暫停Zhanti:MOVA,37H;顯示STARTRLCAMOV37H,AMOVLIE,CCLRLWSETBLWDJNZR0,ZhantiMOVR0,#08HCLRLZSETBLZ.MOV A,37HRLC ARR AMOV 37H,AZhan:SETB HANGCLR HWSETB HWDJNZ R0,ZhanMOV R0,#08HMOVA,38HINC38HMOVDPTR,#TABZMOVCA,@A+DPTRMOV39H,AZhant:MOVA,39HRLCAMOV39H,AMOVHANG,C.CLR
HWSETB
HWDJNZ
R0,ZhantMOV
R0,#08HCLRSETBCALLCALL
HZHZDelayDelayQing:SETBCLRSETBDJNZMOV
HANGHWHWR0,QingR0,#08HQing1:SETBCLRSETBDJNZMOV
HANGHWHWR0,Qing1R0,#08HCLR
HZSETB
HZ.DJNZR4,ZhantiMOVR4,#08HCLRCYMOVA,38HSUBBA,#08HMOV38H,A//MOV38H,#00HMOVA,44HMOV34H,#00HCJNEA,#10,ZhantingINC38HMOV44H,#00HMOVA,38HCJNEA,#31,ZhantingMOV38H,#00HAJMPZhantingOut_zt:RET;*****************************謝謝閱讀Xianshi: ;移動積木顯示SETB HANG.CLRSETBDJNZMOV
HWHWR0,XianshiR0,#08HLoop:MOV
A,30HRLC
AMOVMOV
30H,AHANG,CCLRSETBDJNZMOV
HWHWR0,LoopR0,#08HCLRSETB
HZHZMOV
A,30HRLCRL
AAMOV
30H,ACALL XingzMOV A,31H.INC 31HMOVCA,@A+DPTRMOV 32H,ACALL HengyiLoop1:MOV A,32HRLC AMOV 32H,AMOV LIE,CCLR LWSETB LWDJNZ R0,Loop1MOV R0,#08HCLR LZSETB LZCALL DelayCALL QingpingBeijing: ;背景顯示SETB HANGCLR HWSETB HW.DJNZMOV
R0,BeijingR0,#08HLoop3:MOV
A,33HRLC
AMOVMOV
33H,AHANG,CCLRSETBDJNZMOV
HWHWR0,Loop3R0,#08HCLRSETB
HZHZMOV
A,33HRLCRL
AAMOV
33H,AMOV A,@R1MOV 50H,ALoop2:MOV A,50H.RLC
AMOVMOV
50H,ALIE,CCLRSETBDJNZMOV
LWLWR0,Loop2R0,#08HINCCLRSETBCALLCALLCJNEMOVMOV
R1LZLZDelayQingpingR1,#59H,Xianshi0R1,#51H31H,#00HRETXianshi0:AJMP
Xianshi;************
確認(rèn)顯示形狀Xingz:MOVCJNE
A,40HA,#0,S1.MOV DPTR,#TAB0RETS1:CJNE A,#1,S2CALL Xuanz1RETS2:CJNE A,#2,S3CALL Xuanz2RETS3:CJNE A,#3,S4CALL Xuanz3RETS4:CJNE A,#4,S5CALL Xuanz4RETS5:CJNE A,#5,S6CALL Xuanz5RETS6:CALL Xuanz6RETXuanz1:MOV A,41HCJNE A,#0,Xu1.MOV DPTR,#TAB1RETXu1:CJNE A,#2,Zhuan1MOV DPTR,#TAB1RETZhuan1:MOV DPTR,#TAB1_1RETXuanz2:MOV A,41HCJNE A,#0,Zhuan2_1MOV DPTR,#TAB2RETZhuan2_1:CJNE A,#1,Zhuan2_2MOV DPTR,#TAB2_1RETZhuan2_2:CJNE A,#2,Zhuan2_3MOV DPTR,#TAB2_2RETZhuan2_3:.MOV
DPTR,#TAB2_3RETXuanz3:MOVCJNEMOV
A,41HA,#0,Zhuan3_1DPTR,#TAB3RETZhuan3_1:CJNEMOV
A,#1,Zhuan3_2DPTR,#TAB3_1RETZhuan3_2:CJNEMOV
A,#2,Zhuan3_3DPTR,#TAB3_2RETZhuan3_3:MOV
DPTR,#TAB3_3RETXuanz4:MOVCJNEMOV
A,41HA,#0,Zhuan4_1DPTR,#TAB4.RETZhuan4_1:CJNE A,#1,Zhuan4_2MOV DPTR,#TAB4_1RETZhuan4_2:CJNE A,#2,Zhuan4_3MOV DPTR,#TAB4_2RETZhuan4_3:MOV DPTR,#TAB4_3RETXuanz5:MOV A,41HCJNE A,#0,Zhuan5_1MOV DPTR,#TAB5RETZhuan5_1:CJNE A,#2,Zhuan5_2MOV DPTR,#TAB5RETZhuan5_2:.MOV
DPTR,#TAB5_1RETXuanz6:MOVCJNEMOV
A,41HA,#0,Zhuan6_1DPTR,#TAB6RETZhuan6_1:CJNEMOV
A,#2,Zhuan6_2DPTR,#TAB6RETZhuan6_2:MOV
DPTR,#TAB6_1RET;************
確認(rèn)左右移動Hengyi:CJNE
R3,#03H,H1RETH1:MOV
A,32HRLCJNEAJMP
AR3,#02H,H2OUT1.H2:RLCJNEAJMPH3:RLCJNEAJMPH4:MOV
AR3,#01H,H3OUT1AR3,#00H,H4OUT1A,32HRRCJNEAJMPH5:RRCJNEAJMPH6:RRCJNEAJMPH7:RR
AR3,#04H,H5OUT1AR3,#05H,H6OUT1AR3,#06H,H7OUT1AOUT1:MOV
32H,ARET;*****************************左移按鍵謝謝閱讀CMkey_z:.JBJBSETB
KEY_z,Loopz0Dou_z,Loopz2Dou_zRETLoopz2:INCJBSETBSETB
42HYing_z,OutzYing_zBiao_zRETLoopz0:CLRCLR
Dou_zYing_zOutz:RET;***************************** 右移按鍵精品文檔放心下載CMkey_y:JBJBSETB
KEY_y,Loopy0Dou_y,Loopy2Dou_yRETLoopy2:.INCJBSETBSETB
42HYing_y,OutyYing_yBiao_yRETLoopy0:CLRCLR
Dou_yYing_yOuty:RET;***************************** 旋轉(zhuǎn)按鍵謝謝閱讀CMkey_x:JBJBSETB
KEY_x,Loopx0Dou_x,Loopx2Dou_xRETLoopx2:INCJBSETBSETB
42HYing_x,OutxYing_xBiao_xRET.Loopx0:CLR Dou_xCLR Ying_xOutx:RET;*****************************左移防沖突謝謝閱讀Panduan_z:JBC
Biao_z,ZuoyiRETZuoyi:SETBCALLMOVJBCALLMOVJBCALLMOVJBMOV
Biao_ZYHangyiA,36HACC.7,YesZuoHangerA,36HACC.7,YesZuoHangsanA,36HACC.7,YesZuo45H,R3
;已到邊上,不用移動DEC
R3.MOVCJNEAJMP
A,35HA,#0,Zuo_0YesZuo
;防移動沖突背景Zuo_0:CJNEAJMP
A,#1,Zuo_1YesZuoZuo_1:CJNECALLAJMP
A,#2,Zuo_2Xuan_1YesZuoZuo_2:CJNECALLAJMP
A,#3,Zuo_3Xuan_2YesZuoZuo_3:CJNECALLAJMP
A,#4,Zuo_4Xuan_3YesZuoZuo_4:CJNECALLAJMP
A,#5,Zuo_5Xuan_4YesZuo.Zuo_5:CALL Xuan_5YesZuo:RET;*****************************謝謝閱讀Panduan_y:JBC Biao_y,YouyiRETYouyi:SETB Biao_ZYCALL HangyiMOV A,36HJB ACC.0,YesyouCALL HangerMOV A,36HJB ACC.0,YesyouCALL HangsiMOV A,36HJB ACC.0,YesyouMOV 45H,R3INC R3MOV A,35H
右移防沖突;已到邊上.CJNEAJMP
A,#0,You_0Yesyou
;防右移沖突背景You_0:CJNEAJMP
A,#1,You_1YesyouYou_1:CJNECALLAJMP
A,#2,You_2Xuan_1YesyouYou_2:CJNECALLAJMP
A,#3,You_3Xuan_2YesyouYou_3:CJNECALLAJMP
A,#4,You_4Xuan_3YesyouYou_4:CJNECALLAJMP
A,#5,You_5Xuan_4YesyouYou_5:.CALL Xuan_5Yesyou:RET;***************************** 旋轉(zhuǎn)防沖突謝謝閱讀Panduan_x:JBC Biao_x,XuanzhuanRETXuanzhuan: ;方形不用旋轉(zhuǎn)MOV A,40HCJNE A,#0,BieRETBie:MOVA,35HCJNEA,#0,PanyiRETPanyi:MOV43H,41HINC41HMOVA,40HCJNEA,#1,NoyiMOVA,35HCJNEA,#1,Xuanyi.MOV
41H,43HRETXuanyi:MOVCJNEAJMP
A,41HA,#1,Yi_1Yi_h
;一字型防出邊界Yi_1:CJNEAJMP
A,#3,Yi_sYi_hYi_s:
;一字型防沖突背景CALLMOVANLCJNE
HangyiA,36HA,#83HA,#0,NoxuanYi_h:MOVCJNECALLCALL
A,35HA,#2,Yi_h2Xuan_1YesxuanRETYi_h2:MOV
A,35H.CJNE A,#3,Yi_h3CALL Xuan_2CALL YesxuanRETYi_h3:MOV A,35HCJNE A,#4,Yi_h4CALL Xuan_3CALL YesxuanRETYi_h4:MOV A,35HCJNE A,#5,Yi_h5CALL Xuan_4CALL HangsiMOV A,36HANL A,54HCJNE A,#0,NoxuanCALL YesxuanRETYi_h5:CALL Xuan_5.CALLMOVANLCJNECALL
HangsiA,36HA,55HA,#0,NoxuanYesxuanRETNoyi:
;另外五種變形防出邊界沖突背景CALLMOVCJNECALL
YouchuA,35HA,#1,Xuanzh1YesxuanRETXuanzh1:
;防沖突背景CJNECALLCALL
A,#2,Xuanzh2Xuan_1YesxuanRETXuanzh2:CJNECALLCALL
A,#3,Xuanzh3Xuan_2YesxuanRET.Xuanzh3:CJNE A,#4,Xuanzh4CALL Xuan_3CALL YesxuanRETXuanzh4:CJNE A,#5,Xuanzh5CALL Xuan_4CALL YesxuanRETXuanzh5:CALL Xuan_5Yesxuan:MOV A,41HCJNE A,#4,OutqMOV 41H,#00HOutq:RETNoxuan:MOV 41H,43HRET.Youchu:;防右出邊界子程序CALLHangyiMOVA,36HJBACC.0,NoxuanCALLHangerMOVA,36HJBACC.0,NoxuanCALLHangsanMOVA,36HJBACC.0,NoxuanRETXuan_1:;防沖突子程序CALLHangyiMOVA,36HANLA,54HCJNEA,#0,No_zyxRETXuan_2:CALLHangyiMOVA,36HANLA,55H.CJNECALLMOVANLCJNE
A,#0,No_zyxHangerA,36HA,54HA,#0,No_zyxRETXuan_3:CALLMOVANLCJNECALLMOVANLCJNECALLMOVANLCJNE
HangyiA,36HA,56HA,#0,No_zyxHangerA,36HA,55HA,#0,No_zyxHangerA,36HA,54HA,#0,No_zyxRETXuan_4:CALL
Hangyi.MOVANLCJNECALLMOVANLCJNECALLMOVANLCJNE
A,36HA,57HA,#0,No_zyxHangerA,36HA,56HA,#0,No_zyxHangerA,36HA,55HA,#0,No_zyxRETXuan_5:CALLMOVANLCJNECALLMOVANLCJNECALL
HangyiA,36HA,58HA,#0,No_zyxHangerA,36HA,57HA,#0,No_zyxHanger.MOVANLCJNE
A,36HA,56HA,#0,No_zyxRETNo_zyx:JBC
Biao_ZY,No_zNo_x:AJMP
Noxuan
;旋轉(zhuǎn)沖突背景No_z:MOV
R3,45H
;左、右沖突背景RET;*****************************一秒下移子程序感謝閱讀Panduan_xia:MOVA,34HCJNEA,#100,Out_xMOV34H,#00HMOVA,30HRLAMOV30H,AINC35HOut_x:RET.;*****************************判斷是否可下移謝謝閱讀Panduan_xh:MOV A,35HCJNE A,#00H,X1RETX1:CJNE A,#01H,X2CALL XH1RETX2:CJNE A,#02H,X3CALL XH2RETX3:CJNE A,#03H,X4CALL XH3RETX4:CJNE A,#04H,X5CALL XH4RETX5:CJNE A,#05,X6CALL XH5RETX6:CALL XH6RET.;************XH1:CALLMOVANLCJNE
HangyiA,36HA,54HA,#0,WanRETXH2:CALLMOVANLCJNECALLMOVANLCJNE
HangyiA,36HA,55HA,#0,WanHangerA,36HA,54HA,#0,WanRETWan:
;游戲結(jié)束AJMP
$XH3:
;防下移沖突背景子程序CALLMOV
HangyiA,36H.ANLA,56HCJNEA,#0,Noxia3CALLHangerMOVA,36HANLA,55HCJNEA,#0,Noxia3CALLHangsanMOVA,36HANLA,54HCJNEA,#0,WanRETNoxia3:CALLHangsanMOVA,36HCJNEA,#0,WanCALLHangyiMOVA,36HORLA,55HMOV55H,ACALLHangerMOVA,36HORLA,54H.MOVCALL
54H,ASMHang;掃描行RETXH4:CALLMOVANLCJNECALLMOVANLCJNECALLMOVANLCJNE
HangyiA,36HA,57HA,#0,Noxia4HangerA,36HA,56HA,#0,Noxia4HangsanA,36HA,55HA,#0,Noxia4RETNoxia4:CALLMOVCJNECALL
HangsiA,36HA,#0,WanHangyi.MOVA,36HORLA,56HMOV56H,ACALLHangerMOVA,36HORLA,55HMOV55H,ACALLHangsanMOVA,36HORLA,54HMOV54H,ACALLSMHang;掃描行RETXH5:CALLHangyiMOVA,36HANLA,58HCJNEA,#0,Noxia5CALLHangerMOVA,36HANLA,57HCJNEA,#0,Noxia5.CALLHangsanMOVA,36HANLA,56HCJNEA,#0,Noxia5RETNoxia5:CALLHangyiMOVA,36HORLA,57HMOV57H,ACALLHangerMOVA,36HORLA,56HMOV56H,ACALLHangsanMOVA,36HORLA,55HMOV55H,ACALLHangsiMOVA,36HORLA,54HMOV54H,A.CALLSMHang;掃描行RETXH6:CALLHangyiMOVA,36HORLA,58HMOV58H,ACALLHangerMOVA,36HORLA,57HMOV57H,ACALLHangsanMOVA,36HORLA,56HMOV56H,ACALLHangsiMOVA,36HORLA,55HMOV55H,ACALLSMHang;掃描行RET.SMHang:SETB BiaoXMOV 30H,#0FEHMOV 31H,#00HMOV 34H,#00HMOV 35H,#00HRET;************Hangyi:CALL XingzMOV A,#01HMOVCA,@A+DPTRMOV 32H,ACALL HengyiMOV 36H,32HRETHanger:CALL XingzMOV A,#00HMOVCA,@A+DPTRMOV 32H,ACALL Hengyi
;積木停止,出新積木.MOV
36H,32HRETHangsan:CALLMOVMOVCMOVCALLMOV
XingzA,#07HA,@A+DPTR32H,AHengyi36H,32HRETHangsi:CALLMOVMOVCMOVCALLMOV
XingzA,#06HA,@A+DPTR32H,AHengyi36H,32HRET;*****************************掃描是否消行謝謝閱讀Saomiao_xh:JBC BiaoX,SaomiaoRET.Saomiao:MOV41H,#00H;消行MOVR3,#03HMOVA,42HMOVB,#07HDIVABMOV40H,BMOVA,54HCJNEA,#0FFH,Sao1MOV54H,#00HINCR5Sao1:MOVA,55HCJNEA,#0FFH,Sao2MOV55H,54HMOV54H,#00HINCR5Sao2:MOVA,56HCJNEA,#0FFH,Sao3MOV56H,55HMOV55H,54H.MOV54H,#00HINCR5Sao3:MOVA,57HCJNEA,#0FFH,Sao4MOV57H,56HMOV56H,55HMOV55H,54HMOV54H,#00HINCR5Sao4:MOVA,58HCJNEA,#0FFH,Sao5MOV58H,57HMOV57H,56HMOV56H,55HMOV55H,54HMOV54H,#00HINCR5Sao5:RET;*****************************消行記分感謝閱讀.Jifen:CJNE R5,#0,Jia1RETJia1:MOV A,R5MOV R5,#00HCJNE A,#1,Jia2INC 46HRETJia2:CJNE A,#2,Jia3MOV A,#3ADD A,46HMOV 46H,ARETJia3:CJNE A,#3,Jia4MOV A,#7ADD A,46HMOV 46H,ARETJia4:.MOV A,#10ADD A,46HMOV 46H,ARET;*****************************得分顯示謝謝閱讀JifenXianshi:MOV XIAN,#0BFHSETB WEICLR WEIMOV A,46HMOV B,#10DIV ABMOV DPTR,#TABMOVCA,@A+DPTRMOV XIAN,ASETB DUANCLR DUANCALL DelayMOV XIAN,#7FHSETB WEICLR WEIMOV A,B.MOVC A,@A+DPTRMOV XIAN,ASETB DUANCLR DUANCALL DelayMOV XIAN,#0FFHSETB WEICLR WEIRET;***************************** 暫停標(biāo)志位感謝閱讀Int0_ser:CPL Biao_ztRETI;***************************** 定時計(jì)數(shù),并出隨機(jī)數(shù)謝謝閱讀T0_ser:MOVTH0,#(65536-10000)/256MOVTL0,#(65536-10000)MOD256INC34HINC42HINC44HRETI;***************************** 清屏子程序精品文檔放心下載.Qingping:CLR LIECLR LWSETB LWDJNZ R0,QingpingMOV R0,#08HCLR LZSETB LZ;***************************** 延時子程序精品文檔放心下載RET;***************************** 隨機(jī)積木7類型謝謝閱讀TAB0:DB18H,18H,00H,00H,00H,00H,00H,00H感謝閱讀TAB1:DB00H,3CH,00H,00H,00H,00H,00H,00H謝謝閱讀TAB1_1:
;田字型;一字型.DB10H,10H,00H,00H,00H,00H,10H,10H感謝閱讀TAB2:DB38H,20H,00H,00H,00H,00H,00H,00H謝謝閱讀
;L
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 二零二五版食堂泔水處理與環(huán)保設(shè)備銷售合同2篇
- 2025年度電子商務(wù)平臺承包招商合同范本3篇
- 二零二五版大棚租賃合同綠色環(huán)保附加條款3篇
- 2025年度安全生產(chǎn)風(fēng)險評估與管理合同集3篇
- 年度鈷基及鈷鎳基競爭策略分析報告
- 2025年暑期實(shí)習(xí)崗位勞動合同范本3篇
- 2025年度專業(yè)舞臺搭建租賃合同3篇
- 2024-2025學(xué)年高中歷史課時分層作業(yè)十二5.1科學(xué)社會主義的奠基人馬克思含解析新人教版選修4
- 2025年度環(huán)保節(jié)能零星工程設(shè)計(jì)與施工一體化合同4篇
- 2025年度現(xiàn)代農(nóng)業(yè)示范區(qū)農(nóng)資集成采購合同3篇
- 農(nóng)用地土壤環(huán)境質(zhì)量類別劃分技術(shù)指南(試行)(環(huán)辦土壤2017第97號)
- 反向開票政策解讀課件
- 工程周工作計(jì)劃
- 房地產(chǎn)銷售任務(wù)及激勵制度
- 六年級語文下冊14文言文二則《學(xué)弈》課件
- 2024年內(nèi)蒙古中考語文試卷五套合卷附答案
- 并購指南(如何發(fā)現(xiàn)好公司)
- 垃圾分類亭合同協(xié)議書
- 物權(quán)轉(zhuǎn)移協(xié)議
- 高三高考地理一輪課時練習(xí):洋流(單選題)
- 2024年餐飲類“食品安全及質(zhì)量管理員”知識考試題庫(附含答案)
評論
0/150
提交評論