beautypg.com

Rpbasic-52 programming guide – Remote Processing BASIC 52 User Manual

Page 107

background image

RPBASIC-52 PROGRAMMING GUIDE

2-88

PH0.
PH1.

Syntax:

PH0 . expr
PH1 . expr
Where: expr = any mathematical expression

Function:

Print in hexadecimal format following the number with an "H".

Mode:

Comm and, run

Use:

PH0. PEEKB (1,3000)

Cards:

All

D E S C R IP T I ON

The PH0. and PH1. instructions work like PRINT instruction except that it print values in HEX. The value
printed is alway s a truncated integ er and is followe d with an "H " to indicate hex adecim al format. If expr
evalu ates to a fracti onal n umb er with in integ er rang e, expr is truncated and d isplayed in hex format. If expr is
not within integer range (0 through 0FFFFH/65535), the normal decimal PRINT mode is used. PH0.
suppresses tw o leading zeros if expr evaluates to less than 0FFH. PH 1. always prints four hexadecimal digits.

If there is no expr, a carriage return - line feed combination (a blank line) will be output. An expr may be any
combination of instructions/operators and variables, strings, or literal values. More than one expr may be
output by separating them with commas. Values are printed with a leading space; a list of values separated
by commas will thus print with one intervening. This is different from the decimal PRINT instruction which
prints values with a trailing blank. Strings and literals are output with no added blanks. If a comma is the last
character in the list then a carriage return/linefeed is suppressed.

EXAMPLE

100 PH0. A