home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / alt / folklore / computer / 16626 < prev    next >
Encoding:
Text File  |  1992-11-22  |  6.2 KB  |  146 lines

  1. Newsgroups: alt.folklore.computers
  2. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!spool.mu.edu!sdd.hp.com!apollo.hp.com!netnews
  3. From: gardner_c@apollo.hp.com (Cal Gardner)
  4. Subject: Re: The name "BSS" (Was: ASSEMBLY LANGUAGE IBM)
  5. Sender: usenet@apollo.hp.com (Usenet News)
  6. Message-ID: <By5HzG.Bo4@apollo.hp.com>
  7. Date: Mon, 23 Nov 1992 04:04:27 GMT
  8. References: <16NOV92.12250000.0072@VM1.MCGILL.CA> <1egom1INNdk1@early-bird.think.com> <jcmorris.722362695@mwunix>
  9. Nntp-Posting-Host: prism.ch.apollo.hp.com
  10. Organization: Hewlett-Packard Corporation, Chelmsford, MA
  11. Lines: 133
  12.  
  13. In article <jcmorris.722362695@mwunix> jcmorris@mwunix.mitre.org (Joe Morris) writes:
  14. >rst@think.com (Robert Thau) writes:
  15. >
  16. >[in response to what appears to be a request for the net to do someone's 
  17. > class assignment]
  18. >
  19. >>                                                                 I begin
  20. >>with a code fragment for the type 709 electronic data-processing machine
  21. >>(using the FAP assembler):
  22. >
  23. >> [...]
  24. >
  25. >>           However, if we want to use the calling sequence of the library 
  26. >>routines (SINF, COSF, etc. --- we're talking FORTRAN II here, so the 'F' at 
  27. >>the end of the name has semantic content), then the arguments will be in 
  28. >>the AC and MQ, and we may use the following routine:
  29. >
  30. >> MYMIN STQ       SAVEQ
  31. >>       CAS       SAVEQ
  32. >>       XCA
  33. >>       TRA       1,4
  34. >>       TRA       1,4
  35. >> SAVEQ PZE
  36. >
  37. >>Here, the XCA instruction exchanges the contents of the AC and MQ, and the
  38. >>PZE (Plus ZEro) is a dummy operation which assembles a word of zero bits
  39. >>to reserve space.  (I might just as well have punched
  40. >
  41. >> SAVEQ BSS       1
  42. >
  43. >>to reserve a Block (of one word) Starting with the Symbol SAVEQ, but for
  44. >>a block of fewer than 24 words, that would have wasted space in the object 
  45. >>deck.  FAP also supports a BES directive, for Block Ending with Symbol,
  46. >>should you want that).
  47. >
  48. >Which brings up the question: did the symbol "BSS" (as a word to indicate
  49. >a memory area allocated for variable storage in a program) originate with
  50. >FAP?  That's where I first ran into it, and I don't recall having seen it
  51. >in earlier languages.  
  52.  
  53.      UASAP1&2 had the storage allocation psuedocodes
  54.  
  55. >
  56. >Incidentally, the BES pseudo-operation (the word "directive" appeared much
  57. >later) was defined on the 704/709/etc systems because of the way the
  58. >index registers worked:  their contents were *subtracted* from the value
  59. >of the address field to generate the effective address.  (Since the address
  60. >field, the index registers, and the addressing hardware were all 15-bit
  61. >paths you could "add" an index by setting the index register to a negative
  62. >number, 2-s complement style).  Thus, the instructions:
  63. >
  64. >     AXT   5,1        Address to indeX True
  65. >     CLA   FOO,1      CLear accumulator and Add
  66. >
  67. >places the value 5 in index register 1, then loads into the accumulator
  68. >the contents of (FOO-5).
  69. >
  70. >I don't know the reason that the hardware was designed this way, but on 
  71. >result of the decision was that until IBSYS came around the 704/709/7090
  72. >FORTRAN defined arrays in descending order: lower subscript values 
  73. >represented higher storage addresses.  Thus, the FORTRAN declaration:
  74.  
  75.       Look at Fortran generated code, the end control of for loops was
  76.       a TXI followed by a TXH where the 'increment' associated with the
  77.       TXI was a complement value.  If it was a nested for loop, the outer
  78.       loop would also end with the TXI - TXH sequence.
  79. >
  80. >     DIMENSION BAR(10)
  81. >
  82. >would be assembled as:
  83. >
  84. > BAR   BES   10
  85. >
  86. >and might appear in memory as:
  87. >
  88. >   1400   BAR(10)
  89. >   1377   BAR(9)
  90. >   1376   BAR(8)
  91. >   ...
  92. >   1367   BAR(1)
  93. >   1366    <--- value of BAR
  94. >
  95. >Adding to the fun, the 709 FORTRAN assigned arrays row-wise descending,
  96. >the 7090 (FMS) FORTRAN column-wise descending, and the (IBSYS) IBFTC
  97. >compiler used column-wise ascending.  I have a not particularly fond
  98. >memory of trying to rehost to an IBSYS machine a hairy statistical program
  99. >written in assembler for a 709.  I finally told the customer that it would
  100. >be cheaper to rewrite the entire thing from scratch.  (The user didn't
  101. >consult us on this; he just came in and told us to convert the code.)
  102.  
  103.    I must have missed something, as I do not recall anything but column
  104.    storage of arrays.  Can we have a reference, please?
  105.  
  106. >
  107. >Oh yes...for readers curious about Mr. Thau's comment about the BSS
  108. >not being appropriate for less than 24 words, I disagree slightly.  A
  109. >little background:
  110. >
  111. >Binary decks were (to nobody's surprise, I hope) written as 80-byte 
  112. >images, and in most cases were actually punched to pieces of cardboard.
  113. >Each card image included 24 (decimal) words of information: three of 
  114. >loader controls and up to 21 words of program image.  The loader controls
  115. >included the address within the image of the first data word and how
  116. >many data words (up to 21) were on the card.
  117. >
  118. >A BSS or BES did not store any value in memory, so if a BSS/BES appeared
  119. >in the source program whatever was in the current binary card buffer was
  120. >written out, and the next card was not started until somthing in the
  121. >source program required that a memory word be initialized.
  122. >
  123. >A series of contiguous BSS and/or BES pseudo-ops which together reserved
  124. >21 words or more were always more efficient than memory-initializing 
  125. >operations like PZE.  On the average they were usually more efficient
  126. >if they totalled 11 words or more, and usually were not as efficient if
  127. >the total was under 11 words.
  128.  
  129.      An ORG statement would also purge the punch buffer.  Going way back to
  130.      704, it way sometimes important that less than a full card be produced.
  131.      For example, the DS2 on-line dump routine was loaded with a sneak-on
  132.      sequence that managed to save the entire machine except for locations
  133.      0 and 1 plus the MQ register.  Note: on the 704 the Load Cards button
  134.      forced the hardwired execution of the following instruction sequence:
  135.  
  136.                  RDS  CDR    (Read Select the Card Reader)
  137.                  CPY  0      (Copy contents of 12 row left to location 0)
  138.                  CPY  1      (Copy contents of 12 row right to location 1)
  139.                  TTR  0      (Trap Transfer to location 0)
  140.                              (TTR always jumped - it ignored the trapping mode)
  141.  
  142. >
  143. >Joe Morris / MITRE
  144.  
  145.  
  146.