Article View: alt.lang.asm
Article #2neofetch for TOPS-10/20
From: jayjwa
Date: Sun, 29 Nov 2026 21:35
Date: Sun, 29 Nov 2026 21:35
485 lines
20572 bytes
20572 bytes
Someone mentioned neofetch in DCL for OpenVMS and it got me thinking
there should be one for TOPS-10/20. I have access to 3 T10 and 1 T20,
the below are runs on those (output from before I added color support
and changed the banner; the data values are the same).
Steuben Technologies Distribution Revision 1.4
Has kermit, requires removing MONSYM (not needed for T10 anyway).
simh pdp10 binary
.exec 10ftch
MACRO: 10ftch
LINK: Loading
[LNKXCT 10FTCH execution]
""8"" 8"""88 8""""8 8""""8 88 eeeeee Active PPN: 42,42
8 8 8 8 8 8 8 8 8 TTY Line: TTY0
8e 8 8 8eeee8 8eeeee 8 8 8 Processor serial num: 4097
88 8 8 88 88 eeee 8 8 8 System memory size (words): 91136
88 8 8 88 e 88 8888 8 8 Number of jobs logged in: 13
88 8eeee8 88 8eee88 8888 8eeee8 Monitor version: 70300
KS10 15:20:01 CTY system 4097 CENTRA
No kermit, won't recognize tape, keyed in, has MONSYM.
simh pdp10 binary
.exec 10ftch
MACRO: 10ftch
LINK: Loading
[LNKXCT 10FTCH execution]
""8"" 8"""88 8""""8 8""""8 88 eeeeee Active PPN: 1,2
8 8 8 8 8 8 8 8 8 TTY Line: CTY
8e 8 8 8eeee8 8eeeee 8 8 8 Processor serial num: 4097
88 8 8 88 88 eeee 8 8 8 System memory size (words): 111616
88 8 8 88 e 88 8888 8 8 Number of jobs logged in: 10
88 8eeee8 88 8eee88 8888 8eeee8 Monitor version: 70400
NERGIG(15) KL+NETMON-704
Has kermit, has MONSYM, T10 development system
simh pdp10-kl binary
.exec 10ftch
LINK: Loading
[LNKXCT 10FTCH execution]
""8"" 8"""88 8""""8 8""""8 88 eeeeee Active PPN: 30,1
8 8 8 8 8 8 8 8 8 TTY Line: TTY4
8e 8 8 8eeee8 8eeeee 8 8 8 Processor serial num: 1025
88 8 8 88 88 eeee 8 8 8 System memory size (words): 105472
88 8 8 88 e 88 8888 8 8 Number of jobs logged in: 15
88 8eeee8 88 8eee88 8888 8eeee8 Monitor version: 70400
AMATSU KLH, PANDA
TOPS-20 Monitor 7.1(21733)-4
Has kermit, has MONSYM, T20 development system
klh kn10-kl binary
@exec 10ftch
LINK: Loading
[LNKXCT 10FTCH execution]
""8"" 8"""88 8""""8 8""""8 eeee eeeeee Active PPN: 30,1
8 8 8 8 8 8 8 8 8 TTY Line: TTY44
8e 8 8 8eeee8 8eeeee 8 8 8 Processor serial num: 3600
88 8 8 88 88 eeee eee8 8 8 System memory size (pages): 8092
88 8 8 88 e 88 8 8 8 Number of jobs logged in: 12
88 8eeee8 88 8eee88 8eee 8eeee8 Monitor version: AMATSU KLH, PANDA
TOPS-20 Monitor 7.1(21733)-4
In case the escape codes don't survive usenet (rot13):
uggc://nge2.ngu.pk/~wnlwjn/10sgpu.znp
Color example:
uggc://nge2.ngu.pk/~wnlwjn/srgpurf.cat
Let me know if it runs on your node(s). It should. I can add more data
points later as long as they exist in both T10/T20. No AI used.
10ftch.mac:
comment $
neofetch-inspired program for the PDP-10 in MACRO. Usable
on TOPS-10 and TOPS-20 (via the UUOSYM compat package
TOPS-20 has). Set for your platform below (TOPS10 vs TOPS20).
Unix neofetch data items don't match one-to-one with PDP-10.
Unix PDP-10 (TOPS-10 and TOPS-20)
--------------------------------------------
User GETPPN The group/user logged in
Shell GETLIN Always the same, list TTY instead
Host GETTAB CPU ID (T10)
GETAB Processor Serial number (T20)
Memory/RAM GETTAB Memory size in words
None GETTAB Number of jobs logged in (T10)
GETAB Oper + user jobs logged in (T20)
Kernel ver GETTAB Monitor version number (T10)
GETAB Monitor version string (T20)
$
title 10ftch
search uuosym, macsym, monsym ; Remove MONSYM if your T10 lacks it
STDAC. ; Label accums in standard way
PGVER. (1,0,1,4) ; VERS, VUPDAT, VEDIT, VCUST
; Set only one of the below to reflect the system this is to run on
TOPS10==0 ; 1 if for T10, else 0
TOPS20==1 ; 1 if for T20, else 0
ssize==36 ; Size of stack
stack: block ssize ; Space for stack data
crlf: 15B6+12B13 ; \r\n sequence
; ANSI colors are rendered with Emacs's ctlr-q, [xxm
; where "xx" is a number corresponding to color as per the
; ANSI escape codes:
; 32 = RED 36 = CYAN 34 = BLUE 94 = BR BLUE 0 = NORMAL
; 41 = RED BG
top0: asciz / [41m|D|I|G|I|T|A|L|[0m @ [94mPDP-10[0m/
top1: asciz / ===========================/
; The banner is 7 rows tall and is generated in this manner:
; figlet -f Rounded pdp10
; ESC codes take up room and count againt the 80 col (line wrap)
t10b0: asciz "[34m _ ___ _____[0m "
t10b1: asciz "[34m | | (___) (_____)[0m "
t10b2: asciz "[34m ____ __| |____ _ _ __ _[0m "
t10b3: asciz "[34m| _ \ / _ | _ \ | || |/ /| |[0m "
t10b4: asciz "[34m| |_| ( (_| | |_| || || /_| |[0m "
t10b5: asciz "[34m| __/ \____| __(_____)_____/ [0m "
t10b6: asciz "[34m|_| |_| DECsystem-10[0m "
t20b0: asciz "[31m _ ___ _____[0m "
t20b1: asciz "[31m | | (___) (_____)[0m "
t20b2: asciz "[31m ____ __| |____ _ _ __ _[0m "
t20b3: asciz "[31m| _ \ / _ | _ \ | || |/ /| |[0m "
t20b4: asciz "[31m| |_| ( (_| | |_| || || /_| |[0m "
t20b5: asciz "[31m| __/ \____| __(_____)_____/[0m "
t20b6: asciz "[31m|_| |_| DECSYSTEM-20[0m "
; BG Colors 40-47, bright colors 100-107 for two-bar color test pattern
; Like with the OS banner, the TTY counts invisible control chars against
; the line wrap. This means the text wraps way before it should otherwise,
; resulting in colors streaking into the next line. In order to defeat this
; we have to move the entire color bar more leftward than it would be
; normally in neofetch. ANSI "7l" disable wrap does not work.
cbar0: asciz / [40m [41m [42m [43m [44m [45m [46m [47m [0m/
cbar1: asciz / [100m [101m [102m [103m [104m [105m [106m [107m [0m/
; Data objects the program fetches. These print one per line, for
; each of the six lines in the banner.
ppn: 0 ; Project/programmer num (int)
linnam: 0 ; Line name in SIXBIT
cpuser: 0 ; CPU/processor serial number
memsiz: 0 ; Sys mem size in words or pages (int)
numjob: 0 ; Number of jobs logged in (int)
IFG TOPS10, <
monver: 0 ; Monitor vers num is int on T10
> ; End T10-specific code
IFG TOPS20, <
mversz==12 ; Long enough for monitor name
monver: block mversz ; On T20, it's a long ASCIZ string
> ; End T20-specific code
; Define an error macro that gives the general error type and
; exits to the monitor, non-restartable. Call with error text param.
define ERROUT (errtxt) <
outstr [asciz /Error on errtxt - Exiting./]
exit ;; Exit to monitor no restart
>
; Increment an accumulator, defaults to CX
define INC (acc<cx>) <
addi acc, 1
>
; Output a SIXBIT char string to the TTY, no \r\n after output
define OUTSIX (chars6,%sxout,%sxfin) <
move t2, chars6 ;; Mem location of SIXBIT chars
%sxout: jumpe t2, %sxfin ;; Only blanks? then we're done
movei t1, 0 ;; Clear accum on the left
lshc t1, 6 ;; Left-shift char
addi t1, 40 ;; Convert from SIXBIT to ASCII
outchr t1 ;; Print char to TTY
jrst %sxout ;; Loop and do next char
%sxfin: >
subttl Main
start: move p, [iowd ssize, stack] ; Set up stack, used below
pushj p, ppnsub ; Get PPN subroutine
pushj p, linsub ; Get line name subroutine
pushj p, getcnf ; Use GETTAB to get various data
; Now that the data points are fetched, print them out side-by-side
; with the graphic.
outstr top0 ; Print top banner
outstr crlf
outstr top1
outstr crlf
IFG TOPS10, <
outstr t10b0 ; Print first line
outstr crlf
outstr t10b1 ; Next
outstr [asciz /[36mActive PPN:[0m /]
hlrz p1, ppn ; Get project number
movei p2, 10 ; Want octal base output
push p, p1 ; Put itoa's data on stack
push p, p2
pushj p, itoa ; Print project num
movei t1, "," ; Separate by comma
outchr t1
hrrz p1, ppn ; Get programmer number
movei p2, 10 ; Again, octal base
push p, p1 ; Put itoa's num on stack
push p, p2 ; Put itoa's base on stack
pushj p, itoa ; Print programmer num
outstr crlf
outstr t10b2 ; Print next banner line
outstr [asciz /[36mConnected TTY Line:[0m /]
OUTSIX (linnam) ; Print SIXBIT to TTY as ASCII
outstr crlf
outstr t10b3 ; Onward with the banner
outstr [asciz /[36mProcessor serial#:[0m /]
move p1, cpuser ; Fetch serial number
movei p2, 12 ; Decimal base
push p, p1 ; Set up itoa
push p, p2 ; Push desired output base
pushj p, itoa ; Print to TTY
outstr crlf
outstr t10b4 ; Banner, next line
outstr [asciz /[36mSystem core (words):[0m /]
move p1, memsiz ; Fetch memsiz
movei p2, 12 ; Decimal output I guess?
push p, p1 ; Push param on stack for itoa
push p, p2 ; Indicate base
pushj p, itoa ; Prints to TTY
outstr crlf
outstr t10b5 ; Next banner line
outstr [asciz /[36mJobs logged in:[0m /]
move p1, numjob ; Fetch numjob
movei p2, 12 ; Num jobs outputs in decimal
push p, p1 ; Push param on stack for itoa
push p, p2 ; Indicate decimal base
pushj p, itoa ; Print to TTY
outstr crlf
outstr t10b6 ; Banner line
outstr [asciz /[36mMonitor version:[0m /]
move p1, monver ; Fetch monver integer
movei p2, 10 ; This is octal, believe it or not
push p, p1 ; Setup itoa
push p, p2 ; Ensure octal output
pushj p, itoa ; Print to TTY
outstr crlf
> ; End of T10-specific code
IFG TOPS20, <
outstr t20b0 ; Print first line
outstr crlf
outstr t20b1 ; Print next line
outstr [asciz /[36mActive PPN:[0m /]
hlrz p1, ppn ; Get project number
movei p2, 10 ; Want octal base output
push p, p1 ; Put itoa's data on stack
push p, p2
pushj p, itoa ; Print project num
movei t1, "," ; Separate by comma
outchr t1
hrrz p1, ppn ; Get programmer number
movei p2, 10 ; Again, octal base
push p, p1 ; Put itoa's num on stack
push p, p2 ; Put itoa's base on stack
pushj p, itoa ; Print programmer num
outstr crlf
outstr t20b2 ; Print next banner line
outstr [asciz /[36mConnected TTY Line:[0m /]
OUTSIX (linnam) ; Print SIXBIT to TTY as ASCII
outstr crlf
outstr t20b3 ; Onward with the banner
outstr [asciz /[36mProcessor serial#:[0m /]
move p1, cpuser ; Fetch serial number
movei p2, 12 ; Decimal base
push p, p1 ; Set up itoa
push p, p2
pushj p, itoa ; Print to TTY
outstr crlf
outstr t20b4 ; Banner, next line
outstr [asciz /[36mSystem core (pages):[0m /]
move p1, memsiz ; Fetch memsiz
movei p2, 12 ; Decimal output I guess?
push p, p1 ; Push param on stack for itoa
push p, p2 ; Indicate base
pushj p, itoa ; Prints to TTY
outstr crlf
outstr t20b5 ; Next banner line
outstr [asciz /[36mJobs logged in:[0m /]
move p1, numjob ; Fetch numjob
movei p2, 12 ; Num jobs outputs in decimal
push p, p1 ; Push param on stack for itoa
push p, p2 ; Indicate decimal base
pushj p, itoa ; Print to TTY
outstr crlf
outstr t20b6 ; Banner line
outstr [asciz /[36mMonitor version:[0m /]
; This is what's in <system>monnam.txt and will likely overflow the line
; and wrap. Truncating it is prettier, but incorrect, not doing so is
; ugly but correct.
outstr monver ; Print line and possibly wrap
outstr crlf
> ; End of T20-specific code
pushj p, colorb ; Output color bar test pattern
MONRT. ; Restartable (UUOSYM) program
jrst start
subttl PPN Fetch Routine
; Fetch the user's PPN and store it in 'ppn'. This should display
; in octal.
ppnsub: getppn t1, ; Fetch PPN
jfcl ; Jump Flag Clear (noop)
movem t1, ppn ; Stash PPN
popj p, ; Return to caller
subttl Line Name Routine
; Returns SIXBIT monitor-assigned name of the terminal attached to job
linsub: getlin t2, ; Get left-justified as TTYnnn
tlnn t2, -1 ; Job detached?
jrst [setz t2,
movem t2, linnam
jrst lin.1] ; Yes, note with 0 and leave
movem t2, linnam ; Stash returned data
lin.1:! popj p, ; Return to caller
subttl Int To ASCII Char Routine
; Output integer number passed in as ASCII decimal.
; Input: Push number on the stack. Push base (8 or 10) onto stack
; Returns: Prints to TTY, returns to calling routine
; Uses: T1-T4, CX as per STDAC.
; Limits: Doesn't handle negative numbers. Only octal and decimal base.
; Errors: Only checks if base 8 or 10.
; Ex: 0o1234 = "668"
itoa: pop p, t3 ; Save return address to caller
pop p, t4 ; Get base parameter
pop p, t1 ; Get number parameter
push p, t3 ; Replace ret addr for later return
; Special case: the number is already zero. Print and exit in this case.
jumpn t1, not0 ; Not zero? do normal conversion
addi t1, "0" ; It's zero, convert to char 0
outchr t1 ; And print to TTY
popj p, ; We're done, leave routine early
; Error check that base to convert to is either octal or decimal.
not0: cain t4, 10 ; Does caller want octal base?
jrst okbase ; Yes, continue
cain t4, 12 ; No? how about decimal?
jrst okbase ; Yes, contine else error out
jrst [ERROUT <ITOA invalid base>]
; Strip digits in reverse order and place char equivilent on the stack
; CX counts digits processed - T4 keeps the base to display in
okbase: push p, cx ; Save CX - we use it below
setz cx, ; Digit counter, zero it now
prt.1:! move t3, t4 ; Use T4 base for computations
jumpe t1, prt.2 ; If T1 is zero, we're done
idiv t1, t3 ; Get right-most digit, in T2
addi t2, "0" ; Convert to ASCII printing char
push p, t2 ; Save right-most digit on stack
INC ; Indicate we've done another digit
jrst prt.1 ; Do next digit(s)
; Loop, popping chars off the stack and printing them
prt.2:! pop p, t1 ; Fetch ASCII char from stack
outchr t1 ; Print (already converted to ASCII)
sojg cx, prt.2 ; Look for CX number of chars
pop p, cx ; Restore CX to whatever it was doing
popj p, ; Return to caller
subttl GETTAB Tables Routine
; Get various data points via GETTAB or GETAB monitor call.
; TOPS-10 and TOPS-20 do not share this info, even with UUOSYM.
; This means we have to fetch the same info in a different way
; depending on the system we're assembling for. Ouch.
getcnf: IFG TOPS10, <
move t1, [%CNSER] ; Get CPU/processor serial number
gettab t1, ; Fetch data point
jrst [ERROUT (%CNSER)] ; Exit on error
movem t1, cpuser ; Stash serial number
move t1, [%CNSIZ] ; System memory size in words
gettab t1,
jrst [ERROUT (%CNSIZ)]
movem t1, memsiz ; Stash memory size
move t1, [%CNLNM] ; Number of jobs logged in
gettab t1,
jrst [ERROUT (%CNLNM)]
movem t1, numjob ; Stash num of jobs logged in
move t1, [%CNVER] ; Monitor version number
gettab t1,
jrst [ERROUT (%CNVER)]
movem t1, monver ; Stash monitor version number
> ; End of T10-specific code
IFG TOPS20, <
; TOPS-20 uses GETAB, not GETTAB. See section 2.3.2 MCRM. Table numbers
; are listed via MONSYM (Appendix B-31) or ask SYSGT% for them.
; The MCRM in PDF format does not contain all the needed GETAB numbers.
; Make sure to use the TXT format - it reaches version 7 - for reference.
move t1, [sixbit /APRID/] ; Request processor serial num
sysgt%
hrrz t1, t2 ; Put returned tabl number in T1
getab%
jrst [ERROUT (APRID)] ; KLH10 defines this as 3600
movem t1, cpuser ; in kn10def.h KLH10_APRID_SERIALNO
move t1, [sixbit /NCPGS/] ; Not listed in MCRM for v5!
sysgt% ; Request num core mem pages
hrrz t1, t2 ; Load returned table number
getab%
jrst [ERROUT (NCPGS)] ; On error
; T20 under KLH emulator will be similar to this, with not all core
; being available to the user.
; CPU: KL10-extend SYS: T20 Pager: KL APRID: 1
; Memory: 8192 pages of 512 words (SHARED)
movem t1, memsiz ; Stash num pages of memory
move t1, [sixbit /SYSTAT/] ; Request SYSTAT table number
sysgt%
hrrz t1, t2 ; Load returned table number
hrli t1, 57 ; Return num jobs oper,,user to T1
getab% ; Index,, table number
jrst [ERROUT (SYSTAT)]
hlrz t2, t1 ; Oper num jobs now in T2
hrrz t3, t1 ; User num jobs now in T3
setz t1, ; Blank T1
add t1, t2 ; Oper+user jobs together in T1
add t1, t3
movem t1, numjob ; Stash number of total jobs
; MONVER returns the revision number. That's not what we need.
setz cx, ; Zero looper index
move t1, [sixbit /SYSVER/] ; Ask for this table number
sysgt% ; SIXBIT name in T1
get.1:! hrrz t1, t2 ; Load table number, zero rest
hrl t1, cx ; Index increments upward
getab% ; Index into table,, table num
jrst [ERROUT (SYSVER)] ; If error
movem t1, monver(cx) ; Else stash mon ver ASCIZ
INC ; Increment looper
caige cx, mversz ; Filled monitor name block?
jrst get.1 ; Loop for more otherwise
> ; End of T20-specific code
popj p, ; Return to caller
subttl Color Bar
; neofetch outputs a color bar test pattern of colors/bright colors
; in two rows of 8 each.
colorb: outstr crlf ; Separate from any output above
outstr cbar0 ; Normal color bar
outstr crlf ; Color is 3 spaces wide
outstr cbar1 ; Bright color bar
outstr crlf ; Make sure normal output returns
popj p,
lit ; Debugger expands literals
end start ; Assembler is done
--
PGP Key ID: 781C A3E2 C6ED 70A6 B356 7AF5 B510 542E D460 5CAE
"The Internet should always be the Wild West!"
Technical Details
Message-ID:
<874iczl3sl.fsf@atr2.ath.cx>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mailShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: jayjwa <jayjwa@atr2.ath.cx.invalid> Newsgroups: alt.sys.pdp10,alt.lang.asm Subject: neofetch for TOPS-10/20 Date: Sun, 29 Nov 2026 16:35:06 -0500 Organization: Atr2 RG 2026 Message-ID: <874iczl3sl.fsf@atr2.ath.cx> MIME-Version: 1.0 Content-Type: text/plain Injection-Info: solani.org; logging-data="796830"; mail-complaints-to="abuse@news.solani.org" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:FxHvmjOboUB/rG368gNkWUt7Qcw= sha1:RYiRt0EInejEn/km8/isbK/i5y0= X-User-ID: eJwFwQkRwEAIBDBLfLvMyQEK/iU0gVM5GQQDhxNLztn7Im1DvavbWZA9canbl5MaaEH4bv0XdxEd