.TITLE ISD3 .IDENT /HAH012/ .enabl lc ; ; Modified: 27-Jul-85 hah010 ; Convert SELECT subroutine to support DOB as a I&D space task. ; 06-Aug-85 hah012 ; Add extra error messages. ; ; ISD3 is the routine that takes apart any Internal Symbol Definition entries ; created by a source language compiler, or by TKB when TKB is creating a ; STB file for a program that has a /DA in the command line. ; ; Note that any .OBJ or .STB files that contain ISD entries CANNOT be re- ; assembled by MAC without deleting the ISD information, since MAC does ; not allow ISD records to be created. ; ; MACROs ;hah010 ; ;hah010 .macro select table ;hah010 mov r0,-(sp) ;Save R0 (restored by SELECT) ;hah010 mov table, r0 ;hah010 call select ;hah010 .endm ;hah010 .asect .=1 is.tkb:: .blkb 1 ;TKB generated is.lan:: .blkb 1 ;Language processor generated is.rel:: .blkb 1 ;Relocated IS.LAN record is.txt:: .blkb 1 ;Text record ; ; TKB generated record types ; .=1 it.seg:: .blkb 1 ;Start of segment it.tsk:: .blkb 1 ;Task identification it.lib:: .blkb 1 ;Autoloadable Library entry point ; ; Language generated and TKB modified language generated record types ; .=1 il.mod:: .blkb 1 ;Module name il.sym:: .blkb 1 ;Global symbol name il.psc:: .blkb 1 ;PSECT name il.pc:: .blkb 1 ;Line number or PC correlation il.isn:: .blkb 1 ;Internal symbol name .psect rodata,ro,d isdsr0:: .ascii /; ISD entry, NOTE: This module cannot be reassembled with/ isdsr1:: .ascii /; ISDs in it, since MACRO does not support it./ isdsr2: ;End of second message isdend:: .asciz /; End of ISD entry/ isden1: ;End of message isd1.1:: .asciz /Start of segment/ isd1.2:: .asciz /Task identification/ isd1.3:: .asciz /Autoloadable Library Entry Point/ isd2.1:: isd3.1:: .asciz /Module name/ isd2.2:: isd3.2:: .asciz /Global symbol/ isd2.3:: isd3.3:: .asciz /PSECT/ isd2.4:: isd3.4:: .asciz /Line number or PC correlation/ isd2.5:: isd3.5:: .asciz /Internal symbol name/ isd4.0:: .asciz /Literal record/ .even table: ;hah010 .byte is.tkb,is.txt ;Valid limits ;hah010 .word illcod ;Illegal type code ;hah010 .word istkb+1 ;TKB record ;hah010 .word islan+1 ;Language generated record ;hah010 .word isrel+1 ;Relocated language generated record ;hah010 .word istxt+1 ;TEXT record, output as .WORD or .BYTE ;hah010 table1: ;hah010 .byte it.seg,it.lib ;Valid record limits ;hah010 .word illcod ;Bad record number ;hah010 .word itseg+1 ;Segment name descriptor (called) ;hah010 .word ittsk+1 ;Task ID code (called) ;hah010 .word itlib+1 ;Autoloadable Lib. entry point (called) ;hah010 table2: ;hah010 .byte il.mod,il.isn ;Valid subrecord limits ;hah010 .word illcod ;Bad record number ;hah010 .word ilmod+1 ;Module name ;hah010 .word ilsym+1 ;Global symbol name ;hah010 .word ilpsc+1 ;PSECT name ;hah010 .word ilpc+1 ;Line number or PC correlation ;hah010 .word ilisn+1 ;Internal symbol definition ;hah010 .psect rwdata,rw,d rel: .word 0 ;0 if is.lan, 1 if is.rel .psect code,ro ; ; Entry conditions: ; r3 = Address of input record ; r4 = Length of input record remaining ; ; Exit conditions: ; Records processed and printed ; .enabl lsb .mcall put$s isd3:: sub #2,r4 ;Any record left? bpl 5$ ;Yes, continue ;hah012 trap isdlen ;Bad record length ;hah012 5$: ;hah012 put$s #fdbout,#isdsr0,#isdsr1-isdsr0 put$s #fdbout,#isdsr1,#isdsr2-isdsr1 mov fdbout+f.nrbd+2,r5 ;Get the start of the buffer movb (r3)+,r1 ;Get the type code inc r3 ;Unused byte select #table ;hah010 put$s #fdbout,#isdend,#isden1-isdend ;Tell user done with entry return ;Done illcod: trap objfmt ;Illegal code if we get here ; ; The record is a TKB produced record. Handle the appropriate record type. ; istkb:: sub #2,r4 ;Any record left? bpl 20$ ;Yes ;hah012 trap isdlen ;Record length error ;hah012 20$: ;Process next subrecord mov r3,-(sp) ;Save start of subrecord movb (r3)+,r1 ;Get the subrecord type movb (r3)+,r0 ;Get the subrecord length mov r0,-(sp) ;Save the subrecord length sub #2,r0 ;Count header as processed bgt 22$ ;Continue ;hah012 trap isdlen ;Record length error ;hah012 22$: ;hah012 select #table1 ;hah010 mov (sp)+,r0 ;Get the subrecord length back mov (sp)+,r3 ;Restore start of this subrecord add r0,r3 ;Point to next subrecord sub r0,r4 ;Any more to process? bgt 20$ ;Yes return ;Done ; ; Language processor created records ; islan:: clr rel ;Not a relocated record br 30$ ;Continue ; ; TKB altered language processor created records ; isrel:: mov #1,rel ;A relocated record 30$: sub #2,r4 ;Any record left? bpl 40$ ;Yes, continue ;hah012 trap isdlen ;hah012 40$: ;Process next subrecord mov r3,-(sp) ;Save the start of the subrecord movb (r3)+,r1 ;Get the subrecord type movb (r3)+,r0 ;Get the subrecord length mov r0,-(sp) ;Save the subrecord length sub #2,r0 ;Count header as processed bpl 42$ ;Continue ;hah012 trap isdlen ;Bad record length ;hah012 42$: ;hah012 select #table2 ;hah010 mov (sp)+,r0 ;Get the subrecord length back mov (sp)+,r3 ;Get the start of the subrecord back add r0,r3 ;Point to next subrecord sub r0,r4 ;Any more to process? bgt 40$ ;Yes return ;Done ; ; Language processor specific text records (format undefined) ; istxt: return ;Just dump as .WORDs and .BYTEs ; ; TKB produced segment descriptor entry ; itseg:: call outcom ;Put in the semicolon mov #isd1.1,r0 ;Identify ourselves call append ;Copy it call print ;And print it call outcom ;Another semicolon mov #itseg1,r0 ;Name of segment call append ;Copy it mov r3,r0 ;Point to segment name call addr50 ;Convert it call print ;Print it add #4,r3 ;Point past name call outcom ;Another semicolon mov #itseg2,r0 ;Descriptor address call append ;Copy message mov (r3)+,r0 ;Get the address call addoct ;Put in the address call print ;Print the line return ;Done with the entry .psect rodata itseg1:: .asciz /Segment name = / itseg2:: .asciz /Segment descriptor address = / .psect code ; ; TKB produced task ID block ; ittsk:: call outcom ;Put in leading semicolons mov #isd1.2,r0 ;Print our banner call append ;Copy it call print ;Show it call outcom ;Put in a leading semicolon mov #ittsk1,r0 ;Say when it was built call append ;Move it into buffer mov r5,r0 ;Move up line address mov r3,r1 ;Copy the date pointer call $dat ;Convert date to ASCII mov r0,r5 ;Copy line pointer back mov #ittsk2,r0 ;Next part of message call append ;Copy it mov r5,r0 ;Copy line pointer add #6,r3 ;Point to time mov r3,r1 ;Copy time pointer mov #5,r2 ;Print to decimal of a second call $tim ;Translate the time also mov r0,r5 ;Put line pointer back call print ;Print it add #12,r3 ;Point past time add #4,r3 ;Skip these since return ; last two words unused .psect rodata ittsk1:: .asciz /Task created on / ittsk2:: .asciz / at / ittsk4:: .asciz /Last two words:/ .psect code ; ; TKB generated autoloadable library entry point ; ; .if eq, 1 itlib:: call outcom ;Put out a semicolon mov #isd1.3,r0 ;Get out banner call append ;Put in buffer call print ;Print it call outcom ;Another semicolon mov #itlib1,r0 ;Symbol name message call append ;Move it mov r3,r0 ;Point to the symbol name call addr50 ;Output it add #4,r3 ;Point past the symbol name call print ;Print it call outcom ;Another semi mov #itlib2,r0 ;Flags banner call append ;Output it mov (r3)+,r0 ;Get the flags byte call addoct ;Output it call print ;Print the line call outcom ;Put out a semicolon mov #itlib3,r0 ;Offset message call append ;Copy message mov (r3)+,r0 ;Get the offset call addoct ;And put in print line call print ;Print the offset call outcom ;Put in another semicolon mov #itlib4,r0 ;Segment descr. offset message call append ;Copy it mov (r3)+,r0 ;Get the offset call addoct ;And output it call print ;Print the line return ;Done .psect rodata itlib1:: .asciz /Symbol name = / itlib2:: .asciz /Flags byte = / itlib3:: .asciz /Entry point offset from library base = / itlib4:: .asciz /Segment descriptor offset from $$SGD1 = / .psect code ; ; Ilmod - Language processor module name record ; ilmod:: ilsym:: ilpsc:: ilpc:: ilisn:: return ;Code not written yet! .psect rodata ilmod1:: .asciz /Language = / ilmod2:: .asciz /Module name = / .even ilnam:: .enabl lsb .word 10$ .word 0 .word 20$ ilmax == <.-ilnam>/2 ;Maximum number of supported lang. 10$: .asciz /Macro-11/ 20$: .asciz /Fortran-77/ .dsabl lsb .psect code ; ; Outcom - Insert a leading semicolon into a line ; ; Entry: ; r5 > Start of line ; outcom:: movb #';,(r5)+ ;Put in a semicolon movb #11,(r5)+ ;Put in a tab return ;Done ; ; Print - Print the line to the output file ; ; Entry: ; r5 > End of line ; f.nrbd+fdbout+2 > Start of line ; print: sub f.nrbd+fdbout+2,r5 ;Calculate length of line put$s #fdbout,,r5 ; and output it mov f.nrbd+fdbout+2,r5 ;Point to start of next line return ;Done .psect rodata .even .end