.ENABL LC YES=1 NO=0 .TITLE MCMD ;MCMD.MAC .IDENT /12DEC7/ .PSECT MCMD .LIST TTM DIM=0 .MACRO MC A .NCHR U$ .BYTE U$ .ASCII ~A~ DIM=DIM+1 .ENDM ; ----------------------------------------------------------------------- ; the following table is in the format of an mp string. ; That is, it has 6 header words followed by the strings (each string ; is preceded by the count of characters - no word allignment) ; ; The table can be expanded simply by entering a new command in the ; any slot. the labels size, dim, and dimen are ; computed by the assembler and need not be of concern when adding entries. ; ; This string is loaded into a separate overlay and then "read" as though ; it were coming from a file except that it is faster. note that these are ; not loaded until the macro library is read. ; ; ----------------------------------------------------------------------- mcmd:: .word size ;length (used when dynamic strings - But necessary) .word dimen ;dimension (number of entries) .word size-30. ;current length used by xstring to check overflow .word 255. ;string size overflow (checked by xstrin) .word 0 ;not used but allocated .word dimen ;dimension used by xstring ;------------------------------------------------------------------------ ; 1ST-- change to mc form: 5,$c-^-MC <- c-$->-3y ; change back: 5,$g;mc <;c/mc $;; ; find comments and fix: 5,$g/mc <;/c/mc <;/;/c/>$// ; This shortens up $macro lines but is not reversible ~5,$g/\$macro/c3/ /> ;/ ; This library supports the c calls to the Conroy's runtime system ; ; - - - - - - - - - - - - - - - - - - - - - - - - - - - ; currently defined symbols ; $temp$ set to maximum storage used by temps. ; $top$ set to relative zero of a file (for odt use) ; $auto$ counts local storage ; $auto. for local storage counting ; $type$ routine in main lib to type out a line to lun 5 ; $buf$ a 140. byte scratch buffer i main (for printf usage ) ; ; switch usage: ; 1-15 are internal of course ; 16 used to indicate a byte array in leta (transient use) ; 17-18 also temporary usage ; 19 optimize flag set for entire run ; 20 used to determine when to clear symbol table ; 21 also used, needed in case no auto statements ; 29 this suppresses the output from $$tim (when just debugging) ; ; ; Symbol table usage: ; ; type usage ; 1 auto variables, append (r5) arrays local ; 2 pointer or function parameter, append (r5) arrays = pointer ; 3 external to function, (not necessary global) for debugger ; 10-15 register r0-r5 equivalent (not yet implemented) ; ; ; ; string stack absolute usage ; ; 60 gets string %x (e.g. %2) to use when optimizing ; 59 gets psect name of last user .psect ; 58 gets time of compilation ; ; ; The stack is used as follows: ; ; If (stack 1) ; tos branch to on false ; nos go here one done (after elseif's etc) ; ; case (stack 2) ; tos break to label ; nos variable to test ; 3os skip over to next case test label ; 4os case or label ; ; Do while/forever (stack 2) ; tos break to ; nos jmp back to test or continue in loop label ; ; loop (stack 2) ; tos break to ; nos jmp back to test for more looping label ; 3os loop index ; 4os step amount ; ; - - - - - - - - - - - - - - - - - - - - - - - - - - - ; mov is now done internally for speed ;;; $MACRO> ;MOV ;CHECK FOR MOV #0,X AND DO A CLR ;;; i%in -2.(r5) <#@1 #@2> <> ;;; I%IDN <#@1> #0 < clr #@2> < i%dout < mov #@1,#@2>> ;;; $ENDM ; - - - - - - - - - - - - - - - - - - - - - - - - - - - ;;;$MACRO $$$$$$5 ;;;I%DOUT ;;;$ENDM ; - - - - - - - - - - - - - - - - - - - - - - - - - - - MC <$MACRO IF> ;A = B > MC MC MC MC ; ; Note that the below causes right to left evaluation of ; relations. IF a = b and c = d or d = f ; is ; equiv to IF (a = b and (c =d and (d = f))) ; in a paren'd expression (not permitted of course) ; MC MC ,>>> MC ,<#@{3}>> MC < B#@G #@J> MC ,<#@H=.>> MC , >>> MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - MC <$MACRO IFB> ;A = B > MC MC MC MC ; ; Note that the below causes right to left evaluation of ; relations. IFB a = b and c = d or d = f ; is ; equiv to IFB (a = b and (c =d and (d = f))) ; in a paren'd expression (not permitted of course) ; MC MC >> MC MC < B#@G #@J> MC > MC >> MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - MC <$MACRO O%R> ;BR.TO > MC <#@2> MC < BR #@1> MC MC <#@G=.> MC MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - MC <$MACRO A%ND> ;A = B ...> MC <#@2> MC MC < BR #@F> MC MC <#@G=.> MC MC < BR #@1> MC <#@F=.> MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - MC <$MACRO FI> ; COMMENT> MC MC <#@2=. ; #@1> MC MC <#@2=.> MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - MC <$MACRO ELSE> ;COMMENT> MC MC MC MC < JMP #@6> MC <#@5=. ; #@1> MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - MC <$MACRO ELSEIF> ;...> ;get nos MC MC < JMP #@H> MC MC <#@F=.> MC MC > MC MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - MC <$MACRO .> ;just a short way to do functions> MC > MC <$ENDM> ; ------------------------------------------ ;specialized add and sub macros, they test for #1 and do increments ; note they only check parameter 2 (i.e. sub* a,b is backwards to ; what the sub machine code is (I can't remember why). ; at any rate, the Let statement knows this. ; they now also check for optimize setup ; MC <$MACRO SUB*> MC <>> MC <#1,#1.> << DEC #@1> < DEC #@1>> < SUB #@2,#@1>> MC <$ENDM> ; ------------------------------------------ MC <$MACRO ADD*> MC <>> MC <#1,#1.> << INC #@1> < INC #@1>> < ADD #@2,#@1>> MC <$ENDM> ; ------------------------------------------ MC <$MACRO $"> MC MC < BR #@6> MC <#@5=.> MC < .ASCIZ _#@1_> MC < .EVEN> MC MC <#@6=.> MC <$ENDM> ; ------------------------------------------ MC <$MACRO $&> MC MC < MOV ##@1,-(SP) ;push offset> MC < ADD R5,(SP) ;and compute address of #@1> MC <$ENDM> ; ------------------------------------------ MC <$MACRO POP> MC < MOV (SP)+,#@{1}> MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - MC <$MACRO PUSH> MC MC MC MC <(SP)+> < MOV #@1,-(SP)>> MC MC <$ENDM> ; ------------------------------------------ MC <$MACRO call> MC < JSR PC,#@1> MC <$ENDM> ; ------------------------------------------ MC <$MACRO LOOP> ;FOR I = FROM TO "TO"> ; watch out for which portions of the statement is lower case ; and the loop index must match in case with the next statement also. MC <> <> >> MC MC > MC MC MC MC ;Init loop index MC >> MC <#@A=.> ; done loop? MC < CMP. <#@{2}>,<#@{6}>> ;I%IN <#@5> < > > MC < > >> MC MC < B#@C #@D> MC < JMP #@B> MC <#@D=.> MC <$ENDM> ; ------------------------------------------ ; New do macro, recurs with if(b) macro - needs lots of stack space. MC <$MACRO DO> ;WHILE(B) THIS IS THAT> ; 1 2 3 4 MC MC ; push the two labels such that the top is the place to break to ; and the next on stack is the loop back place MC ; This is the loop back label MC <#@G=.> ; test the condition MC >> MC >> MC FOREVER > MC FOREVER < JMP #@H ;else end while loop>> MC FOREVER > MC <$ENDM> ; ------------------------------------------ MC <$MACRO OD> ;end of do loop (while or forever)> ; Get next to tos (nos) MC MC < JMP #@1 ;Repeat loop> MC MC <#@1=.> MC MC <$ENDM> ; ------------------------------------------ MC <$MACRO NEXT> ;INDEX> MC MC ,<#@2>> > MC MC < JMP #@2 ;back to top> MC MC MC MC <#@2=.> MC MC <#@2> >> MC MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - MC <$MACRO N%EXT> MC < clr -(sp)> MC >> MC < add (sp)+,#@{1}> MC <$ENDM> ; ------------------------------------------ MC <$MACRO BR.> ;sets str 25 to inverse branch> MC <= EQ NE LT GT GE LE CC CS><>> MC <>> MC <$ENDM> ; ------------------------------------------ MC <$MACRO !> ;Simply sets str 25 to its first parm so the above fits on 2 lines.> MC ,,25> MC <$ENDM> ; ------------------------------------------ ; special case compare, checks for second arg being #0 and gens a test MC <$MACRO CMPB.> ;A,B> MC >< CMPB #@1,#@2>>> MC <$ENDM> ; ------------------------------------------ ; 1 2 3 MC <$MACRO SELECT> ;case var of ...> ;Make 2 labels MC ;Put no or indicator onto stack MC MC MC MC MC <$ENDM> ; ------------------------------------------ ; 1 from stack MC <$MACRO CASE> ;var (label newlabel)> ; ; Case construct is as follows: ; ; Multiple cases going to the same code is by using the OR parameter ; of the case statement. example: ; ; CASE 1 OR ; CASE 2 OR ; ... ; CASE N ; ; if an "or" ; if -nor- ; if label ; if not "or" ; if -nor- do nothing ; if label ; ; ; ; MC ;put string in 3os (3rd from top of stack) into parm-4 MC MC <#@4=.> ;place new label into 3os MC ;get var into parm4 MC MC > MC < BNE #@3> ;get -nor- or label if present into parm4 from 4os MC MC MC OR -nor- >> MC MC MC OR < BR #@4>> MC MC -nor- >> MC > MC MC <$ENDM> ; ------------------------------------------ ; 1 from stack MC <$MACRO DEFAULT> ; var (label newlabel)> MC ;put string in 3os into parm-2 MC MC <#@2=.> ;place new label into 3os MC ;get var into parm-2 MC MC <$ENDM> ; ------------------------------------------ ; 1 from stack MC <$MACRO CASEB> ;var (label newlabel)> ; ; Case construct is as follows: ; ; Multiple cases going to the same code is by using the OR parameter ; of the case statement. example: ; ; CASEB 1 OR ; CASEB 2 OR ; ... ; CASEB N ; ; if an "or" ; if -nor- ; if label ; if not "or" ; if -nor- do nothing ; if label ; ; ; ; MC ;put string in 3os (3rd from top of stack) into parm-4 MC MC <#@4=.> ;place new label into 3os MC ;get var into parm4 MC MC > MC < BNE #@3> ;get -nor- or label if present into parm4 from 4os MC MC MC OR -nor- >> MC MC MC OR < BR #@4>> ;I%SW 20 MC MC -nor- >> MC > MC MC <$ENDM> ; ------------------------------------------ MC <$MACRO ESAC> ;VAR1> MC MC MC MC MC ,#@3,>>> MC <#@2=.> MC <#@4=.> MC <$ENDM> ; ------------------------------------------ MC <$MACRO BREAK> ;get top string into parm-15 MC MC < I%NB <#@1> <#@1 <#@*(2"C)>>> MC < JMP #@F ;break> MC < I%NB <#@1> FI> MC <$ENDM> ; ------------------------------------------ MC <$MACRO PEEK> MC MC <[#@1]> MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - MC <$MACRO C> ;Call a c prog as: C var = name[abc]> MC MC < mov r0,#@1>> MC <$ENDM> ;$MACRO C Call> ;a c prog as: C var = name[abc] ;;i%idn <#@1> <:=> > ;;i%df <#@1> <:=> < mov r0,#@1>> ;$ENDM ; - - - - - MC <$MACRO FPRINTF> MC MC MC ]> MC MC MC MC <$ENDM> ; - - - - - MC <$MACRO PRINTF> MC < mov r0,-(sp)> MC < mov r1,-(sp)> MC ]> MC < mov #$buf$,-(sp)> MC < jsr pc,$type$> MC < mov (sp)+,r1> MC < mov (sp)+,r0> MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - ; Finally these are defined. They clobber r0 and/or r1 (mul uses r1 ; div uses both) ; BE careful with these. MC <$MACRO MUL45> MC <>> MC < asl #@1>>> MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - MC <$MACRO MUL%45> ;A * B A = A * B> MC < mov #@2,r1> MC < mul #@1,r1> MC < mov r1,#@1> MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - MC <$MACRO DIV45> ;A B A = A / B> MC <>> MC < mov #@1,r1> MC < sxt r0> MC < div #@2,r0> MC < mov r0,#@1> MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - ; MC <$MACRO FOR> ;INIT-1 CONDITION-2 REINIT-3> ; This is a for loop like C or ratfor ; MC <> <> >> MC MC > MC MC > MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - MC <$MACRO ROF> ; the ending statement in a for loop MC MC > MC MC <$ENDM> ; ------------------------------------------ MC <$MACRO F%%D> MC MC <#@1=#@A> MC <> << #@A=#@A+2>> < #@A=#@A+<#@2>>> MC <$ENDM> ; ------------------------------------------ ; the following is called at file top with the date and time MC <$MACRO $$TIM> MC MC ,,58> MC < .ident /#@=1(1:2)#@=1(4:6)#@=1(9:9)/>> MC >> MC <$ENDM> ; ------------------------------------------ MC <$MACRO LETA> ;1 = 3 + 5> MC # > MC MC > MC MC < clr -(sp)> ;I%IDN <#@1> <#@3> > ;I%IDN <#@1> <#@3> > ;I%DF <#@1> <#@3> > MC > MC MC < movb (sp)+,@(sp)+>> MC <$ENDM> ; ------------------------------------------ MC <$MACRO LET%A> MC > MC <$ENDM> ; ------------------------------------------ MC <$MACRO ZERO> MC >> MC < clr #@{1}> MC <$ENDM> ; ------------------------------------------ MC <$MACRO MOVE> MC = <#@1>> MC <$ENDM> ; ------------------------------------------ MC <$MACRO optimize> ; using rx> ; here we undefine all registers except r2 ; so if user trys using r2 we will force some error. ; at least a taskbuild undefined. ; then we use %2 ourselves instead of -2.(r5) code ; this is a post optomise and only add* mul45 div45 sub* and mov ; check for these. MC <.dsabl reg> MC MC MC > MC > MC > MC MC MC MC MC <$ENDM> ; ------------------------------------------ MC <$MACRO DMPSTR> MC > MC > MC MC MC <** $%D 1 2 3 4 5 6 7 8 9> MC <** $%D 10 11 12 13 14 15 16 17 18 19> MC <** $%D 20 21 22 23 24 25 26 27 28 29> MC <** $%D2 30 31 32 33 34 35 36 37 38 39 > MC <** $%D2 40 41 42 43 44 45 46 47 48 49> MC <** $%D2 50 51 52 53 54 55 56 57 58 59 60> MC > MC > MC MC MC <$ENDM> ; ------------------------------------------ ; MC <$MACRO $%D> MC MC > MC <$ENDM> ; ; ------------------------------------------ MC <$MACRO $%D2> MC MC > MC <$ENDM> ; ; ------------------------------------------ MC <$MACRO DMPSW> MC <** S%%W 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15> MC <** S%%W 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32> MC <$ENDM> ; ; ------------------------------------------ MC <$MACRO S%%W> MC > MC <$ENDM> ; ; ------------------------------------------ MC <$MACRO DUMP> MC MC MC MC MC < >> MC <$ENDM> ; ; ------------------------------------------ MC <$MACRO POKE> ;STACK STRING> MC ,,#@1> MC <$ENDM> ;------------------------------------------------------------------------ MC <$MACRO SETLAB> ;LAB> ;This allows one to set the label used for generating labels MC MC <$ENDM> ; ------------------------------------------ MC <$MACRO .END> ; The following trap the .end statement and verify all constructs ; have been terminated. It checks the current level of the stack ; by pushing .end and verifying that they are in position 1 of ; both stacks. MC MC MC MC MC <.END.END> >> MC MC MC <$temp$=#@#1.> MC > MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - MC <$MACRO STRUCT> ;name> MC MC < #@1=0> MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - MC <$MACRO END-STRUCT> MC MC >>> MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - MC <$MACRO FIELD> ;name1,name2...> MC <** F%%D <#@*(1"N)>> MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - MC <$MACRO MEMBER> ;name1,name2...> MC <** F%%D <#@*(1"N)>> MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - MC <$MACRO BEGIN> ; name> MC
> MC > ; ; allow for a name here. This is only here ; to check mismatched begin/ends ; MC <$ENDM> ; ------------------------------------------ MC <$MACRO BEGIN$$> MC MC < BR #@1> MC MC > MC <#@2: JMP #@3> MC <#@1:> MC <$ENDM> ; ------------------------------------------ MC <$MACRO END> MC MC <#@2> >>> MC <$ENDM> ; ------------------------------------------ MC <$MACRO PROGRAM> ;NAME> MC MC ; set switch 20, auto will clear symbol table and clear 20. func sets it MC ; The following symbol will here be set to 0 since it is not ; yet defined. However, on the second pass of the assembler, it ; will be defined so this initialization only occurs on pass 1. ; The .end statement will define it to the max temps used so ; on pass2 it will be that value and not zero. No storage is ; allocated using this symbol (no static assembler storage). It ; is used at run time to decr the stack when allocating temps and ; locals. MC <.iif ndf $temp$ $temp$=0> ; This counter will be used to track temp usage. We will allways ; allocate at least the following. MC MC <$top$=.> MC MC <$auto$=$temp$> MC <.enabl lc> MC > MC > MC < .title #@1>> MC <$ENDM> ; ------------------------------------------ MC <$MACRO ELSEIFB> ;...> ;get nos MC MC < JMP #@H> MC MC <#@F=.> MC MC MC MC <$ENDM> ; ------------------------------------------ MC <$MACRO $NOP> MC <$ENDM> ; ------------------------------------------ ; Function sets up offsets according to how the Conroy save and restore ; routines allocate storage off the stack ; it also allocates storage for locals. Then it clears ; the local (auto) storage counter for the next function later on. ; ; Usage of C function compatible routines ; ; program lab |used once ; |------------ ; auto l1 l2 l3 ... | Function 1 ;FUNCTION entry[p1,p2 ...] | ; ... | code is here ; ret [value] | ; | ; |------------- ; auto l1 l2 l3 ... | Function 2 ;FUNCTION entry2[p1,p2 ...] | ; ... | code is here ; ret [value] | ; |------------- ; ; ; All variables are referenced as xxx(r5) ; and are call by value as in C. ; ; MC <$MACRO FUNCTION> ;A[B,C,D] IS LOCAL> MC > MC MC > MC MC ; trace will cause the function name and argument values to be printed ; on entry. The top of the file (for odt use) is also output. The odt ; option will cause an iot trap to odt. ; trace is switch 17, (x7) odt entry is 18 (x8) MC LOCAL > MC > MC > MC MC <$ENDM> ; ------------------------------------------ MC <$MACRO T%%> MC MC < br #@I> MC <#@J=.> MC < .ascii '#@1:%6o top=%6o'> MC <** T%%1 <#@*(2"N)>> MC < .byte 0> MC < .even> MC <#@I=.> MC MC <#@H=.> MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - MC <$MACRO T%%1> MC < .ascii ' #@1=%o'> MC <$ENDM> ; ------------------------------------------ MC <$MACRO F%UNC> ;A,B,C,D...> MC MC <** #@*(2,Z)> ; num 9 now contains # args in this function ; .word #@#9 ;number of arguments MC > MC > MC > MC > MC > MC > MC <** E%%S <#@*(3"Z)>> MC > MC <#@2#@1> MC < jsr r0,$$csav>> ; get label pointing to function record if debugger on MC > MC > MC < add #$auto$,sp> MC < $auto.=$auto$> MC < $auto$=$temp$> MC <$ENDM> ; ------------------------------------------ ; func used to be the only macro (i.e. no Function) ; some older programs specify this macro instead - so it remains. ; it also is the only way to have a function without the name being ; declared global. ;$MACRO FUNC P1> ;P2 P3... Use Conroys runtime here. ; pass each argument separately to e%%s ;** E%%S <#@*(1"Z)> ; ;note that $auto$ is negative, thus we ADD to sub from stack ; save current $auto$ in $auto. for the return ; but re-init $auto$ in case there is no return statement ; note: we don't need to pop off stack storage on return since ; the frame pointer - r5 - has enough info to do it. But we ; didn't know this at first, so we still fuss with these labels. ; jsr r0,$$csav ;get stack frame ; add #$auto$,sp ;allocate space on stack for autos ; $auto.=$auto$ ; $auto$=$temp$ ;re-init ;$ENDM ; - - - - - - - - - - - - - - - - - - - - - - - - - - - MC <$MACRO E%%S> MC MC <#@1=#@#2.> MC MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - MC <$MACRO RET> ; This version will allow any kind of expression> MC > < mov #@{1},r0>>> MC > ; sub #$auto.,sp ;de-allocate locals (no longer necessary) MC < jmp $$cret>> MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - MC <$MACRO R%ET> MC < clr -(sp)> MC > MC < mov (sp)+,r0> MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - ; Auto is used to generate offsets which are applied to labels and ; compute how much local storage is needed to allocate from the stack ; ; Usage: AUTO a,b,c... if [n] not specified, then its 2 ; AUTO a[n],b[n],c,d... if odd values are supplied, user ; must do the allignment ; The Program statement must appear first (at least once in the program) ; it initializes $auto$. Multiple Autos are permitted. The auto's must ; be followed by a Func statement which allocates (and must be the entry) ; storage. After it allocates storage it also re-initializes $auto$ ; so a subsuquent function can re use it properly. Note that variables ; defined in this manner can be reused locally in another function with ; diffenent offsets, but nuthing is going to detect using a variable ; defined locally to another function which is intended to be redefined ; and is inadvertantly left out of a Auto statement ; MC <$MACRO AUTO> ;var1 var2 ...> MC ; This statement may be the first auto in a function. So we ; check and clear the symbol table if true. Function sets flag for next time MC > MC MC <** AUTO% <#@*(1"N)>> MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - MC <$MACRO AUTO%> ;var [size] (size defaults to 2)> MC <> <> > MC MC < $auto$=$auto$-<#@2>> MC * <#@=1(2:Z)= $auto$> <#@1= $auto$>> MC * 2> 1>> MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - MC <$MACRO REGISTER> ; var1 var2 ...> MC MC > MC MC <** <> <#@1=R4>>> MC <** <> <#@2=R3>>> MC <** <> <#@3=R2>>> MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - ; This captures all psect statements so we can save the last one used. MC <$MACRO .PSECT> MC ,,59> MC > MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - MC <$MACRO D%BUG> ;LAB NAME LAB LAB LAB...> MC MC > MC <#@8:> ; push start of this function record MC MC < .word #@1,0 ;fwd and bck ptrs> MC < .word #@2 ;entry point> MC < .blkw 4 ;call count and instr cnt> MC < .word #@#9.-1 ;n parms> MC < .word #@5+2,#@6,#@7 ;ptext,ptype,pval> MC < .asciz '#@=2(1:6)' ;name of fun> MC 9> MC MC MC < .blkb #@#9.> MC < .asciz '#@=9(1:F)' ;tim of comp> MC < .even> ; ; now dump symbol table and types ; MC MC <#@5:> MC MC < .byte 0,0> MC < .even> MC MC <#@6:> MC MC < .word 0> MC MC <#@7:> MC MC < .word 0> MC < .even> ; ; clean up stack and output label so we can link these ; with all other psects containing these function debug records ; MC MC <#@1:> ; ; symbol table out, restore original psect (str 59 has it) ; MC MC > MC <$ENDM> MC <$MACRO $$$$$$4> MC MC 1 < .word #@1. ;n syms>> MC <$ENDM> MC <$MACRO $$$$$$5> MC ; ; first time thru we output symbol text ; second time types ; third time values ; top of stack contains 1,2,3 so we know MC 1 < .asciz '#@1'>> MC 2 < .word #@2.>> MC 3 < .word #@1>> MC <$ENDM> MC <$MACRO $$$$$$6> MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - MC <$MACRO EXTERN> MC MC > MC MC <** E%XTN <#@*(1"Z)>> MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - MC <$MACRO E%XTN> MC MC <$ENDM> ; - - - - - - - - - - - - - - - - - - - - - - - - - - - ; LST-- ;------------------------------------------------------------------------ $$sda==dim ;index of first debugger macro (not implemented) .even size = .-mcmd+50. dimen = dim .end