1 / 7

單元二

單元二. 基本 I/O 控制 ---LED 控制. 範例程式動作. P17. P16. P15. P14. P13. P12. P11. P10. 基本設定. 令 C=1. FEH→A. A→P1. A 左旋一位. 延遲. 範例程式動作. ORG 0 START: MOV R0, #0H DJNZ R0,$ MOV SP,#60H. SETB C. MOV A,#0FEH. AGAIN:. MOV P1,A. RLC A.

Download Presentation

單元二

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 單元二 基本I/O控制---LED控制

  2. 範例程式動作 P17 P16 P15 P14 P13 P12 P11 P10

  3. 基本設定 令C=1 FEH→A A→P1 A左旋一位 延遲 範例程式動作 ORG 0 START: MOVR0, #0H DJNZR0,$ MOVSP,#60H SETB C MOV A,#0FEH AGAIN: MOV P1,A RLC A ACALL DELAY AJMP AGAIN

  4. 旋轉指令-RLC 指令格式: RLC A 動作: 0 0 1 0 0 0 1 1 0 0 1 1 0 0 0 0 1 1 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 C 將進位旗號視為A的bit8,然後執行左移動作

  5. 旋轉指令-RL 指令格式: RL A 動作: 0 0 1 0 0 1 1 0 0 1 1 0 0 0 0 1 1 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 C 僅僅將A的8個位元做左移動作

  6. 實作程式動作 P17 P16 P15 P14 P13 P12 P11 P10

  7. END

More Related