29.12.2012 Views

The Programmer's Guide to TRSDOS Version 6 - Tim Mann's Home ...

The Programmer's Guide to TRSDOS Version 6 - Tim Mann's Home ...

The Programmer's Guide to TRSDOS Version 6 - Tim Mann's Home ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

FILTER *PR USING *S0<br />

the operating system will swap the first three bytes of the *PR DCB with the *S0 DCB.<br />

This arrangement will establish that shown in figure 3-3.<br />

==============================================<br />

| TYPE VECTOR NAME MODULE/MODDCB |<br />

| ---- ------- ---- ________________ |<br />

| | | |<br />

| 47 SLASH0 PR | PRINTER/*PR | |<br />

| |________________| |<br />

| | | |<br />

| 06 PRINTER S0 | SLASH0/*S0 | |<br />

| |________________| |<br />

| | | |<br />

| 47 BOLDFACE BF | BOLDFACE/*BF | |<br />

| |________________| |<br />

==============================================<br />

Figure3-3: DCB Table Modified<br />

Let's follow what happens <strong>to</strong> an @PUT which references the *PR device. <strong>The</strong> system passes<br />

control <strong>to</strong> SLASH0 (which is pointed <strong>to</strong> by the *PR vec<strong>to</strong>r). This filter performs its<br />

character transformation, as required, and sends characters down the chain by picking up<br />

the pointer contained in its MODDCB (a pointer <strong>to</strong> the *S0 DCB) then issuing the @CHNIO<br />

SVC. <strong>The</strong> SVC handles the call by passing control <strong>to</strong> PRINTER which is the pointer now<br />

s<strong>to</strong>red in the VECTOR field of *S0.<br />

If we now try <strong>to</strong> issue the command:<br />

FILTER *PR USING *S0<br />

the system will prohibit it since the *S0 Device Control Block does not show up as a<br />

filter (bit-6 of the TYPE byte is reset!). However, if we filter *PR using the *BF<br />

device, we achieve the arrangement in figure 3-4 after the system swaps the first three<br />

bytes of *PR with the first three bytes of *BF.<br />

Examine the arrangement in figure 3-4 closely. Note that the contents of MODDCB for each<br />

module are exactly what they were initialized <strong>to</strong>. Even though the *PR device has been<br />

twice filtered, the module itself needs absolutely no change whatsoever. An *PUT <strong>to</strong> the<br />

*PR device (say with an *PRT SVC) may be a little more complicated now, but functions<br />

perfectly well. <strong>The</strong> system first passes control <strong>to</strong> BOLDFACE (which is pointed <strong>to</strong> by the<br />

*PR vec<strong>to</strong>r). This filter performs its necessary device stream massaging and sends<br />

characters down the chain by picking up the pointer contained in its MODDCB (a pointer <strong>to</strong><br />

the *BF DCB) then issuing the @CHNIO SVC. <strong>The</strong> SVC handles the call by passing control <strong>to</strong><br />

SLASH0 which is the pointer now s<strong>to</strong>red in the VECTOR field of *BF. <strong>The</strong> SLASH0 filter<br />

performs its character transformation, as required, and sends characters down the chain<br />

by picking up the pointer contained in its MODDCB (a pointer <strong>to</strong> the *S0 DCB) then issuing<br />

the @CHNIO SVC. <strong>The</strong> SVC handles the call by passing control <strong>to</strong> PRINTER which is the<br />

pointer now s<strong>to</strong>red in the VECTOR field of *S0. Upon completion, a series of RET<br />

instructions pass the return code back through the modules making up the chain.<br />

3-5

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!