当前位置:网站首页>Assembly led on

Assembly led on

2022-06-26 08:16:00 Ice leaf LV

@ Assembly lights up a LED

MCS-51 Single chip microcomputer

Maybe C Everyone knows language , But it is not necessary to use assembly language .
Use assembly language to light up a LED The lamp
Program :

			ORG 0000H
MAIN:
			CLR P2.0 
			LJMP MAIN
			END 

The notes are as follows :

ORG 0000H ;ORG It's a pseudo instruction , The corresponding machine code is not generated . Start address from 0000H Start .
MAIN: ;MAIN It's a label , Statement symbol address .
CLR P2.0 ;CLR It's a pseudo instruction , function : Zero clearing , hold P2.0 Register bit is cleared .
LJMP MAIN ;LJMP It's a pseudo instruction , function : Program jump instruction , Jump to the label MAIN Procedures section .
END ;END Is the assembly end directive , function : This instruction is used to terminate the source program assembly .

// Don't learn assembly , You will never understand how a program works at the bottom .

原网站

版权声明
本文为[Ice leaf LV]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202170601143402.html