📄 paulmon2.asx
字号:
; PAULMON2 Built-In Functions, "Glue" to SDCC C Programs;; This "glue" allows SDCC-based applications to call the; built-in functions within PAULMON2. For more information; about the PAULMON2 monitor, see the PAULMON2 web page:;; http://www.pjrc.com/tech/8051/paulmon2.html;; This code is intended to be built with "asx8051". A typical; usage is "asx8051 -slop paulmon2.asx". asx8051 will produce; the file "paulmon2.rel". Your C code that calls these functions; must include "paulmon2.h" for the function prototypes, and then; when you link your application, you'll need to include; "paulmon2.rel" on the command like, like this:;; sdcc --code-loc 0x2000 --stack-after-data yourcode.c paulmon2.rel;; This code is an original work of authorship by Paul Stoffregen; and has been placed in the PUBLIC DOMAIN. There is no copyright; and no license agreement. You may use this code in any manner; you wish without a royalty or other conditions, even embedded in; your own for-profit product.;; This code is distributed in the hope that it will be useful,; but WITHOUT ANY WARRANTY; without even the implied warranty; of merchantability or fitness for a particular purpose. .module paulmon2; well-known entry points to access PAULMON2's built-in functionspm2_entry_cout = 0x0030 ;Send Acc to serial portpm2_entry_cin = 0x0032 ;Get Acc from serial portpm2_entry_phex = 0x0034 ;Print Hex value of Accpm2_entry_phex16 = 0x0036 ;Print Hex value of DPTRpm2_entry_pstr = 0x0038 ;Print string pointed to by DPTR,pm2_entry_upper = 0x0040 ;Convert Acc to uppercasepm2_entry_pint8u = 0x004D ;print Acc at an integer, 0 to 255pm2_entry_pint8 = 0x0050 ;print Acc at an integer, -128 to 127pm2_entry_pint16u = 0x0053 ;print DPTR as an integer, 0 to 65535pm2_entry_newline = 0x0048 ;print CR/LF (13 and 10)pm2_entry_prgm = 0x0059 ;program flash byte in A to @DPTRpm2_entry_erblock = 0x0067 ;PAULMON2 v2.1 req'dpm2_reentry = 0x006D ;return to PAULMON2 (mp3 player version).area CSEG (CODE) ; void pm2_cout(char c)_pm2_cout:: mov a, dpl ljmp pm2_entry_cout ; char pm2_cin(void)_pm2_cin:: lcall pm2_entry_cin mov dpl, a ret ; void pm2_phex(unsigned char c)_pm2_phex:: mov a, dpl ljmp pm2_entry_phex ; void pm2_phex16(unsigned int i)_pm2_phex16:: ljmp pm2_entry_phex16 ; void pm2_pstr(code char *str)_pm2_pstr:: ljmp pm2_entry_pstr ; char pm2_upper(char c)_pm2_upper:: mov a, dpl lcall pm2_entry_upper mov dpl, a ret ; void pm2_pint8u(unsigned char c)_pm2_pint8u:: mov a, dpl ljmp pm2_entry_pint8u ; void pm2_pint8(char c)_pm2_pint8:: mov a, dpl ljmp pm2_entry_pint8 ; void pm2_pint16u(unsigned int i)_pm2_pint16u:: ljmp pm2_entry_pint16u ; void pm2_newline(void)_pm2_newline:: ljmp pm2_entry_newline ; void pm2_exit(void)_pm2_exit:: lcall 0x2042 clr ea ljmp pm2_reentry
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -