⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 termio.s43

📁 德州仪器(TI) 的超低功耗16 位RISC 混合信号处理器的MSP430 平台为电池供电的测量应用提供了最终解决方案。应用包括便携式医疗设备、低功耗工业操作、无线、实用计量等
💻 S43
字号:
/////////////////////////////////////////////////////////////////////
// Copyright 2002 IAR Systems.  All rights reserved.
// $Id: termio.s43 1.2 2003/02/04 09:42:37Z IASL Release andersl $

//
// Low-level terminal input/output interface to the C-Spy debugger.
//
// Provided functions:
//   __putchar
//   __getchar
//

//
// This file provides two different versions of the routines, one
// debug and one non-debug.
//
// The existence of a non-debug version of the modules ensures
// that a link-time error is produced when a application is linked
// in release mode (i.e. without using the -r linker option) and without
// overriding the IO promitives (e.g. __writechar).
//
// When an output file is produced by the linker, and it has several
// different modules providing the same label, it picks the one with
// a label on the form ?DBG_n or ?DBG_nT where "n" is the debug level
// used and the "T" variant is used when terminal IO is enabled using
// the -rt linker option.
//
// The ?C_xxx labels are recognized by the C-SPY debugger as special
// labels.
//


#include "macros.m43"
#include "cfi.m43"

        XCFI_NAMES libNames
        XCFI_COMMON libCommon, libNames


//
// Function: int putchar(int character)
//
// Description:
//   Write a character to stdout (debug version)
//
// Input:
//   R12 - Character to be written.
//
// Output:
//   R12 - Same character.
//
// Note:
//   The ?C_PUTCHAR is a special label recognized by the C-SPY debugger.
//   When execution reach this point C-SPY takes over and outputs the
//   character.
//

// Non-debug version

        MODULE  ?xxputchar
        PUBLIC  __putchar
        RSEG    CODE:CODE:NOROOT

        CFI     Block ?xxputchar using libCommon
        CFI     Function __putchar
        CFI     R12 Undefined

__putchar:
        XRET

        CFI     EndBlock ?xxputchar

        ENDMOD

// Debug-version

        MODULE  ?xxputchar
        PUBLIC  __putchar, ?C_PUTCHAR
        PUBLIC  ?DBG_0T, ?DBG_1T,?DBG_2T

?DBG_0T EQU     0
?DBG_1T EQU     0
?DBG_2T EQU     0

        RSEG    CODE:CODE:NOROOT

        CFI     Block ?xxputcharD using libCommon
        CFI     Function __putchar
        CFI     R12 Undefined

__putchar:
?C_PUTCHAR:

        XRET
        CFI     EndBlock ?xxputcharD

        ENDMOD


//
// Function: int getchar(void)
//
// Description:
//   Read a character from stdin (debug version).
//
// Input:
//
// Output:
//   R12 - The character read (integer).
//
// Note:
//   The ?C_GETCHAR is a special label recognized by the C-SPY debugger.
//   When execution reach this point C-SPY takes over and returns a
//   character.
//

// Non-debug version

        MODULE  ?xxgetchar
        PUBLIC  __getchar
        RSEG    CODE:CODE:NOROOT

        CFI     Block ?xxgetchar using libCommon
        CFI     Function __getchar
        CFI     R12 Undefined

__getchar:
        XRET

        CFI     EndBlock ?xxgetchar

        ENDMOD

// Debug-version

        MODULE  ?xxgetchar
        PUBLIC  __getchar, ?C_GETCHAR
        PUBLIC  ?DBG_0T, ?DBG_1T,?DBG_2T

?DBG_0T EQU     0
?DBG_1T EQU     0
?DBG_2T EQU     0

        RSEG    CODE:CODE:NOROOT

        CFI     Block ?xxgetcharD using libCommon
        CFI     Function __getchar
        CFI     R12 Undefined

__getchar:
?C_GETCHAR:
        XRET

        CFI     EndBlock ?xxgetcharD

        ENDMOD

        END

⌨️ 快捷键说明

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