Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.sys.pdp10 > #9964 > unrolled thread

Command line parsing and MACRO-20

Started byjayjwa <jayjwa@atr2.ath.cx.invalid>
First post2026-08-28 14:08 -0400
Last post2026-08-30 22:18 -0400
Articles 9 — 3 participants

Back to article view | Back to alt.sys.pdp10


Contents

  Command line parsing and MACRO-20 jayjwa <jayjwa@atr2.ath.cx.invalid> - 2026-08-28 14:08 -0400
    Re: Command line parsing and MACRO-20 scott@slp53.sl.home (Scott Lurndal) - 2026-08-28 18:35 +0000
      Re: Command line parsing and MACRO-20 jayjwa <jayjwa@atr2.ath.cx.invalid> - 2026-08-29 12:19 -0400
        Re: Command line parsing and MACRO-20 Rich Alderson <news@alderson.users.panix.com> - 2026-08-29 17:51 -0400
    Re: Command line parsing and MACRO-20 Rich Alderson <news@alderson.users.panix.com> - 2026-08-28 20:59 -0400
      Re: Command line parsing and MACRO-20 jayjwa <jayjwa@atr2.ath.cx.invalid> - 2026-08-29 12:37 -0400
        Re: Command line parsing and MACRO-20 Rich Alderson <news@alderson.users.panix.com> - 2026-08-29 18:04 -0400
          Re: Command line parsing and MACRO-20 jayjwa <jayjwa@atr2.ath.cx.invalid> - 2026-08-30 11:38 -0400
            Re: Command line parsing and MACRO-20 Rich Alderson <news@alderson.users.panix.com> - 2026-08-30 22:18 -0400

#9964 — Command line parsing and MACRO-20

Fromjayjwa <jayjwa@atr2.ath.cx.invalid>
Date2026-08-28 14:08 -0400
SubjectCommand line parsing and MACRO-20
Message-ID<87fqzyjexe.fsf@atr2.ath.cx>
In MACRO-20, how do I get at the command line? I know it's possible
because DIRECT and TYPE parse the command line. I've completed one of
the two texts on assembly (the Longo one) and I haven't seen how to do
it. In the Gorin text, there's something about COMND but it's buried
under piles of macros. The explaination for COMND in the Monitor Ref
Call Manual made me physically ill (it's over 20 pages, give or
take). Maybe that's how to do it; maybe it's not. It can't believe it's
that insanely complex. I only need to parse what would be *argv[] in C
(and maybe argc). I don't want to head down a rabbit hole if there's no
rabbit to be found.

Can someone show a simple example of parsing the command line? Something
like:

@echo hello
hello

echo.mac:
comment $
Try to find out how to get at the command line, such as in C's argv and argc.
$
        title	echo
        search	monsym, macsym
        STDAC.					; Label accums in std way

buffer:	asciz	/This is where I imagine the text would be./

start:	TMSG	(The text entered is: )		
	move	t1, [point 7, buffer]		; Would really pnt to cmd line
	psout%					; for manipulation or printing

done:	haltf%					; Exit to monitor
	jrst	start				; Restartable
	end	start				; Assembler is done


I checked with DDT and my command line text is nowhere in there.

@debug echo hello
LINK:   Loading
[LNKDEB DDT execution]
DDT
echo$:   
start$b   $g
$1B>>START/   HRROI T1,DONE+2   ^
BUFFER+10/   TLZA Q3,0   $t;e.   ^
BUFFER+7/   uld b   ^
BUFFER+6/   xt wo   ^
BUFFER+5/   he te   ^
BUFFER+4/   ine t   ^
BUFFER+3/    imag   ^
BUFFER+2/   ere I   ^
BUFFER+1/   is wh   ^
BUFFER/   This    ^
.JBVER/   ^@   ^
.JBCST/   ^@   ^
.JBOPS/   ^@   ^
.JBINT/   ^@   ^
.JBCOR/   ^@^S0^A@   ^
.JBCHN+1/   ^@   ^
.JBCHN/   ^@   ^
.JBOPC/   ^@   ^
.JBTPC/   ^@   ^
.JBCNI/   ^@   ^
.JBAPR/   ^@   ^
.JBREN/   ^@   ^
.JBPFH/   ^@   ^
.JBFF+1/   ^@   ^
.JBFF/   ^@^@^@^A$@   ^
.JBSA/   ^@^S8^@4@   ^
.JBUSY/   ^@   ^
.JBSYM/   wp^@Z@   ^
.JBHRL/   ^@   ^
.JBEDV+2/   ^@   ^
.JBEDV+1/   ^@   ^
.JBEDV/   ^@   ^

-- 
PGP Key ID: 781C A3E2 C6ED 70A6 B356  7AF5 B510 542E D460 5CAE
       "The Internet should always be the Wild West!"

[toc] | [next] | [standalone]


#9965

Fromscott@slp53.sl.home (Scott Lurndal)
Date2026-08-28 18:35 +0000
Message-ID<aykkS.2694$aIQa.1285@fx18.iad>
In reply to#9964
jayjwa <jayjwa@atr2.ath.cx.invalid> writes:
>In MACRO-20, how do I get at the command line? I know it's possible
>because DIRECT and TYPE parse the command line. I've completed one of
>the two texts on assembly (the Longo one) and I haven't seen how to do
>it. In the Gorin text, there's something about COMND but it's buried
>under piles of macros. The explaination for COMND in the Monitor Ref
>Call Manual made me physically ill (it's over 20 pages, give or
>take). Maybe that's how to do it; maybe it's not. It can't believe it's
>that insanely complex. I only need to parse what would be *argv[] in C
>(and maybe argc). I don't want to head down a rabbit hole if there's no
>rabbit to be found.
>
>Can someone show a simple example of parsing the command line? Something
>like:

Enter "how does an TOPS-20 MACRO-20 application retrieve the command line used to invoke the
utility?" at the google search bar and the AI suggests the RSCAN% monitor
call and COMND% jsys call.

    MOVX T1, .RSINI     ; Function code to initialize rescan buffer
    RSCAN%              ; Monitor call to queue the buffer
     ERJMP ERROR_ROUTINE ; Handle unexpected errors
    MOVX T1, .RSCNT     ; Function code to count characters
    RSCAN%              ; Monitor call
     ERJMP ERROR_ROUTINE
    ; T1 now contains the character count

COMND% (Command Processor): The preferred TOPS-20 approach. COMND% parses the
  string dynamically, automatically stripping the invocation program name
  (the utility verb) so your application can immediately process switches
  or file names. 

The AI example:
---------------------------------------------------------------
    TITLE GETCMD - Retrieve Command Line on TOPS-20
    SEARCH MONSYM, MACSYM

STPT:   RESET%              ; Clear the world

    ; Step 1: Initialize the rescan buffer
    MOVX T1, .RSINI
    RSCAN%
     ERJMP NOTTY        ; Handle error (e.g., detached or background)

    ; Step 2: Ensure there is data to read
    MOVX T1, .RSCNT
    RSCAN%
     ERJMP NOTTY
    JUMPE T1, NOARGS    ; Jump if character count is zero

    ; Step 3: Read the raw command string from controlling terminal (.PRIIN)
    MOVX T1, .PRIIN     ; Primary input source
    HRROI T2, BUFFER    ; Pointer to our memory buffer
    MOVX T3, <5*50>-1   ; Maximum character limit to read
    MOVX T4, .CHLFD     ; Terminate read on Line Feed character
    SIN%                ; String Input monitor call
    ERJMP ERROR

    ; The command line is now saved in BUFFER as an ASCIZ string
    ; Proceed with parsing...

NOTTY:
NOARGS:
ERROR:  HALTF%              ; Exit program safely

BUFFER: BLOCK 50            ; 50-word buffer for the text string
    END STPT

[toc] | [prev] | [next] | [standalone]


#9967

Fromjayjwa <jayjwa@atr2.ath.cx.invalid>
Date2026-08-29 12:19 -0400
Message-ID<87h5kchpbs.fsf@atr2.ath.cx>
In reply to#9965
scott@slp53.sl.home (Scott Lurndal) writes:

> Enter "how does an TOPS-20 MACRO-20 application retrieve the command
> line used to invoke the utility?" at the google search bar and the AI
> suggests the RSCAN% monitor call and COMND% jsys call.

I'm pretty leary of AI for a couple reasons: one, I often field (Linux)
questions on LQ, and many confused new user's questions begin thus:
"ChatGPT told me...but it's not working" and they are more lost as a
result. Two, is that it will often produce results that *seem* correct,
but are not. Case in point was someone I spoke with on IRC that got a
stopwatch program in MACRO-10. It (the LLM) made basic mistakes like
mixing up radix, not initializing the stack before use, and trying to
move too large of numbers in immediate mode. Then there's the ego thing,
but I digress...

In this case, it pointed me in the correct direction so that I didn't
have to offer a human sacrifice to get COMND% working. Thanks; here's
the finished program:

@compile /compile myecho.mac
MACRO:  myecho

EXIT
@load myecho
LINK:   Loading
@save myecho
 MYECHO.EXE.7 Saved
@myecho

No characters available to read.
@myecho hello world
The input text is: hello world


comment $
myecho.mac
Demo on how to get at the command line, such as in C's argv and argc. 
Normally the full command line is returned. If you don't want the 
program name itself, you'll have to step over it. 
$
        title	myecho				; There's an 'echo' in UNIX-SYS
        search	monsym, macsym
        STDAC.					; Label accums in std way

        maxchr==^D50				; Max chars to read, in decimal

buffer:	block	maxchr				; Input buffer for cmd line

	subttl	Main
start:	MOVX	t1, .RSINI			; First, make data in buf avail
	rscan%					; in Job Storage Block
	  erjmp	[hrroi t1, [asciz /Error on .RSINI. Exiting./]
		 psout%
		 haltf%]			; Halt on rscan/rsini error
	MOVX	t1, .RSCNT			; Get num chars remain to read
	rscan%					; Does not actually read them
	  erjmp [hrroi t1, [asciz /Error on .RSCNT. Exiting./]
		 psout%
		 haltf%]			; Halt no restart on rscnt err
	jumpe	t1, empty			; Nothing to read, then

; If we're here, there's chars to read. Read raw command string to our buffer
	move	t1, [.PRIIN]			; Read from term, ready SIN%
	hrroi	t2, buffer			; Send them to our buffer
	MOVX	t3, <5*maxchr>-1		; Max chr read limit
	MOVX	t4, .CHLFD			; Signal end on 12 oct, \n
	sin%					; String input
	  erjmp	[hrroi t1, [asciz /Error on SIN%. Exiting./]
		 psout%
		 haltf%]			; Exit no restart on SIN% err

; The buffer contains the program name as well. Step over it and the blank
; that comes after it (7 chars if prog name is "myecho" plus a space).
; TODO: Calculate, programmatically, the length of the program name	
	move	t1, [point 7, buffer]		; Load buffer location
	movei	t3, 7				; Skip those 7 chars
	adjbp	t3, t1				; in t1's pointer
	exch	t3, t1				; but we need it in t1...
	ldb	t2, t1				; Look for \r
	cain	t2, .CHLFD			; \r basically means no chars
	  jrst	empty
	move	t4, t1				; t1 will be clobbered by TMSG
        TMSG    (The input text is: )           ; Print heading
	move	t1, t4				; Put back t1, due to above
	psout%					
	jrst	done				; Skip 'no chars' message

; By "no chars" it means "other than the program's own name". Leave out
; the byte pointer dance above if you DO want to handle the program's own
; name.  
empty:	TMSG	(
No characters available to read.)		; If nothing to read...
done:	haltf%					; Exit to monitor
	jrst	start				; Restartable
	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!"

[toc] | [prev] | [next] | [standalone]


#9970

FromRich Alderson <news@alderson.users.panix.com>
Date2026-08-29 17:51 -0400
Message-ID<mdd7bl8fvdy.fsf@panix5.panix.com>
In reply to#9967
jayjwa <jayjwa@atr2.ath.cx.invalid> writes:

> 	  erjmp	[hrroi t1, [asciz /Error on .RSINI. Exiting./]
> 		 psout%
> 		 haltf%]			; Halt on rscan/rsini error

Every one of your ERJMP routines ends incorrectly.

HALTF% does not prevent the EXEC from continuing the program, which it will do
from the instruction following the HALTF%.

"But wait!" you say, "there's no following instruction!"

Oh, yes, there is.  You just have no idea what it might be.

Literals are packed together in the space following the main program text, or
following a LIT pseudo-op if you use one.  Since your ERJMPs all type out error
messages, a continue after one will type the next error message in order
through your program.

The correct idiom, and I know it's present in Ralph's book, is to put a

    JRST .-1

after each HALTF%, so that a CONTINUE command forces the return to the EXEC.
NB:  A JRST .-3 would repeat the "correct" error message and then stop.

-- 
Rich Alderson					  news@alderson.users.panix.com
      Audendum est, et veritas investiganda; quam etiamsi non assequamur,
	  omnino tamen proprius, quam nunc sumus, ad eam perveniemus.
									--Galen

[toc] | [prev] | [next] | [standalone]


#9966

FromRich Alderson <news@alderson.users.panix.com>
Date2026-08-28 20:59 -0400
Message-ID<mdd33vxaghq.fsf@panix5.panix.com>
In reply to#9964
Besides the RSCAN% and COMND% JSYi, you also need to take a look at PRARG%,
which is how programs pass commands and data down a chain (as in the COMPILE,
LOAD, DEBUG, and EXECUTE commands).

jayjwa <jayjwa@atr2.ath.cx.invalid> writes:

> In MACRO-20, how do I get at the command line? I know it's possible because
> DIRECT and TYPE parse the command line. I've completed one of the two texts
> on assembly (the Longo one) and I haven't seen how to do it. In the Gorin
> text, there's something about COMND but it's buried under piles of macros.
> The explaination for COMND in the Monitor Ref Call Manual made me physically
> ill (it's over 20 pages, give or take). Maybe that's how to do it; maybe it's
> not. It can't believe it's that insanely complex. I only need to parse what
> would be *argv[] in C (and maybe argc). I don't want to head down a rabbit
> hole if there's no rabbit to be found.

To quote from Ralph's example chapter on the COMND% JSYS:

    The prologue that we have just been through is representative of the
    complexity of the COMND JSYS itself; [MCRM] takes more than twenty pages to
    describe all the features of the COMND JSYS.  The complexity of the COMND
    JSYS is due to its wide range of function.  We strive to perfect the
    interface that a program presents to its users.  Interactions between
    programs and people are quite complex:  the general mechanism by which
    these interactions take place is implemented by a large and complex program
    that needs more than a superficial explanation.

> Can someone show a simple example of parsing the command line? Something like:

> @echo hello
> hello

The text of the ECHO command in EXEC.EXE reads

    ;ECHO ...LINE TO BE ECHOED BACK...
    .ECHO:: NOISE (TO THE TERMINAL)
            LINEX <Text to be echoed>
             CMERRX			;ERROR
            CONFIRM
            HRROI A,ATMBUF		;GET BUFFER POINTER BACK
            ETYPE <%1M%%>
            RET

but that's a bunch of hairy macros, isn't it?

You keep wanting TOPS-20 to be Unix.  It isn't.

-- 
Rich Alderson					  news@alderson.users.panix.com
      Audendum est, et veritas investiganda; quam etiamsi non assequamur,
	  omnino tamen proprius, quam nunc sumus, ad eam perveniemus.
									--Galen

[toc] | [prev] | [next] | [standalone]


#9968

Fromjayjwa <jayjwa@atr2.ath.cx.invalid>
Date2026-08-29 12:37 -0400
Message-ID<87cxv0hohr.fsf@atr2.ath.cx>
In reply to#9966
Rich Alderson <news@alderson.users.panix.com> writes:

> Besides the RSCAN% and COMND% JSYi, you also need to take a look at PRARG%,
> which is how programs pass commands and data down a chain (as in the COMPILE,
> LOAD, DEBUG, and EXECUTE commands).

I'll look at PRARG% in the future. RSCAN% is what I needed for the time
being. There's someone doing some exercises in x86 asm (under MS-DOS) in
one of the other groups and those programs access the command
line. Hence my need of accessing the command line if I am to attempt
those programs in MACRO-20.

>     The prologue that we have just been through is representative of the
>     complexity of the COMND JSYS itself; [MCRM] takes more than twenty
>     pages
!!!

>> @echo hello
>> hello
>
> The text of the ECHO command in EXEC.EXE reads
>
>     ;ECHO ...LINE TO BE ECHOED BACK...
>     .ECHO:: NOISE (TO THE TERMINAL)
>             LINEX <Text to be echoed>
>              CMERRX			;ERROR
>             CONFIRM
>             HRROI A,ATMBUF		;GET BUFFER POINTER BACK
>             ETYPE <%1M%%>
>             RET
>
> but that's a bunch of hairy macros, isn't it?

Yes, and if they don't work it leaves a novice debugging expert's code
with no idea what's going wrong. This happened in the Longo text with
the Chapter 11 macros for interrupt handling. 2/3 of the examples won't
assemble. Why? I don't know. It could be a difference in TOPS-20
versions, MACRO-20 versions, a printing error, a user copy error, a case
error (it's case-insensitive until it's not) or really anything. Here's
the last program (ex 5) without relying on those macros.

comment $
Write a program that will display the duration of an event. The event will
start when the user presses a key, which should cause a keyboard interrupt
that accesses TIME% . Store the value that is returned in ac 1. Stop
the event when the user presses any key. This difference in the values
of TIME% is the number of milliseconds between keystrokes. 
$
        title	chbu5
	search	monsym, macsym
        lall					; Expand macros
        STDAC.					; Label accums in standard way

define	SPINR	<				; Print a spinner
	movei   t1, .CHCRT
        pbout%
	movei	t1, "|"
	pbout%
	movei	t1, .CHCRT
        pbout%		      
	movei	t1, "/"
        pbout%
        movei   t1, .CHCRT    
        pbout%
        movei	t1, "-"
        pbout%
        movei   t1, .CHCRT    
        pbout%
        movei	t1, "\"
	pbout%
        >
		  
; Channel table as per Monitor Ref Calls manual
chntab:	3,,etimer				; Ch 0, prio 3, routine etimer
	block	chntab+^D36-.			; Fill rest of 36 words

; Table for priority levels
levtab:	0					; No prio 1
	0					; No prio 2
	pc3					; Prio 3
pc3:	0					; PC save point for prio 3
strtim:	0					; Start time of TIMER
endtim:	0					; End time

	subttl	Main
start:	reset
	setzm	strtim				; Zero any last run
	setzm	endtim
        TMSG    (Press any key to begin TIME demo.
)
	move	t1, [.FHSLF]			; Fork, self
	move	t2, [xwd levtab, chntab]	; Set up tables for SIR%
	sir%					; SIR%, you're needed
	eir%					; Enable interrupts
	move	t2, [1B0]			; Turn on chan 0
	aic%					; Activate interrupt chans
	move	t1, [.TICTI,,0]			; Type-in on channel 0
	ati%					; Active it

	pbin%					; Pause to start demo

loop:	SPINR					; Prints a spinner to wait
	jumpa	loop				; Inf loop if not for interp

done:	TMSG	(
Elapsed time in milliseconds: )			; Print heading
	move	t2, endtim			; Calculate run time as
	sub	t2, strtim			; endtim - strtim = MS run
	move	t1, [.priou]			; Ready NOUT%
	movei	t3, 12				; Decimal base
	nout%
	  erjmp	[hrroi t1, [asciz /Error on NOUT%. Exiting/]
		 psout%
		 haltf%]
	haltf%					; Exit to monitor
	jrst	start				; Restart program?

; Elapsed time handler for channel 0, key-in. The first time this is
; called 'strtim' will be zero, indicating to save the begin time. When
; it's not zero, and called again, this indicates to save the end time. 
	subttl	Timer handler
etimer:	move	t1, strtim			; Check if strtim is 0
	skipn	t1		
	  jrst	[time%				; Yes, get start time
		 movem	t1, strtim		; And stash for later
		 jrst	exthdl]			; Exit handler
	time%					; Second time here
	movem	t1, endtim			; Get, save end time

; On the second time here, we need to change the place that we return to.
; This is done by changing the levtab pointer to where the return address
; is stored. 
	movei	t2, done			; Change where we debrk% to
	movem	t2, @levtab+2			; which would be pc3
exthdl:	debrk%					; Return from handler

	lit					; Debugger expands literals
	end	start				; Assembler is done


> You keep wanting TOPS-20 to be Unix.  It isn't.
Not really. I referenced C argc/argv because everyone knows that and I
didn't know how else to get my point across simply and direct. 

-- 
PGP Key ID: 781C A3E2 C6ED 70A6 B356  7AF5 B510 542E D460 5CAE
       "The Internet should always be the Wild West!"

[toc] | [prev] | [next] | [standalone]


#9971

FromRich Alderson <news@alderson.users.panix.com>
Date2026-08-29 18:04 -0400
Message-ID<mdd4igcfus3.fsf@panix5.panix.com>
In reply to#9968
jayjwa <jayjwa@atr2.ath.cx.invalid> writes:

 [ snip ]

> Yes, and if they don't work it leaves a novice debugging expert's code
> with no idea what's going wrong. This happened in the Longo text with
> the Chapter 11 macros for interrupt handling. 2/3 of the examples won't
> assemble. Why? I don't know. It could be a difference in TOPS-20
> versions, MACRO-20 versions, a printing error, a user copy error, a case
> error (it's case-insensitive until it's not) or really anything. Here's
> the last program (ex 5) without relying on those macros.

Does this version of the program work without those macros?  Just curious, but
no enough so to copy and assemble it for myself.

 [ snip ]

> ; Elapsed time handler for channel 0, key-in. The first time this is
> ; called 'strtim' will be zero, indicating to save the begin time. When
> ; it's not zero, and called again, this indicates to save the end time. 
> 	subttl	Timer handler
> etimer: move	t1, strtim			; Check if strtim is 0
> 	skipn	t1		
> 	  jrst	[time%				; Yes, get start time
> 		 movem	t1, strtim		; And stash for later
> 		 jrst	exthdl]			; Exit handler
> 	time%					; Second time here
> 	movem	t1, endtim			; Get, save end time

 [ snip ]

Why are you moving the value of strtim into an AC?  The SKIP instructions take
an effective address, so unless you need the initial value of strtim for
something, you only need

        SKIPN STRTIM

If you want to check it, AND save the value, use

        SKIPN T1,STRTIM

>> You keep wanting TOPS-20 to be Unix.  It isn't.

> Not really. I referenced C argc/argv because everyone knows that and I
> didn't know how else to get my point across simply and direct. 

You're lucky that I happen to know those terms from a C programming book I read
in the 1980s.  I have no idea how to use them, because I am not a C programmer
and have no need to know.

-- 
Rich Alderson					  news@alderson.users.panix.com
      Audendum est, et veritas investiganda; quam etiamsi non assequamur,
	  omnino tamen proprius, quam nunc sumus, ad eam perveniemus.
									--Galen

[toc] | [prev] | [next] | [standalone]


#9973

Fromjayjwa <jayjwa@atr2.ath.cx.invalid>
Date2026-08-30 11:38 -0400
Message-ID<87qzjfwrcj.fsf@atr2.ath.cx>
In reply to#9971
Rich Alderson <news@alderson.users.panix.com> writes:

> Does this version of the program work without those macros?  Just
> curious, but no enough so to copy and assemble it for myself.

Yes, all 5 of my solutions to the user exercises that are in Chapter 11
work and do so without the macros. They are over in my thread on
alt.lang.asm. There's a file, mystuf.mac, that is supposed to create
mystuf.unv. This is accumulated from across multiple chapters, including
the file one, but is never listed in one place. The file macros work,
the interrupt ones didn't. Worse, the PDF I have is a scanned-in image
so copy/paste doesn't really work correctly (using Xpdf) so it all has
to be typed in. After two days of the macros not working, I had to make
a decision to keep trying to use them or abandon them and write the
programs without. So I did without. Here's a short example of one of
them:

; Sets an interrupt macro
define  INTER   (proc,pri,chan,key<>) <
        FIXCHN  (proc,pri,chan)
        SETEIR
        SETAIC  (chan)
        ifdif   <key><>,<SETKEY (key,chan)>     ; Only use if not default
        >

and that's not even the top-most one.

> Why are you moving the value of strtim into an AC?

I'm not really used to using that instruction. Proper use now noted.

> You're lucky that I happen to know those terms from a C programming
> book I read in the 1980s.  I have no idea how to use them, because I
> am not a C programmer and have no need to know.

Don't you want to fix the C code and understand it too? So much is
written in C. I'll learn PDP-10 assembly and you learn C. Deal? Be
warned though, C pointers are actually worse than assembly ones IMNSHO.

@exec ptrdem.c
KCC:    PTRDEM
<PROGRAMMING>PTRDEM.PRE.1
<PROGRAMMING>PTRDEM.FAI.1
FAIL:  PTRDEM
LINK:   Loading
[LNKXCT PTRDEM execution]
z stores the address of m = 50110
*z stores the value of m = 10
&m is the address of m = 50110
&n stores the address of n = 50111
&o stores the address of o = 50112
&z stores the address of z = 50113
@


-- 
PGP Key ID: 781C A3E2 C6ED 70A6 B356  7AF5 B510 542E D460 5CAE
       "The Internet should always be the Wild West!"

[toc] | [prev] | [next] | [standalone]


#9975

FromRich Alderson <news@alderson.users.panix.com>
Date2026-08-30 22:18 -0400
Message-ID<mddse3vc9sz.fsf@panix5.panix.com>
In reply to#9973
jayjwa <jayjwa@atr2.ath.cx.invalid> writes:

> Don't you want to fix the C code and understand it too?  So much is written
> in C.  I'll learn PDP-10 assembly and you learn C.  Deal?  Be warned though,
> C pointers are actually worse than assembly ones IMNSHO.

I can read C code well enough to understand what it is doing without needing to
know things like argc/argv.  I made an FTP stub program written in "Dynamic C"
for the Rabbit work because I understood the equivalent Macro-20 code and knew
what was missing or simply done wrong.

But I get paid to write Macro-20.  I don't get paid to write C, or I might be
interested.  No one is looking for 75 year old C programmers...

-- 
Rich Alderson					  news@alderson.users.panix.com
      Audendum est, et veritas investiganda; quam etiamsi non assequamur,
	  omnino tamen proprius, quam nunc sumus, ad eam perveniemus.
									--Galen

[toc] | [prev] | [standalone]


Back to top | Article view | alt.sys.pdp10


csiph-web