;
DPROG - Device Programmer
A ZCPR3 Tool
D - DPROG Summary 1 - Characters
P - DPROG Programming 2 - Format Specifications
3 - Word Definitions
4 - DPROG Commands
:D
Command: DPROG 1.0
Syntax:
DPROG <-- program from STD.DPG
DPROG filename <-- program from filename.DPG
DPROG filename.typ <-- program from filename.typ
Function:
DPROǠ i� use� t� progra� th� devic� a� th� Console� �
List�� o� Punc� Device�� I� read� th� indicate� o� implie� �
fil� afte� � pat� searc� an� print� ou� string� accordin� t� �
th� format� containe� i� th� file�� Th� DPRO� too� ca� b� �
use� t� sen� an� se� o� byt� value� i� an� desire� forma� t� �
eithe� th� Console� List� o� Punc� devices.
Options: None
Comments:
Th� fil� use� t� progra� th� devic� i� � conventiona� �
ASCI� tex� fil� whic� contain� fou� basi� type� o� lines:
1�� commen� line� - thos� line� whos� firs� non-�
blan� characte� i� � semicolo� (;)
2� wor� definitio� line� - thos� line� tha� begi� �
wit� � das� (-� i� colum� on� followe� immediatel� b� � word
3�� DPROǠ comman� line� - thos� line� beginnin� �
wit� � specia� comman� characte� t� DPROG
4�� outpu� line� - an� othe� lin� whic� doe� no� �
fi� on� o� th� thre� type� o� line� above�� thes� line� �
generat� th� outpu� whic� i� sen� t� th� device
Th� detail� o� ho� t� writ� program� i� th� DPRO� �
languag� ar� covere� elsewher� i� thi� HL� file.
Selected Error Messages: Self-explanatory
Examples of Use:
DPROG -- program from STD.DPG
DPROG ASM -- program from ASM.DPG
:P
DPROG Programming
DPROǠ i� � 3� interprete� fo� � devic� programmin� �
language�� Word� (� symbo� u� t� 1� character� long�� whic� �
contai an��� combinatio o栠 outpu� forma� contro� �
instructions�� tex� strings�� an� reference� t� othe� word� �
ca� b� define� i� thi� language� Onc� � wor� i� defined� i� �
ca� b� name� i� a� outpu� line��� an� it� definitio� �
(includin� embedde� forma� controls� wil� b� translate� an� �
outpu� t� eithe� th� console�� printer�� o� punc� device� �
Wor� reference� ca� b� neste� u� t� 12� level� deep�� Fo� �
example:
;
; Sample DPROG programming file
;
; Define Basic Words
-esc (%c) "\E" ; the escape character
-ctrly "^Y" ; the character control-Y
-test (Char: %c %x %d\n) ; character test format
-normal_form (%c) ; normal output format
;
; Use Words
;
"This is a test\n" test "ABC" normal_form "\nEnd of Test"
Th� outpu� fro� th� executio� o� th� outpu� lin� wil� �
be:
This is a test
Char: A 41 65
Char: B 42 66
Char: C 43 67
End of Test
Use� i� conjunctio� wit� bot� forma� definition� (wher� �
the�� ar� outpu� literally� an� quote� string� (wher� the� �
ar� outpu� accordin� t� th� curren� forma� definition)�� th� �
followin� escap� sequence� apply:
^c Define control character (2-char sequence)
\b Backspace char
\d Delete char (DEL)
\e Escape char (ESC)
\l New Line char (CRLF pair)
\n Line Feed Char (LF)
\r Carriage Return char (CR)
\t Tab char (TAB)
\# Numeric value (forms are \d for decimal, \dH
for hex, \dq for octal, \dB for
binary: \1, \245, \33h, \0feH, \111b,
\77q, etc)
Additionally� th� forma� expressio� i� o� th� form
(<format text>)
wher� <forma� text� ca� contai� an� characte� sequenc� a� �
wel� a� recogniz� th� followin� outpu� directives:
%c Output chars as ASCII characters
%d Output chars as floating decimal ASCII chars
%x Output chars as 2 hex ASCII chars
%2 Output chars as 2 decimal ASCII chars
%3 Output chars as 3 decimal ASCII chars
An� tex� ca� surroun� thes� outpu� directives� an� eac� �
directiv� ca� b� use� a� man� time� a� desire� i� � forma� �
expression�� Onc� � forma� expressio� i� given�� i� i� use� �
unti� � ne� expressio� i� defined� Fo� example:
(%x %d ) "\12\10hA" (%c) "\12\10hA"
will output:
0C 12 10 16 41 65 ^L^PA
wher� ^̠ an� ^� ar� th� ASCIɠ control-̠ an� control-� �
characters.
Finally�� t� mak� al� o� thi� complete�� th� use� ca� �
direc� outpu� t� th� console�� printer� o� punc� a� an� tim� �
(fo� programmin� whateve� devic� yo� wan� t� program)� ther� �
ar� debuggin� command� (paus� t� examin� output�� dum� wor� �
definitio� table�� dum� forma� expression)�� an� yo� ca� se� �
u� a� man� *.DP� file� tha� yo� wan� t� progra� � variet� o� �
functions�� DPRO� i� � tru� ZCPR� utility�� an� i� searche� �
th� pat� fo� th� *.DP� files�� s� th� *.DP� file� ca� b� �
retaine� i� th� ROO� director� an� the� wil� b� foun� fro� �
an� director� o� th� system.
DPROG is used by issuing a command of the form:
DPROG filename.typ <-- program from filename.typ
DPROG filename <-- program from filename.DPG
DPROG <-- program from STD.DPG
DPROG�� o� course�� ca� b� use� withi� a� alias�� ZE� �
comman� file� o� an� othe� ZCPR� environment� Fo� instance� �
th� followin� Wor� Sta� alia� i� reasonable:
IF NEC=$2
DEV L NEC <-- assign printer
WSN $1 <-- run NEC version of WS
ELSE
DEV L TTY <-- assign printer
DPROG CORRESP <-- program printer for
correspondence
WS $1 <-- run proper version of WS
FI
:1
Th� followin� symbol� ar� use� t� defin� specia� �
characters under DPROG:
^c Define control character (2-char sequence)
\b Backspace char
\d Delete char (DEL)
\e Escape char (ESC)
\l New Line char (CRLF pair)
\n Line Feed Char (LF)
\r Carriage Return char (CR)
\t Tab char (TAB)
\# Numeric value (forms are \d for decimal, \dH
for hex, \dq for octal, \dB for
binary: \1, \245, \33h, \0feH, \111b,
\77q, etc)
:2
Th� followin� escap� sequence� (th� escap� characte� i� �
%� ar� vali� i� forma� specification� (whic� ar� enclose� i� �
parentheses) under DPROG:
%c Output chars as ASCII characters
%d Output chars as floating decimal ASCII chars
%x Output chars as 2 hex ASCII chars
%2 Output chars as 2 decimal ASCII chars
%3 Output chars as 3 decimal ASCII chars
:3
A word definition under DPROG takes the following form:
-word_symbol text_of_definition
where "-" is the first character in the line.
:4
� Th堠 followin� DPROǠ command� ar堠 availabl堠 fo� �
debugging and other purposes:
Output Direction:
>C Direct Output to Console
>L Direct Output to List (Printer)
>P Direct Output to Punch
Data Dump:
= Dump both Word Table (Symbols) and Format
=F Dump current Format Specification
=S Dump current Word Table (Symbol Table)