📄 masm1.htm
字号:
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">T0_vector equ 000BH</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">T1_vector equ 001BH</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">S0_vector equ 0023H</p>
</font><font face="Arial" size=3>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"></p>
<font face="宋体" size=2>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">INIT: AJMP SETUP</p>
</font>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"></p>
<font face="宋体" size=2>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">;Interrept Jump Table</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> ORG X0_vector</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">INT_0: SETB P3.2</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> RETI ;int0 interrupt</p>
</font>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"></p>
<font face="宋体" size=2>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> ORG T0_vector</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">T0INT: ACALL TIM0 ;timer0 interrupt</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> RETI</p>
</font>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"></p>
<font face="宋体" size=2>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> ORG X1_vector</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">INT_1: SETB P3.3</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> RETI ;int1 interrupt</p>
</font>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"></p>
<font face="宋体" size=2>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> ORG T1_vector</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">T1INT: ACALL TIM1 ;timer1 interrupt</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> RETI</p>
</font>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"></p>
<font face="宋体" size=2>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> ORG S0_vector</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> AJMP SERIAL ;UART interrupt</p>
</font>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"></p>
<font face="宋体" size=2>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">DB 'This is demo program for MCS-51TM'</p>
</font>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"></p>
<font face="宋体" size=2>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">SETUP: MOV SP,#5FH ;set sp point</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> MOV TMOD,#11H ;set timer mode</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> MOV TH0,#HIGH(INIT_Timer0)</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> MOV TL0,#LOW(INIT_Timer0)</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> MOV TH1,#HIGH(INIT_Timer1)</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> MOV TL1,#LOW(INIT_Timer1)</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> SETB EX0</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> SETB PX0</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> SETB EX1</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> CLR PX1</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> SETB PT1</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> SETB ET0</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> SETB ET1</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> SETB TR0</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> SETB TR1</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> SETB ES</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> MOV SCON,#99H</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> SETB EA ;enable interrupt</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">WAIT: NOP</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> AJMP WAIT ;wait</p>
</font>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"></p>
<font face="宋体" size=2>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">SERIAL: NOP ;serial interrupt process</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> CLR RI</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> RETI</p>
</font>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"></p>
<font face="宋体" size=2>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">TIM0: CLR TR0 ;timer0 interrupt process</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> CPL T0_flag</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> MOV TL0,#LOW(INIT_Timer0)</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> MOV A,#HIGH(INIT_Timer0)</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> MOV TH0,A</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> SETB TR0</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> CLR P3.3</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> RET</p>
</font>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"></p>
<font face="宋体" size=2>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">TIM1: CLR TR1 ;timer1 interrupt process</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> CPL T1_flag</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> MOV TL1,#LOW(INIT_Timer1)</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> MOV A,#HIGH(INIT_Timer1)</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> MOV TH1,A</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> SETB TR1</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> CLR P3.2</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> RET</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> END</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">;********************************************************</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">;DEMO51.ASM FILE END</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">;********************************************************</p>
</font>
</font></i>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font face="宋体" lang="ZH-CN" size=2>以上是DEMO51.ASM源程序文件。</font></p>
<i><font face="宋体" size=2>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">The Cybernetic Micro Systems 8051 Family Assembler, Version
3.03 Page 1</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> 08-25-96</p>
</font><font face="Arial" size=3>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"></p>
</font><p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font face="Arial" size=3>
</font><font size=2 face="宋体">
</font></p>
<font face="宋体" size=2>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> 0000 = T0_flag bit 0</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> 0001 = T1_flag bit 1</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> FE80 = INIT_Timer0 equ 0FE80H</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> FD00 = INIT_Timer1 equ 0FD00H</p>
</font>
<font face="Arial" size=3>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"></p>
</font>
<font face="宋体" size=2>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> 0003 = X0_vector equ 0003H</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> 0013 = X1_vector equ 0013H</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> 000B = T0_vector equ 000BH</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> 001B = T1_vector equ 001BH</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> 0023 = S0_vector equ 0023H</p>
</font>
<font face="Arial" size=3>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"></p>
<font face="宋体" size=2>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> 0000 0146 INIT: AJMP SETUP</p>
</font>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"></p>
<font face="宋体" size=2>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> ;Interrept Jump Table</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> 0003 ORG X0_vector</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> 0003 D2B2 INT_0: SETB P3.2</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> 0005 32 RETI ;int0 interrupt</p>
</font>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"></p>
<font face="宋体" size=2>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> 000B ORG T0_vector</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> 000B 1178 T0INT: ACALL TIM0 ;timer0 interrupt</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> 000D 32 RETI</p>
</font>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"></p>
<font face="宋体" size=2>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> 0013 ORG X1_vector</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> 0013 D2B3 INT_1: SETB P3.3</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> 0015 32 RETI ;int1 interrupt</p>
</font>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"></p>
<font face="宋体" size=2>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> 001B ORG T1_vector</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> 001B 1188 T1INT: ACALL TIM1 ;timer1 interrupt</p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> 001D 32 RETI</p>
</font>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"></p>
<font face="宋体" size=2>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> 0023 ORG S0_vector</p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -