; The following subroutines are available in the 'PAULMON' ; debugger. Just include the appropriate .equ statements in ; your program, and the use LCALL to access them. ; All of these use the serial port. When the debugger runs ; your program, it will leave the serial port correctly configured. ; It is not necessary to change TMOD, PCON, SCON, or TH1. ; These routines will fail is the baud rate timer is stopped, ; or if the serial port interrupt has been enabled. ; ---------------cut here-------------------------------------- .equ Cout, 0x0030 ;Send Acc to serial port .equ Cin, 0x0032 ;Get Acc from serial port .equ pHex, 0x0034 ;Print Hex value of Acc .equ pHex16, 0x0036 ;Print Hex value of DPTR .equ pString, 0x0038 ;Print string pointed to by DPTR, ;must be terminated by 0 or a high bit set ;pressing ESC will stop the printing .equ gHex, 0x003A ;Get Hex input into Acc ;Carry set if ESC has been pressed .equ gHex16, 0x003C ;Get Hex input into DPTR ;Carry set if ESC has been pressed .equ ESC, 0x003E ;Check for ESC key ;Carry set if ESC has been pressed .equ Upper, 0x0040 ;Convert Acc to uppercase ;Non-ASCII values are unchanged .equ Init, 0x0042 ;Initialize serial port ;----------------cut here-------------------------------------- ; Example: ; ;TEST: MOV DPTR,#PROMPT1 ;LOCATION OF PROMPT TEXT ; LCALL PSTRING ;PRINT THE PROMPT ; LCALL CIN ;GET A CHARACTER ; LCALL COUT ;ECHO IT BACK ; MOV DPTR,#PROMPT2 ;LOCATION OF THE OTHER TEXT ; PUSH ACC ;PSTRING MIGHT DESTROY ACC ; LCALL PSTRING ;PRINT IT ; POP ACC ;RESTORE ACC ; LCALL PHEX ;AND PRINT IT IN HEX ; MOV A,#13 ;13=CARRIAGE RETURN ; LCALL COUT ;PRINT THE CR ; RET ;WE'RE DONE ; ;PROMPT1:.DB "Press a Key > ",0 ;DON'T FORGET THE NULL ;PROMPT2:.DB " Its ASCII value (in HEX) is: ",0