home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.os.vms      DEC's VAX* line of computers & VMS.      264,096 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 262,606 of 264,096   
   =?UTF-8?Q?Arne_Vajh=C3=B8j?= to All   
   Re: Clair Grant on VMS code base   
   06 Apr 25 20:58:43   
   
   From: arne@vajhoej.dk   
      
   On 4/6/2025 8:34 PM, Arne Vajhøj wrote:   
   > On 4/4/2025 2:00 PM, Simon Clubley wrote:   
   >> It basically parses, validates, and executes commands it has been given.   
   >> That is something which can be implemented a lot more easily and   
   >> concisely   
   >> in a HLL with abstracted data structure capabilities (which includes   
   >> even C) than an assembly language with no such capabilities.   
   >   
   > It is not obvious to me that:   
   >   
   > (LOC/FP for Macro-32) / (LOC/FP for C)   
   >   
   > is a lot higher for a shell than for the average application - data   
   > structures are not anything special for shells.   
   >   
   > But maybe.   
      
   And Macro-32 can be used to work with data structures.   
      
   Many have worked with FAB and RAB in Macro-32. :-)   
      
   To illustrate:   
      
   $ type ds.c   
   #define MAX_LEN 80   
      
   struct data   
   {   
        int v;   
        int slen;   
        char s[MAX_LEN];   
   };   
      
   void m(struct data * d)   
   {   
        d->v = d->v + 1;   
        d->s[d->slen] = 'X';   
        d->slen += 1;   
   }   
      
   $ type ds.mar   
            .title  ds   
   MAX_LEN=10   
   V=0   
   SLEN=V+4   
   S=SLEN+4   
   X=88   
            .psect  $CODE quad,pic,con,lcl,shr,exe,nowrt   
            .entry  m,^m<>   
            movl    4(ap),r0   
            addl2   #1, V(r0)   
            movab   S(r0), r1   
            addl2   SLEN(r0), r1   
            movb    #X, (r1)   
            addl2   #1, SLEN(r0)   
            ret   
            .end   
   $ type dstest.for   
          program dstest   
          structure /data/   
            integer*4 v   
            integer*4 slen   
            character*80 s   
          end structure   
          record /data/buf   
          buf.v = 123   
          buf.s = 'ABC'   
          buf.slen = len('ABC')   
          call m(buf)   
          write(*,*) buf.v, buf.s(1:buf.slen)   
          end   
   $ for dstest   
   $ cc ds   
   $ link dstest + ds   
   $ run dstest   
            124 ABCX   
   $ macro ds   
   $ link dstest + ds   
   $ run dstest   
            124 ABCX   
      
   Arne   
      
   --- SoupGate-DOS v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca