?? ex1a.asm
字號:
;= ex1a.asm ====================================================================
;
; Copyright (C) 2003, 2004 Nordic Semiconductor
;
; This file is distributed in the hope that it will be useful, but WITHOUT
; WARRANTY OF ANY KIND.
;
; Author(s): Ole Saether
;
; DESCRIPTION:
;
; Hello World program.
;
; The functionality is the same as in ex1c.c.
;
; ASSEMBLER:
;
; You need as31.exe to assemble this program. It can be downloaded from this
; web page: http://www.pjrc.com/tech/8051/
;
; $Revision: 4 $
;
;===============================================================================
.equ CKCON, 0x8e
.equ P0_DIR, 0x94
.equ P0_ALT, 0x95
.equ P1_ALT, 0x97
.equ CK_CTRL, 0xb6
ljmp start
start: mov TH1, #243 ; 19200@16MHz (when T1M=1 and SMOD=1)
orl CKCON, #0x10 ; T1M=1 (/4 timer clock)
mov PCON, #0x80 ; SMOD=1 (double baud rate)
mov SCON, #0x52 ; Serial mode1, enable receiver
mov TMOD, #0x20 ; Timer1 8bit auto reload
setb TR1 ; Start timer1
orl P0_DIR, #0x02 ; P0.1 (RxD) is an input
orl P0_ALT, #0x06 ; Alternate functions on pins P0.1 and P0.2
mov dptr, #msg
acall puts
loop: ajmp loop
puts: mov a, #0
movc a, @a+dptr
jz puts2
acall putc
inc dptr
ajmp puts
puts2: ret
putc: jnb TI, putc
clr TI
mov SBUF, A
ret
msg: .db "Hello World!\n", 0
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -