[Info-vax] Very simple DCL question

Arne Vajhøj arne at vajhoej.dk
Wed Dec 28 21:58:15 EST 2022


On 12/28/2022 10:49 PM, VAXman- at SendSpamHere.ORG wrote:
> In article <toisqe$p0r$1 at gioia.aioe.org>, =?UTF-8?Q?Arne_Vajh=c3=b8j?= <arne at vajhoej.dk> writes:
>>          .title  realp
>>          $SSDEF
>>          $DSCDEF
>>          .macro  if_end_command,lbl
>>          cmpl    r3,r4
>>          bgeq    lbl
>>          .endm
>>          .macro  if_space,lbl
>>          cmpb    (r3),#32
>>          beql    lbl
>>          .endm
>>          .psect  $LOCAL quad,pic,con,lcl,noshr,noexe,wrt
>> cmdlen: .blkw   1
>> cmdbuf: .blkb   256
>> pnam:   .ascid  "P1"
>> pval:   .blkw   1
>>          .byte   DSC$K_DTYPE_T
>>          .byte   DSC$K_CLASS_S
>>          .address pvala
>> pvala:  .blkb   256
>>          .psect  $CODE quad,pic,con,lcl,shr,exe,nowrt
>>          .entry  realp,^m<r2,r3,r4,r5>
>> ; grab copy of command line
>>          movl    #CTL$AG_CLIDATA,r0
>>          movl    W^PPD$L_PRC(r0),r0
>>          movl    W^PRC_L_RECALLPTR(r0),r0 ; r0 = next command
>>          subl2   #2,r0
>>          cvtwl   (r0),r1                 ; r1 = length current command
>>          subl2   r1,r0                   ; r0 = current command
>>          movw    r1,cmdlen               ; copy of length of command line
>>          movc3   r1,(r0),cmdbuf          ; copy of command line
>>          movab   cmdbuf,r3               ; r3 = current character on
>> command line
>>          cvtwl   cmdlen,r1
>>          addl3   r1,r3,r4                ; r4 = end of command line
>> ; skip command itself
>> 100$:   if_end_command done
>>          if_space start
>>          incl    r3                      ; move to next character
>>          brb     100$
>> ; process parameters
>> start:  incl    r3                      ; r3 = start first argument
>>          movl    #1,r2                   ; r2 = n = 1
>> 200$:   if_end_command done
>>          movw    #0,pval                 ; reset parameter data
>>          movab   pvala,r5                ; r5 = where to copy parameter data
>> 300$:   if_end_command 500$
>>          if_space 400$
>>          incw    pval                    ; add to pval/pvala
>>          movb    (r3),(r5)
>>          incl    r3
>>          incl    r5
>>          brb     300$
>> 400$:   incl    r3                      ; skip space between parameters
>> 500$:   pushl   #0
>>          pushab  pval
>>          pushab  pnam
>>          calls   #3,G^LIB$SET_SYMBOL
>>          incb    pnam+9                  ; Pn -> Pn+1
>>          incl    r2                      ; n = n + 1
>>          cmpl    r2,#8                   ; while n <= 8
>>          bleq    200$
>> done:   movl    #SS$_NORMAL,r0
>>          ret
>>          .end    realp
> 
> Good grief!  I needed an airsick bag and bottle of Tums after reading that.

That bad? Hmmm.

Well - I have not written much Macro-32 the last 25 years so ...

Arne





More information about the Info-vax mailing list