User Tools

Site Tools


cdc:nos2.source:nam5871:lfgmovw

LFGMOVW

Table Of Contents

  • [00003] PROC LFGMOVW(AN,AA,BPOS,NWDS,IW60,CKSM,MEMIN)
  • [00007] MOVE WORDS.

Source Code

LFGMOVW.txt
  1. *DECK LFGMOVW
  2. USETEXT LFGWKBS
  3. PROC LFGMOVW(AN,AA,BPOS,NWDS,IW60,CKSM,MEMIN);
  4. BEGIN #MOVWD#
  5. *IF DEF,IMS
  6. #
  7. ** LFGMOVW - MOVE WORDS.
  8. *
  9. * JJ MCAFEE 75/10/01
  10. * M. E. VATCHER 81/02/23
  11. *
  12. * LFGMOVW MOVES AND SHIFTS LOAD DATA FROM AN INPUT ARRAY TO
  13. * A SM ARRAY.
  14. *
  15. * PROC LFGMOVW(AN,AA,BPOS,NWDS,IW60,CKSM,MEMIN)
  16. *
  17. * ENTRY AN STARTING WORD OF SOURCE ARRAY
  18. * AA STARTING WORD OF DESTINATION ARRAY
  19. * BPOS STARTING BIT POSITION IN DESTINATION ARRAY
  20. * NWDS 16 BIT WORD COUNT
  21. * CKSM CHECKSUM
  22. * MEMIN INPUT BUFFER FWA
  23. *
  24. * EXIT IW60 60 BIT WORD COUNT
  25. *
  26. * METHOD
  27. *
  28. * LFGMOVW PACKS THE MEMORY IMAGE OR OVERLAY IMAGE RECORD INTO
  29. * THE WORKING STORAGE AREA *PDATA*. CHECKSUM IS STORED FIRST.
  30. * THE DATA IS TAKEN FROM SOURCE *INBUF* AND SENT TO DESTINATION
  31. * *PBUF*. THERE ARE TWO POSSIBLE CASES: 1)WHERE ALL THE DATA IS IN
  32. * ONE WORD, AND 2) WHERE DATA IS SPLIT BETWEEN THE WORDS.
  33. * LOOP FOR 105 16 BIT WORDS OR FEWER UNTIL PACKING COMPLETE.
  34. *
  35. #
  36. *ENDIF
  37. ITEM BPOS,NWDS,IW60,CKSM;
  38. ITEM AA;
  39. ITEM AN;
  40. ITEM I U;
  41. ITEM SINDX,DINDX,CKS,AWDS,SST,DST;
  42. ITEM SBC,DBC,SWD,SFCU,SWS;
  43.  
  44. ARRAY MEMIN [0:0] S(1);
  45. BEGIN
  46. ITEM INBUF U;
  47. END
  48.  
  49. FOR I = 0 STEP 1 UNTIL 35 DO
  50. BEGIN
  51. PBUF[I] = 0;
  52. END
  53. SINDX = AN; # SET START OF SOURCE ARRAY #
  54. DINDX = AA; # SET START OF DESTN ARRAY #
  55. IW60 = AA + 1; # NUMBER OF 60 BIT WORDS #
  56. AWDS = NWDS + 1; # NO. OF 16 BIT WORDS#
  57. SST = 0; # SOURCE BIT COUNT #
  58. DST = BPOS; # DESTINATION BIT COUNT#
  59. SBC = 16; DBC = 16;
  60. SWD = CKSM;
  61. GOTO LOOP2; #GO STORE CKSUM FIRST#
  62. LOOP1:IF SST LQ 44 THEN # SOURCE WORD ALL IN ONE #
  63. BEGIN
  64. SWD = B<SST,SBC>INBUF[SINDX];
  65. SST = SST + 16;
  66. IF SST EQ 60 THEN
  67. BEGIN
  68. SST = 0;
  69. SINDX = SINDX + 1;
  70. END
  71. END
  72. ELSE # SOURCE WORD SPLIT OVER 2 #
  73. BEGIN
  74. SFCU = 60 - SST; # SET BFTS LEFT IN WORD 1 #
  75. SWS = 44; # HOLD WORD START POSITION#
  76. # HOLD WORD BFT COUNT #
  77. B<SWS,SFCU>SWD = B<SST,SFCU>INBUF[SINDX];
  78. SST = 0; # RESET START COUNT#
  79. SWS = SWS + SFCU; # ADJUST HOLD WORD START POS#
  80. SFCU = 16 - SFCU; # ADJUST NO. OF BITS LEFT #
  81. SINDX = SINDX + 1; # ADJUST SOURCE INDEX #
  82. B<SWS,SFCU>SWD = B<SST,SFCU>INBUF[SINDX];
  83. SST = SST + SFCU; # ADJUST START POSITION #
  84. END
  85. LOOP2:IF DST LQ 44 THEN # DEST. WORD ALL IN ONE WORD#
  86. BEGIN
  87. B<DST,DBC>PBUF[DINDX] = SWD;
  88. DST = DST + 16; # ADJUST DESIGN. START POS. #
  89. IF DST EQ 60 THEN
  90. BEGIN
  91. DST = 0;
  92. DINDX = DINDX + 1;
  93. IW60 = IW60 + 1;
  94. END
  95. END
  96. ELSE
  97. BEGIN
  98. SFCU = 60-DST; # SET BITS IN FIRST WORD#
  99. SWS = 44; # SET START OF HOLD WORD #
  100. B<DST,SFCU>PBUF[DINDX] = B<SWS,SFCU>SWD;
  101. DINDX = DINDX + 1; # INC. DESTINATION INDEX #
  102. IW60 = IW60 + 1; # INC. 60 BIT WORD COUNT #
  103. SWS = SWS + SFCU; # ADJ. HOLD WORD START POS. #
  104. DST = 0; # ADJ. DEST. WORD START POS.#
  105. SFCU = 16 - SFCU; # ADJ. BIT COUNT #
  106. B<DST,SFCU>PBUF[DINDX] = B<SWS,SFCU>SWD;
  107. DST = DST + SFCU;
  108. END
  109. AWDS = AWDS - 1; #DECREMENT 16 BIT WORD COUNT#
  110. IF AWDS GR 0 THEN GOTO LOOP1;
  111. RETURN;
  112. END
  113. TERM
cdc/nos2.source/nam5871/lfgmovw.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator