📄 hc08sci.asm
字号:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;
; SCI String transfer program w/ <CR> marking end of string.
; Send a string, which was stored in EPROM and echo an input
; string from keyboard ( with <CR> marking end of string).
; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;
; File Name: HC08SCI.ASM Copyright (c) Motorola 1996 ;
; ;
; Current Revision: 1.40 ;
; Current Release Level: ES ;
; Current Revision Release Date: 01/04/96 ;
; ;
; Current Release Written By: Bobby Crouch ;
; Motorola CSIC Applications - Austin, Texas ;
; ;
; Assembled Under: IASM Ver. 3.03 ;
; ;
;
; ;
; Full Functional Description of Routine Purpose: ;
; This program has a main loop which checks for a button
; to be pressed in order to send a string stored in EPROM,
; "MC68HC708XL36 :", using <CR> as an end of string delimiter.
; The main loop also checks for a flag (CHAR) to be set which
; indicates a string has been received and the end of string
; delimiter <CR> has been received. After transmission,
; the program waits for SCI input. The MCU stores the
; incoming data in RAM and echoes the input when a <CR>
; is detected.
;
; The part uses SCI Receive interrupts and interrupt service
; routines to read and store the data in a RAM storage location.
; The ISR also tests each received byte for the end of string
; delimiter, <CR>. When <CR> is detected, the ISR sets a flag,
; 'CHAR', which the main loop is checking. The main loop, upon
; detecting the set flag, jumps to a subroutine (SCITRANS_SUB)
; which echoes the received string to the dumb terminal.
;
; The SCI module operates at 9600 BAUD, 8 bits, parity disabled.
;
; Part Family Software Routine Works With: HC08 ;
; ;
; Routine Size (Bytes): 480 (S19 FILE) ;
; Stack Space Used (Bytes):1 (H register) ;
; RAM Used (Bytes): 56 ;
; ;
; ;
; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;
; Update History: ;
; Rev: Author: Date: Description of Change: ;
; ---- ------- ----- ---------------------- ;
; ES 1.00 Crouch 09/01/94 Original Release ;
; ES 1.10 Chretien 10/07/94 1.In BBSCI4 line right after ;
; label EXIT changed $0D ;
; to #$0D ;
; 2.In BBSCI4 in subroutine ;
; SCIREC_SVR4 move the label ;
; LAST from the RTI opcode to ;
; the PULH opcode right above. ;
;ES 1.20 Crouch 04/06/95 1. Edited to compile w/ MASM ;
; ver 4.9 ;
; 2. Changed program name to ;
; 'SCI_CR.ASM' to agree with ;
; ORCAD schematic. ;
;ES1.30 Crouch 04/20/95 1. Edited code to conform with ;
; 'Software Coding Standards' ;
; ;
;ES1.40 Crouch 04 Jan 96 1. Edited for MCUASM 5.1 ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;
; Motorola reserves the right to make changes without further notice to any ;
; product herein to improve reliability, function, or design. Motorola does ;
; not assume any liability arising out of the application or use of any ;
; product, circuit, or software described herein; neither does it convey any ;
; license under its patent rights nor the rights of others. Motorola ;
; products are not designed, intended, or authorized for use as components ;
; in systems intended for surgical implant into the body, or other ;
; applications intended to support life, or for any other application in ;
; which the failure of the Motorola product could create a situation where ;
; personal injury or death may occur. Should Buyer purchase or use Motorola ;
; products for any such intended or unauthorized application, Buyer shall ;
; indemnify and hold Motorola and its officers, employees, subsidiaries, ;
; affiliates, and distributors harmless against all claims, costs, damages, ;
; and expenses, and reasonable attorney fees arising out of, directly or ;
; indirectly, any claim of personal injury or death associated with such ;
; unintended or unauthorized use, even if such claim alleges that Motorola ;
; was negligent regarding the design or manufacture of the part. Motorola ;
; and the Motorola Logo are registered trademarks of Motorola Inc. ;
; ;
; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;
; Part Specific Framework Includes Section ;
; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
INCLUDE "H708XL36.FRK"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;
; RAM Definitions for Main Routine ;
; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
org RAM ; Start of XL38 RAM.
CHAR: ds 1 ; Variable CHAR.
TIME: ds 1 ; Variable TIME.
TEMP: ds 2 ; Variable TEMP.
COUNT: ds 1 ; Variable COUNT.
REC: ds 50 ; Received string storage location.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;
; Program Initialization ;
; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
org EPROM ; Start of HC708XL36 EPROM ($6E00).
START: mov #$03,SCBR ; 9600 Baud.
mov #$40,SCC1 ; 8 Bits, SCI enabled.
mov #$2C,SCC2 ; Transmit enabled, receive
; -enabled, both IRQs enabled.
mov #$00,COUNT ; Clear variable COUNT.
mov #$00,CHAR ; Clear variable CHAR.
mov #$FF,DDRA ; Set Ports A,C,D,E,F
mov #$FE,DDRB ; -to all outputs and
mov #$FF,DDRC ; -set Port B to all outputs
mov #$FF,DDRD ; -except for PTB0, input.
mov #$FF,DDRE ;
mov #$FF,DDRF ;
cli ; Enable interrupts.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -