! File: CSWO.RTN ! ! This work was supported by the Advanced Research ! Projects Agency of the Office of the Secretary of ! Defense (F44620-73-C-0074) and is monitored by the ! Air Force Office of Scientific Research. ! Module CSWO = Begin Require 'bliss.req'; ! create a symbol with offset Global Routine CREATESWO(SYMBOL : Ref ST,OFF : Integer) = ! Ref ST Begin Local X : Ref ST, L : Ref GT, T : Ref ST; ! get the symbol displacement. if zero, then use this symbol OFF = .OFF; If .OFF Eql 0 Then Return .SYMBOL; X = BASESYM(.SYMBOL); ! search the symbol alias list for a matching displacement. ! (what happens to something like: A+1-1 ?) T = .X[st_var_next]; While .T Neqa 0 Do Begin If .T[st_var_base] Eqla .X Then If .T[gt_disp] Eql .SYMBOL[gt_disp]+.OFF Then Exitloop; T = .T[st_var_next] End; ! if not found, create a new symbol alias instance If .T Eqla 0 Then Begin T = GETSPACE(.STSZ[.SYMBOL[gt_type]]); MOVECORE(.SYMBOL,.T,.STSZ[.SYMBOL[gt_type]]); If Not .T[st_v_namexp] Then Begin T[st_v_namexp] = TRUE; T[st_var_base] = .SYMBOL End; T[gt_disp] = .T[gt_disp] + .OFF; T[st_var_next] = .X[st_var_next]; X[st_var_next] = .T End; Return LEXOUT(T_SYMBOL,.T) End; End Eludom