• Paginating TYPE output

    From Paolo Amoroso@21:1/5 to All on Thu Sep 16 08:10:29 2021
    On CP/M 2.2 does the TYPE command have any options for paginating the output and reading it without the text scrolling continuously? I mean something like Unix more(1).

    I checked the documentation and other sources but can't find any such pagination options and z80pack ignores [Pnn]. Although flow-control commands such as ^S/^Q can suspend and resume the output, they're an inaccurate workaround even on a slow system.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From fridtjof.martin.weigel@gmail.com@21:1/5 to paolo....@gmail.com on Thu Sep 16 08:53:58 2021
    On Thursday, September 16, 2021 at 11:10:30 AM UTC-4, paolo....@gmail.com wrote:
    On CP/M 2.2 does the TYPE command have any options for paginating the output and reading it without the text scrolling continuously? I mean something like Unix more(1).

    I checked the documentation and other sources but can't find any such pagination options and z80pack ignores [Pnn]. Although flow-control commands such as ^S/^Q can suspend and resume the output, they're an inaccurate workaround even on a slow system.

    No, CP/M TYPE does not paginate
    PIP does NOT ignore [Pnn], it just isn't doing what you think. It inserts a form feed every nn lines.

    Since CP/M was expected to be used on a teletype, just look "up higher in the roll". Your terminal emulator probably has a "scroll back" function.

    Add-on programs provide "more" type function (I use one called VIEW.COM, sorry, don't know where its from). VIEW.COM is 384 bytes long. Here it is as a HEX file (LOAD it)

    :10010000C30C017E1223130DC20301C9215C00112F :100110001A010E0CCD0301C34101CD0616C3FB0C21 :10012000CDA00DCDBB0D00B50DC3FB0CCDA00DC3F7 :10013000FB0CCD960DFE38CA7B0CE63602004079EA :10014000E6C3B1012A3D01EB2A3F017D937C9ADA97 :100150009A01210000223F01EB2A3D017B957A9C08 :10016000D28C012A3B0119EB0E1ACD0500111A01A0 :100170000E14CD0500B7C286011180002A3F011977 :10018000223F01C358012A3F01223D011180000E88 :100190001ACD0500210000223F01EB2A3B0119EB9B :1001A0002A3D017DB43E1AC81A2A3F0123223F018D :1001B000C9AF322601323A01210040223D01223FDF :1001C000010E0F111A01CD05003CC2EA010E091102 :1001D000D801CD0500C300000D0A4E4F20444953FD :1001E0004B24494E2046494C45243E17323502CD1A :1001F0004401FE1ACA0000FE0ACA0702F50E025F99 :10020000CD0500F1C3EF013A35023D323502CA1E79 :10021000023E0AF50E025FCD0500F1C3EF013E0A72 :10022000F50E025FCD0500F10E01CD0500FE03CAFB :100230000000C3EA01000000000000000000000010 :1002400000000000000000000000000000000000AE :10025000000000000000000000000000000000009E :10026000000000000000000000000000000000008E :10027000000000000000000000000000000000007E
    :00000001FF

    VIEW file - any key to go to next page ^C to exit Location 1EB is the
    number of lines per page (default 17h, make it whatever you want)

    FredW

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Udo Munk@21:1/5 to All on Thu Sep 16 09:06:57 2021
    the view program is on Many z80pack disks, source
    Is in z80pack repo.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paolo Amoroso@21:1/5 to All on Thu Sep 16 10:16:00 2021
    Thanks Fred and Udo, that's an interesting historical insight.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Douglas Miller@21:1/5 to All on Thu Sep 16 14:00:02 2021
    CP/M 2.2 TYPE did not page, but CP/M 3 TYPE did. Back in the day, CP/M 2.2 users got pretty good at using ^S/^Q to control the spewing of text from TYPE.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paolo Amoroso@21:1/5 to Udo Munk on Fri Sep 17 01:33:09 2021
    On Thursday, September 16, 2021 at 6:06:58 PM UTC+2, Udo Munk wrote:
    the view program is on Many z80pack disks, source
    Is in z80pack repo.

    Which of the distribution archives[1] includes the VIEW.COM program? I can't find it in the z80pack source tree.


    [1] https://www.autometer.de/unix4fun/z80pack/#download

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Martin@21:1/5 to Paolo Amoroso on Fri Sep 17 14:31:38 2021
    Am 09/17/2021 10:33 AM, Paolo Amoroso schrieb:
    On Thursday, September 16, 2021 at 6:06:58 PM UTC+2, Udo Munk wrote:
    the view program is on Many z80pack disks, source
    Is in z80pack repo.

    Which of the distribution archives[1] includes the VIEW.COM program? I can't find it in the z80pack source tree.


    [1] https://www.autometer.de/unix4fun/z80pack/#download



    This "view.com" is not from z80pack, you find it here: <http://www.sunrise-ev.com/z80.htm>

    In <http://www.sunrise-ev.com/photos/z80/SD-CARD.zip>

    The images are 8' SS/SD images, but with no sector skew (1).


    Using "cpmtools", with this custom diskdefs

    $ cat ./diskdefs
    diskdef z80mc
    seclen 128
    tracks 77
    sectrk 26
    blocksize 1024
    maxdir 64
    skew 1
    boottrk 2
    os 2.2
    end

    $ cpmls -l -f z80mc DISK-A.BIN
    0:
    -rwxrwxrwx 8192 Jan 01 1970 asm.com
    -rw-rw-rw- 12288 Jan 01 1970 bios.asm
    -rwxrwxrwx 4864 Jan 01 1970 ddt.com
    -rw-rw-rw- 10240 Jan 01 1970 deblock.asm
    -rw-rw-rw- 6400 Jan 01 1970 diskdef.lib
    -rw-rw-rw- 4352 Jan 01 1970 dump.asm
    -rwxrwxrwx 512 Jan 01 1970 dump.com
    -rwxrwxrwx 512 Jan 01 1970 dumpcpd.com
    -rwxrwxrwx 7680 Jan 01 1970 ed.com
    -rwxrwxrwx 1792 Jan 01 1970 genmod.com
    -rwxrwxrwx 1792 Jan 01 1970 load.com
    -rwxrwxrwx 3072 Jan 01 1970 ls.com
    -rwxrwxrwx 24320 Jan 01 1970 mbasic.com
    -rwxrwxrwx 3328 Jan 01 1970 mon-32k.com
    -rwxrwxrwx 10240 Jan 01 1970 movcpm.com
    -rwxrwxrwx 11776 Jan 01 1970 nswp.com
    -rw-rw-rw- 29824 Jan 01 1970 nswp.txt
    -rwxrwxrwx 7424 Jan 01 1970 pip.com
    -rwxrwxrwx 2560 Jan 01 1970 rlocbios.com
    -rwxrwxrwx 5376 Jan 01 1970 stat.com
    -rw-rw-rw- 16128 Jan 01 1970 stdbios.asm
    -rwxrwxrwx 1280 Jan 01 1970 submit.com
    -rwxrwxrwx 1152 Jan 01 1970 survey.com
    -rwxrwxrwx 1024 Jan 01 1970 sysgen.com

    -rwxrwxrwx 384 Jan 01 1970 view.com

    -rwxrwxrwx 10624 Jan 01 1970 wm.com
    -rw-rw-rw- 2816 Jan 01 1970 wm.hlp
    -rw-rw-rw- 512 Jan 01 1970 xmodem.cfg
    -rwxrwxrwx 7680 Jan 01 1970 xmodem.com
    -rwxrwxrwx 768 Jan 01 1970 xsub.com


    Have fun!
    Martin

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Martin@21:1/5 to fridtjof.ma...@gmail.com on Sun Sep 19 09:39:06 2021
    Am 09/16/2021 05:53 PM, fridtjof.ma...@gmail.com schrieb:
    On Thursday, September 16, 2021 at 11:10:30 AM UTC-4, paolo....@gmail.com wrote:
    On CP/M 2.2 does the TYPE command have any options for paginating the output and reading it without the text scrolling continuously? I mean something like Unix more(1).

    I checked the documentation and other sources but can't find any such pagination options and z80pack ignores [Pnn]. Although flow-control commands such as ^S/^Q can suspend and resume the output, they're an inaccurate workaround even on a slow system.

    No, CP/M TYPE does not paginate
    PIP does NOT ignore [Pnn], it just isn't doing what you think. It inserts a form feed every nn lines.

    Since CP/M was expected to be used on a teletype, just look "up higher in the roll". Your terminal emulator probably has a "scroll back" function.

    Add-on programs provide "more" type function (I use one called VIEW.COM, sorry, don't know where its from). VIEW.COM is 384 bytes long. Here it is as a HEX file (LOAD it)

    :10010000C30C017E1223130DC20301C9215C00112F :100110001A010E0CCD0301C34101CD0616C3FB0C21 :10012000CDA00DCDBB0D00B50DC3FB0CCDA00DC3F7 :10013000FB0CCD960DFE38CA7B0CE63602004079EA :10014000E6C3B1012A3D01EB2A3F017D937C9ADA97 :100150009A01210000223F01EB2A3D017B957A9C08 :10016000D28C012A3B0119EB0E1ACD0500111A01A0 :100170000E14CD0500B7C286011180002A3F011977 :10018000223F01C358012A3F01223D011180000E88 :100190001ACD0500210000223F01EB2A3B0119EB9B :1001A0002A3D017DB43E1AC81A2A3F0123223F018D :1001B000C9AF322601323A01210040223D01223FDF :1001C000010E0F111A01CD05003CC2EA010E091102 :1001D000D801CD0500C300000D0A4E4F20444953FD :1001E0004B24494E2046494C45243E17323502CD1A :1001F0004401FE1ACA0000FE0ACA0702F50E025F99 :10020000CD0500F1C3EF013A35023D323502CA1E79 :10021000023E0AF50E025FCD0500F1C3EF013E0A72 :10022000F50E025FCD0500F10E01CD0500FE03CAFB :100230000000C3EA01000000000000000000000010 :1002400000000000000000000000000000000000AE :10025000000000000000000000000000000000009E :10026000000000000000000000000000000000008E :10027000000000000000000000000000000000007E
    :00000001FF

    VIEW file - any key to go to next page ^C to exit Location 1EB is the
    number of lines per page (default 17h, make it whatever you want)

    FredW



    Nice litte thing, so I disassembled it ... :-)

    It uses SEQIO.LIB, needs MAC.COM to assemble.
    Here it is...

    ==== 8< ====
    ;
    ; FILE VIEW PROGRAM
    ;
    CTLC EQU 'C'-64
    CTLZ EQU 'Z'-64
    ;
    ORG 0100H
    ;
    MACLIB SEQIO ;SEQUENTIAL I/O LIB
    ;
    FILE INFILE,DISK$IN,,1,,4000H
    ;
    PLOOP: MVI A,23
    STA LCOUNT
    LLOOP:
    GET DISK$IN
    CPI CTLZ
    JZ 0
    CPI LF
    JZ LDONE
    PUT CON
    JMP LLOOP
    ;
    LDONE: LDA LCOUNT
    DCR A
    STA LCOUNT
    JZ PFULL
    MVI A,LF
    PUT CON
    JMP LLOOP
    ;
    PFULL: MVI A,LF
    PUT CON
    GET KEY
    CPI CTLC
    JZ 0
    JMP PLOOP
    ;
    LCOUNT: DS 1
    BUFFERS:
    ;
    END
    ==== 8< ====

    Have fun!
    Martin

    P.S.:
    It it binary identical to the posted HEXDUMP.
    I even let the evil "DISK$IN" unmodfied,
    which corrupts the error message.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From fridtjof.martin.weigel@gmail.com@21:1/5 to Martin on Sun Sep 19 05:33:40 2021
    On Sunday, September 19, 2021 at 3:40:21 AM UTC-4, Martin wrote:
    Am 09/16/2021 05:53 PM, fridtjof.ma...@gmail.com schrieb:
    On Thursday, September 16, 2021 at 11:10:30 AM UTC-4, paolo....@gmail.com wrote:
    On CP/M 2.2 does the TYPE command have any options for paginating the output and reading it without the text scrolling continuously? I mean something like Unix more(1).

    I checked the documentation and other sources but can't find any such pagination options and z80pack ignores [Pnn]. Although flow-control commands such as ^S/^Q can suspend and resume the output, they're an inaccurate workaround even on a slow
    system.

    No, CP/M TYPE does not paginate
    PIP does NOT ignore [Pnn], it just isn't doing what you think. It inserts a form feed every nn lines.

    Since CP/M was expected to be used on a teletype, just look "up higher in the roll". Your terminal emulator probably has a "scroll back" function.

    Add-on programs provide "more" type function (I use one called VIEW.COM, sorry, don't know where its from). VIEW.COM is 384 bytes long. Here it is as a HEX file (LOAD it)

    :10010000C30C017E1223130DC20301C9215C00112F :100110001A010E0CCD0301C34101CD0616C3FB0C21 :10012000CDA00DCDBB0D00B50DC3FB0CCDA00DC3F7 :10013000FB0CCD960DFE38CA7B0CE63602004079EA :10014000E6C3B1012A3D01EB2A3F017D937C9ADA97 :100150009A01210000223F01EB2A3D017B957A9C08 :10016000D28C012A3B0119EB0E1ACD0500111A01A0 :100170000E14CD0500B7C286011180002A3F011977 :10018000223F01C358012A3F01223D011180000E88 :100190001ACD0500210000223F01EB2A3B0119EB9B :1001A0002A3D017DB43E1AC81A2A3F0123223F018D :1001B000C9AF322601323A01210040223D01223FDF :1001C000010E0F111A01CD05003CC2EA010E091102 :1001D000D801CD0500C300000D0A4E4F20444953FD :1001E0004B24494E2046494C45243E17323502CD1A :1001F0004401FE1ACA0000FE0ACA0702F50E025F99 :10020000CD0500F1C3EF013A35023D323502CA1E79 :10021000023E0AF50E025FCD0500F1C3EF013E0A72 :10022000F50E025FCD0500F10E01CD0500FE03CAFB :100230000000C3EA01000000000000000000000010 :1002400000000000000000000000000000000000AE :10025000000000000000000000000000000000009E :10026000000000000000000000000000000000008E :10027000000000000000000000000000000000007E
    :00000001FF

    VIEW file - any key to go to next page ^C to exit Location 1EB is the number of lines per page (default 17h, make it whatever you want)

    FredW


    Nice litte thing, so I disassembled it ... :-)

    It uses SEQIO.LIB, needs MAC.COM to assemble.
    Here it is...

    ==== 8< ====
    ;
    ; FILE VIEW PROGRAM
    ;
    CTLC EQU 'C'-64
    CTLZ EQU 'Z'-64
    ;
    ORG 0100H
    ;
    MACLIB SEQIO ;SEQUENTIAL I/O LIB
    ;
    FILE INFILE,DISK$IN,,1,,4000H
    ;
    PLOOP: MVI A,23
    STA LCOUNT
    LLOOP:
    GET DISK$IN
    CPI CTLZ
    JZ 0
    CPI LF
    JZ LDONE
    PUT CON
    JMP LLOOP
    ;
    LDONE: LDA LCOUNT
    DCR A
    STA LCOUNT
    JZ PFULL
    MVI A,LF
    PUT CON
    JMP LLOOP
    ;
    PFULL: MVI A,LF
    PUT CON
    GET KEY
    CPI CTLC
    JZ 0
    JMP PLOOP
    ;
    LCOUNT: DS 1
    BUFFERS:
    ;
    END
    ==== 8< ====

    Have fun!
    Martin

    P.S.:
    It it binary identical to the posted HEXDUMP.
    I even let the evil "DISK$IN" unmodfied,
    which corrupts the error message.
    Martin

    Thanks! I have wondered where VIEW.COM came from -- I don't think I ever had source for it.

    Fred

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Martin@21:1/5 to fridtjof.ma...@gmail.com on Sun Sep 19 15:19:40 2021
    Am 09/19/2021 02:33 PM, fridtjof.ma...@gmail.com schrieb:
    Martin

    Thanks! I have wondered where VIEW.COM came from -- I don't think I ever had source for it.

    Fred


    Weekend, and a little spare time, it was a lot of fun!

    It is very nice to your disk drives, as it uses a buffer of 4000h bytes.
    And it's by far the smallest pager around.

    It has got a new home on my boot disks :-)

    Martin

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stephen Mitchell@21:1/5 to Martin on Sun Sep 19 09:59:14 2021
    On Sunday, September 19, 2021 at 9:19:42 AM UTC-4, Martin wrote:
    Am 09/19/2021 02:33 PM, fridtjof.ma...@gmail.com schrieb:
    Martin

    Thanks! I have wondered where VIEW.COM came from -- I don't think I ever had source for it.

    Fred

    Weekend, and a little spare time, it was a lot of fun!

    It is very nice to your disk drives, as it uses a buffer of 4000h bytes.
    And it's by far the smallest pager around.

    It has got a new home on my boot disks :-)

    Martin
    Nice work, indeed. Another solution is to use one of the many CCP replacements that implement a paged TYPE command. For over 20 years, I have used Don Kirkpatrick's excellent ZCPR-D&J (a refinement of ZCPR 1.0). It occupies the same 800H byte (2K) space
    as the original CCP while adding a number of useful commands as well as full DU: support. The TYPE command is paged by default, but an optional P argument after the filename will provide continuous scrolling if you want it.

    Steve Mitchell

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dott.Piergiorgio@21:1/5 to Udo Munk on Fri Sep 24 10:53:36 2021
    On 16/09/21 18:06, Udo Munk wrote:
    the view program is on Many z80pack disks, source
    Is in z80pack repo.

    I think that could be feasible adding a simple less(1) functionality, decreasing the current line pointer by the content of 1EB...

    Best regards from Italy,
    dott. Piergiorgio.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Udo Munk@21:1/5 to dott.Piergiorgio on Mon Oct 4 04:01:27 2021
    dott.Piergiorgio schrieb am Freitag, 24. September 2021 um 10:53:38 UTC+2:
    On 16/09/21 18:06, Udo Munk wrote:
    the view program is on Many z80pack disks, source
    Is in z80pack repo.
    I think that could be feasible adding a simple less(1) functionality, decreasing the current line pointer by the content of 1EB...

    Won't work, the program uses a buffer for one record, not the whole file.
    See source for reference: https://www.autometer.de/unix4fun/z80pack/ftp/source-examples/plm80/view.plm

    A less like utility needs to be able to seek to any position in a file of undetermined length.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)