home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
CPM
/
ZCPR33
/
S-Z
/
SLB36HLP.LBR
/
SYSLIBE.HZP
/
SYSLIBE.HLP
Wrap
Text File
|
2000-06-30
|
8KB
|
232 lines
Note on Switched Output
PRINT/EPRINT/LPRINT/SPRINT -- Print String at Return Address
PSTR/EPSTR/LPSTR/SPSTR -- Print String at HL
Overview of File Name Output
Sample File Name Outputs
LFNn/PFNn/SFNn -- Print File Name
MFNn -- Store File Name
:Note on Switched Output
Thσá SwitcheΣá Outpu⌠ serie≤ oµ routine≤á i≤á differen⌠ ì
froφá thσá othe≥ serie≤ iε tha⌠ thσ SwitcheΣá Outpu⌠á serie≤ ì
use≤ aε externa∞ datß bytσ t∩ determinσ wherσ thσ outpu⌠á i≤ ì
t∩ bσ routed« Thi≤ bytσ i≤ referreΣ t∩ a≤ SCTLF╠ (╙ Contro∞ ì
Flag)¼ anΣ it≤ switchinτ functioε i≤ illustrateΣ below:
----- SCTLFL -----
Binary Hex Outputs to
00000000B 00H Nothing
00000001B 01H Console
10000000B 80H Printer
10000001B 81H Console and Printer
Iµá thσá programme≥á doe≤á no⌠á initializσá thσá SCTLF╠ ì
variablσ beforσ hσ use≤ aε S-routine¼á outpu⌠ wil∞ g∩ t∩ thσ ì
consolσ (defaul⌠ valuσ oµ SCTLF╠ i≤ 01H).
Aε examplσ oµ codσ usinτ S-routine≤ is:
EXT SCTLFL,SADC ; SCTLFL flag, SADC routine
...
MVI A,81h ; enable printer and console
STA SCTLFL
...
MVI A,32 ; print number 32
CALL SADC
...
MVI A,80H ; enable printer only
STA SCTLFL
...
MVI A,150 ; print number 150
CALL SADC
...
:Print String at Return Address
Routine: PRINT, EPRINT, LPRINT, SPRINT
Function:
Prin⌠á strinτ pointeΣ t∩ b∙ thσ returε addres≤ oεá CON║ ì
(PRIN╘á anΣá EPRINT)¼á LST║á (LPRINT)¼á o≥á switcheΣá outpu⌠ ì
(SPRINT)«á Strinτ i≤ terminateΣ b∙ ß binar∙ 0«á Contro∞ i≤ ì
returneΣá t∩á bytσá followinτá string«áá PRIN╘á anΣá LPRIN╘ ì
interpre⌠ contro∞ characters¼á sendinτ theφ t∩ thσ CON:/LST║ ì
device≤á a≤ "^có sequences«á EPRIN╘ (fo≥ Exac⌠ Print⌐á onl∙ ì
expand≤ tabs¼ sendinτ al∞ othe≥ character≤ as-is.
Inputs: Returε Addres≤ ╜ pointe≥ t∩ strinτ t∩ be
printed
Outputs: HL points to byte after string
(string is printed on CON: or LST:)
Registers Affected: HL
SYSLIB Routines Called: PSTR (for PRINT);
EPSTR (for EPRINT);
LPSTR (for LPRINT);
SPSTR (for SPRINT)
Special Error Conditions:
Thσ strinτ MUS╘ bσ terminateΣ b∙ ß binar∙ 0!!!
:Print String Pointed to by HL
Routine: PSTR, EPSTR, LPSTR, SPSTR
Function:
Prin⌠ strinτ pointeΣ t∩ b∙ H╠ oε CON║ (PST╥ anΣ EPSTR)¼ ì
LST║áá (LPSTR)¼á o≥á switcheΣá outpu⌠á (SPSTR)«á Strinτá i≤ ì
terminateΣá b∙á ßá binar∙ 0«á H╠ point≤ t∩á bytσá followinτ ì
strinτáá oεá exit«áá PST╥á anΣá LPST╥áá interpre⌠áá contro∞ ì
characters¼á sendinτá theφ t∩ thσ CON:/LST║á device≤ a≤ "^có ì
sequences«á EPST╥á (fo≥á Exac⌠ Print⌐á onl∙á expand≤á tabs¼ ì
sendinτ al∞ othe≥ character≤ as-is.
Inputs: HL = pointer to string to be printed
Outputs: HL pts to the byte following the terminating 0
(string is printed on CON: or LST:)
Registers Affected: HL
SYSLI┬áRoutine≤ Called║ CCOUT¼ COU╘ (fo≥ PSTR)╗
COUT (for EPSTR);
CLOUT¼ LOU╘ (fo≥ LPSTR);
CSOUT, SOUT (for SPSTR)
Special Error Conditions:
Thσ strinτ MUS╘ bσ terminateΣ b∙ ß binar∙ 0!!!
:Overview of File Name Output
Thσá filσ namσ outpu⌠ routine≤ describeΣ herσ arσá useΣ ì
t∩á outpu⌠á thσá filσ namσ anΣ typσ storeΣ iε aεá FC┬á iεá ß ì
variet∙ oµ forms« Thesσ form≤ arσ illustrateΣ a≤ follows:
Ex 1 Ex 2 Comment
---- ---- -------
MYFILE__.TY╨ T_______.T_▀ 12-cha≥ field¼ embeddeΣ spaces
MYFILE.TYP__ T.T_________ 12-char field, trailing spaces
MYFILE.TYP T.T N-char field, no spaces
Iεá addition¼á eacΦá oµ thesσ routine≤ ha≤ ß prefi°á t∩ ì
thei≥ names║á L¼ M¼ P¼ o≥ S« Thesσ prefixe≤ indicatσ wherσ ì
thσá outpu⌠ i≤ goinτ to«á ╠ indicate≤ thσ LST║á devicσá (o≥ ì
printer)¼ ═ indicate≤ memory¼ ╨ indicate≤ thσ consolσ (prin⌠ ì
thσ output)¼á anΣ ╙ indicate≤ ß switcheΣ outpu⌠ t∩á nothing¼ ì
the console, the printer, or both.
For example,
PFN▒ send≤ thσ filσ namσ anΣ typσ pointeΣ t∩ b∙ D┼ ì
iε ß 12-characte≥ fielΣ witΦ embeddeΣ space≤ t∩ thσ console¼ ì
whilσá LFN▒ send≤ thσ filσ namσ anΣ typσ pointeΣ t∩ b∙ D┼ iε ì
ß 12-characte≥ fielΣ witΦ embeddeΣ space≤ t∩ thσ printer.
:Sample File Name Outputs
Thσá followinτá table≤á illustratσ ho≈ value≤á wil∞á bσ ì
outpu⌠á b∙ thσ variou≤ routines«á Thσ underscorσá characte≥ ì
(_⌐ indicate≤ ß space.
FCB Name/Type xFN1 xFN2 xFN3
FILENAMETY╨ FILENAME.TY╨ FILENAME.TY╨ FILENAME.TYP
MYFILE TXT MYFILE__.TXT MYFILE.TXT MYFILE.TXT__
R R R_______.R__ R.R R.R_________
S S_______.___ S. S.__________
T ________.T__ .T .T__________
"x", as in "xFN1", may be any one of:
Letter Example Outputs To
L LFN1 LST: Device (printer)
M MFN1 Memory pted to by HL
P PFN1 CON: Device (console)
S SFN1 Switched Output
:Print File Name Routines
Routine: LFNn, PFNn, SFNn
Function:
Prin⌠ FC┬ Filσ Namσ anΣ Typσ pointeΣ t∩ b∙ D┼ (FCB+▒ i≤ ì
addres≤á iε DE⌐ t∩ CON║á (PFNn)¼á LST║á (LFNn)¼á o≥ SwitcheΣ ì
Outpu⌠ (SFNn)«á Thσ variou≤ value≤ oµ ε arσ ▒ t∩ 3¼ wherσ ▒ ì
output≤ witΦ embeddeΣ spaces¼á ▓ output≤ witΦ n∩ spaces¼ anΣ ì
│ output≤ witΦ trailinτ space≤ (ie¼ PFN1¼ PFN2¼ anΣ PFN3).
Inputs: DE = Address of FCB+1
Outputs: -None- (Value is printed)
Registers Affected: -None-
SYSLI┬áRoutine≤ Called║ LOU╘ (fo≥ LFNn);
COUT (for PFNn);
SOUT (for SFNn)
Special Error Conditions: None
:Store File Name Routines
Routine: MFNn
è Function:
Storσ appropriatσ outpu⌠ int∩ memor∙ a⌠ buffe≥á pointeΣ ì
t∩ b∙ HL« FCB+▒ i≤ pointeΣ t∩ b∙ D┼ oε input« Fo≥ MFN▒ anΣ ì
MFN3¼á thσá numbe≥á oµ character≤ storeΣ wil∞ alway≤ bσá 12« ì
Fo≥ MFN2¼á thσ numbe≥ oµ character≤ storeΣ i≤á varying¼á bu⌠ ì
will never exceed 12.
Inputs: DE pts to FCB+1
HL pts to memory buffer
Outputs: None (Characters are stored in memory buffer)
Registers Affected: None
SYSLIB Routines Called: None
Special Error Conditions: None
Notes:
1«á Usσá oµá MFN▒ anΣ MFN│ i≤á quitσá straight-forwarΣ ì
sincσáá the∙á alway≤á fil∞á exactl∙á 1▓á byte≤á oµáá memory« ì
Advancinτá t∩á thσá nex⌠ bytσ afte≥ thσ las⌠ bytσá i≤á quitσ ì
simple, as the following code illustrates:
...
LXI D,FCB+1 ; pt to FN field
LXI H,BUFFER ; pt to buffer
CALL MFN1 ; store name
LXI B,12 ; skip to after last byte
DAD B ; by adding 12 to HL
...
2«á Usσ oµ MFN▓ i≤ no⌠ quitσ a≤ straight-forwarΣ sincσ ì
i⌠á fill≤ a⌠ mos⌠ 1▓ bytes¼á bu⌠ coulΣ fil∞ les≤ thaεá this« ì
Thi≤ probleφ caε bσ eliminateΣ b∙ usinτ thσ FILL┬ anΣá SKNS╨ ì
routines, as illustrated:
...
LXI H,BUFFER ; pt to buffer
MVI B,13 ; fill following 13 bytes with
MVI A,' ' ; spaces
CALL FILLB
LXI D,FCB+1 ; pt to FN field
CALL MFN2 ; store name
CALL SKNSP ; skip over non-spaces (HL now
; points to after last character)
...