main.asm

来自「这是一个关于单片机的led的程序」· 汇编 代码 · 共 43 行

ASM
43
字号
;*****************************************************************
;* This stationery serves as the framework for a                 *
;* user application (single file, absolute assembly application) *
;* For a more comprehensive program that                         *
;* demonstrates the more advanced functionality of this          *
;* processor, please see the demonstration applications          *
;* located in the examples subdirectory of the                   *
;* Metrowerks CodeWarrior for the HC12 Program directory         *
;*****************************************************************

; export symbols
            XDEF Entry        ; export 'Entry' symbol
            ABSENTRY Entry    ; for absolute assembly: mark this as application entry point

; include derivative specific macros
            INCLUDE 'mc9s12dg128.inc'

ROMStart    EQU  $4000  ; absolute address to place code/constant data

; variable/data section
            ORG RAMStart
; Insert here your data definition. For demonstration, temp_byte is used.


; code section
            ORG ROMStart
Entry:
            CLI                ; enable interrupts

						MOVB  #$FF,DDRB		 ; set PORTB as output
						LDAA  PORTA				 ; read key status
						STAA  PORTB				 ; display the key status

            BRA Entry  ; endless loop


;**************************************************************
;*                 Interrupt Vectors                          *
;**************************************************************
  ORG $FFFE

  fdb     Entry      ; Reset

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?