All,

A couple of questions:

1. Do any of y'all know where there is a working example of an assembly language program that includes a user defined macro in a library file?

2. Can you tell me what I'm doing wrong with this simple macro example?

Here's what I tried (that didn't work) after reading the manuals:

edit et2.mac
    .TITLE  ETTYIN
    .MCALL    .TTYOUT,.TIN

START:    MOV    #BUFFER,R1
    CLR    R2
INLOOP:    .TIN    (R1)+
    INC    R2
    CMPB    #12,R0
    BNE    INLOOP
    MOV    #BUFFER,R1
OUTLOOP:.TTYOUT    (R1)+
    DEC    R2
    BEQ    START
    BR    OUTLOOP
BUFFER:    .BLKW    64.
    .END    START

edit tin.mac
.MACRO    TIN    CHAR
    EMT    ^O340
    BCS    .-2.
.IF NB <CHAR>
.IF DIF <CHAR>,R0
    MOVB    R0,CHAR
.ENDC
.ENDC
.ENDM
.END

lib/mac/c tin tin
macro et2/list/cross+tin.mlb/lib
?MACRO-E-Errors detected:  2
DK:ET2,DK:ET2/C=DK:ET2,DK:TIN.SML

The errors are due to the fact that .TIN/TIN (tried it both ways) is not found:

      1                        .TITLE  ETTYIN
U     2                        .MCALL    .TTYOUT,.TIN
      3
      4    000000    012701     000036'        START: MOV    #BUFFER,R1
      5    000004    005002                 CLR    R2
OQ    6    000006                INLOOP:    .TIN    (R1)+
      7    000006    005202                 INC    R2
      8    000010    122700     000012             CMPB #12,R0
      9    000014    001374                 BNE    INLOOP
     10    000016    012701     000036'            MOV #BUFFER,R1
     11    000022                OUTLOOP:.TTYOUT    (R1)+
     12    000030    005302                 DEC    R2
     13    000032    001762                 BEQ    START
     14    000034    000772                 BR    OUTLOOP
     15    000036                BUFFER:    .BLKW    64.
     16        000000'                .END    START

However, if I include the macro in the file, edit et1.mac:
    .TITLE  ETTYIN
    .MCALL    .TTYOUT

.MACRO    TIN    CHAR
    EMT    ^O340
    BCS    .-2.
.IF NB <CHAR>
.IF DIF <CHAR>,R0
    MOVB    R0,CHAR
.ENDC
.ENDC
.ENDM

START:    MOV    #BUFFER,R1
    CLR    R2
INLOOP:    TIN    (R1)+
    INC    R2
    CMPB    #12,R0
    BNE    INLOOP
    MOV    #BUFFER,R1
OUTLOOP:.TTYOUT    (R1)+
    DEC    R2
    BEQ    START
    BR    OUTLOOP
BUFFER:    .BLKW    64.
    .END    START

The program compiles/links/and runs fine and whatever strings I enter are copied to output as expected. TIN is just the library macro .TTYIN copied verbatim. I expect that my macro file is not proper or that it is not being found by macro, although it complains if I supply a non-existent file.

Insights appreciated.


_______________________________________________
Simh mailing list
[email protected]
http://mailman.trailing-edge.com/mailman/listinfo/simh

Reply via email to