Google 网上论坛不再支持新的 Usenet 帖子或订阅项。历史内容仍可供查看。

Paginating TYPE output

已查看 206 次
跳至第一个未读帖子

Paolo Amoroso

未读,
2021年9月16日 11:10:302021/9/16
收件人
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.

fridtjof.ma...@gmail.com

未读,
2021年9月16日 11:53:592021/9/16
收件人
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


Udo Munk

未读,
2021年9月16日 12:06:582021/9/16
收件人
the view program is on Many z80pack disks, source
Is in z80pack repo.


Paolo Amoroso

未读,
2021年9月16日 13:16:022021/9/16
收件人
Thanks Fred and Udo, that's an interesting historical insight.

Douglas Miller

未读,
2021年9月16日 17:00:042021/9/16
收件人
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.

Paolo Amoroso

未读,
2021年9月17日 04:33:102021/9/17
收件人
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

Martin

未读,
2021年9月17日 08:32:492021/9/17
收件人
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

Martin

未读,
2021年9月19日 03:40:212021/9/19
收件人
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.


fridtjof.ma...@gmail.com

未读,
2021年9月19日 08:33:412021/9/19
收件人
Martin

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

Fred

Martin

未读,
2021年9月19日 09:19:422021/9/19
收件人
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

Stephen Mitchell

未读,
2021年9月19日 12:59:152021/9/19
收件人
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

dott.Piergiorgio

未读,
2021年9月24日 04:53:382021/9/24
收件人
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.



Udo Munk

未读,
2021年10月4日 07:01:282021/10/4
收件人
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.
0 个新帖子