DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ S T

⟦d238e64fa⟧ TextFile

    Length: 7952 (0x1f10)
    Types: TextFile
    Names: »STANDARD_ASSEMBLER_INCLUDE_FILE«

Derivation

└─⟦afbc8121e⟧ Bits:30000532 8mm tape, Rational 1000, MC68020_OS2000 7_2_2
    └─ ⟦77aa8350c⟧ »DATA« 
        └─⟦f794ecd1d⟧ 
            └─⟦24d1ddd49⟧ 
                └─⟦this⟧ 

TextFile

        .push_list
        .list none

        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
        ;;
        ;; Debug table macros
        ;;
        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
        
        ;; Assumptions:
        ;;
        ;;    The comp unit's code flows continuously from one subprogram
        ;;    to the next; there are no holes between subprograms.
        ;;    Similarly, a subprogram's code flows continuously from one
        ;;    statement to the next.
        ;;
        ;;    Also, it is assumed that the 'tick' value is grave, and that
        ;;    the section named "debug_hdr_pgm", "debug_hdr_cu", and
        ;;    "debug_body" do not already exist.
        ;;
        ;;    The '@_hdr' sections are the permanent portions of the
        ;;    debug tables; 'debug_body' is the transient portion 
        ;;    (i.e., that which may be dead code eliminated).
        ;;

                          
        state_setup set 0

        .macro setup_state
            .if state_setup = 0
              state_setup set 1
                              
              .push_sect
              .sect debug_hdr_cu, readonly, data, relocatable, alignment := 1
              .sect debug_body, readonly, data, relocatable, alignment := 1
              .pop_sect

              ;;
              ;; We'll associate a version # with the debug tables.
              ;; 

              version_number  equ  3
            
              ;;
              ;; Define some debug table-specific parameters
              ;;

              lex_level  set  0   
              cuc_seen   set  0
              
              eof_tag    equ  0
              pgm_tag    equ  1
              cu_tag     equ  2
              rtn_tag    equ  3
              stmt_tag   equ  4
              sobj_tag   equ  5
            .endif
        .endmacro
                      
        ;; COMP_UNIT_COUNT <num>
        ;;
        
;        .macro comp_unit_count
;            setup_state
;            .if cuc_seen /= 0
;              .error "COMP_UNIT_COUNT can only be emitted once"
;            .elsif %# /= 1
;              .error "COMP_UNIT_COUNT signature bad, must be '<num>'"
;            .elsif %1 < 1
;              .error "number of comp_units must be positive"
;            .else
;              .push_sect
;              .sect   debug_hdr_pgm
;              
;              .dc.b   pgm_tag             ; tell the world we're a program
;              .dc.w   debug_hdr_cu`sibling_count  ; # of comp_units.
;              
;              .pop_sect
;              
;              cuc_seen set 1
;            .endif
;        .endmacro


        ;; COMP_UNIT <id>[, <seg_addr>]
        ;;

        .macro comp_unit
            setup_state
            .if lex_level /= 0 
              .error "There may only be one COMP_UNIT per file"
            .elsif %# = 0
              .error "COMP_UNIT signature bad, must be '<id>, <seg_addr>*'"
            .else         
              .push_sect
              .sect   debug_hdr_cu
            
              .dc.b   cu_tag            ; tell the world we're a comp_unit
              .dc.b   version_number    ; debug table layout type
              .dc.l   %1                ; comp_unit ID
              .dc.w   rtn_cnt           ; # of routines
              .dc.l   sobj_cnt          ; # of static objects
              .dc.b   %# - 1            ; # of segments
              .if %# - 1 /= 0
                .dc.a   %2`segment_offset               ; list of those segments
                .ignore %2`segment_offset
              .endif
              
              .pop_sect
              
              rtn_cnt   set  0
              sobj_cnt  set  0
              stmts     set  0
              lex_level set  1

            .endif
        .endmacro


        ;; END_SUBPROGRAMS
        ;;

        .macro end_subprograms
            .if lex_level < 2 
              .error "END_SUBPROGRAMS must be preceeded by SUBPROGRAM"
            .elsif %# /= 0
              .error "END_SUBPROGRAMS signature bad, must be ''"
            .else
              .if rtn_cnt /= 0 
                rtn_end`rtn_cnt`:
              .endif
            .endif
        .endmacro


        ;; SUBPROGRAM <name>, <kind>, <routine>, <linkage>
        ;;
        
        .macro subprogram                                
            .if lex_level < 1
              .error "SUBPROGRAM must be preceded by COMP_UNIT"
            .elsif %# = 3
              subprogram <anonymous>,%1,%2,%3    ; backward compatibility
            .elsif %# /= 4
              .error "SUBPROGRAM signature bad, must be '<name>, <kind>, <routine>, <linkage>'"
            .else    
              .if rtn_cnt /= 0 
                rtn_end`rtn_cnt`:
              .endif

              rtn_cnt            set  rtn_cnt + 1
                         
              .subsection "%1"
              .indirect cu_data`rtn_cnt`; If we disappear, so does debug data

              .push_sect
              .sect   debug_hdr_cu
              .dc.b   rtn_tag           ; tell the world we're a routine
              .dc.w   (%3 << 4) ! %2    ; kind & rtn_number
              
              .sect   debug_body
              .subsection "%1"
              cu_data`rtn_cnt`:         
              .dc.b   rtn_tag           ; tell the world we're a routine
              .dc.w   (%3 << 4) ! %2    ; kind & rtn_number
              .dc.l   %4                ; linkage info
              .dc.a   rtn_begin`rtn_cnt``segment_offset      ; starting address
              .ignore rtn_begin`rtn_cnt``segment_offset
              .dc.l   rtn_end`rtn_cnt` - rtn_begin`rtn_cnt`  ; routine length
              .ignore rtn_end`rtn_cnt` - rtn_begin`rtn_cnt`
              .dc.w   stmt_cnt`rtn_cnt` ; # of statements

              .pop_sect
              
              rtn_begin`rtn_cnt`:

              stmt_cnt`rtn_cnt`  set  0
              lex_level          set  2

            .endif
        .endmacro
        
        
        ;; STATEMENT <item>, <inline_num>, <sp_adjust>
        ;;

        .macro statement
            .if lex_level < 2
              .error "STATEMENT must be preceded by SUBPROGRAM"
            .elsif %# /= 3
              .error "SUBPROGRAM profile bad, must be '<item>, <inline_num>, <sp_adjust>'"
            .else
              stmt_cnt`rtn_cnt`  set  stmt_cnt`rtn_cnt` + 1
              stmts              set  stmts + 1 

              .push_sect
              .sect   debug_body

              .dc.b   stmt_tag          ; tell the world we're a statement  
              .dc.w   %1                ; item_number
              .dc.b   %2                ; inline_num
              .dc.b   %3                ; sp_adjust
              .dc.a   stmt_begin`stmts` - rtn_begin`rtn_cnt` ; offset from beginning of routine 
              .ignore stmt_begin`stmts` - rtn_begin`rtn_cnt` 

              .pop_sect
              
              stmt_begin`stmts`:

            .endif
        .endmacro
        

        ;; STATIC_OBJECT <object_addr>
        ;;

        .macro static_object                                
            .if lex_level < 1
              .error "STATIC_OBJECT must be preceded by COMP_UNIT"
            .elsif %# < 1
              .error "STATIC_OBJECT signature bad, must be '<expression>+'"
            .elsif %# > 255
              .error "Each call to STATIC_OBJECT limited to 255 expressions"
            .else    
              sobj_cnt  set  sobj_cnt + %#

              .push_sect
              .sect   debug_hdr_cu

;              .dc.b   sobj_tag          ; tell the world we're a static object
;              .dc.b   %#                ; # of static objects
              .dc.a   %1`segment_offset  ; Addresses of static unbased objects
              .ignore %1`segment_offset

              .pop_sect  

            .endif
        .endmacro
        
        
        .pop_list
        .list macro_expansion = none