.include /SY:[1,2]COMMON.MAC/ .ident /1.0.09/ .title mopmac .psect moprwd,rw,lcl,rel,con ; .even bcount::.word 0 ;Byte count for .READ ; .psect moprod,ro,lcl,rel,con ; .even muladd: .byte 171. ;AB- .byte 0 ;00- .byte 0 ;00- .byte 1 ;01- .byte 0 ;00- .byte 0 ;00 ; .psect mopcod,ro,lcl,rel,con ; clrxrb: push ;Save work registers mov #xrb,r0 ;Point to the XRB mov #,r1 ;Get length in words 10$: clr (r0)+ ;Clear a word sob r1,10$ ;On to the next pop ;Restore work registers return ;Back to caller ; setmul::call clrxrb ;Clear out the XRB movb #2,xrb+xrci ;Set the channel number * 2 mov #muladd,xrb+xrloc ;Set buffer address mov #6,xrb+xrbc ;Number of multicasts * 6 movb #ethhnd,xrb+xrblkm ;Set device hander mov #-3,xrb+xrlen ;Set .SPEC function code .spec ;Perform the .SPEC call movb firqb,r0 ;Any error? beq 10$ ;Nope, good. trap 377 ;Let BP2 handle it. 10$: return ;All done ; geteth::call clrxrb ;Clear out the XRB movb @2(r5),xrb+xrci ;Set the channel number aslb xrb+xrci ; * 2 mov 4(r5),xrb+xrloc ;Set buffer address mov @6(r5),xrb+xrlen ;Set buffer length mov @10(r5),xrb+xrmod ;Set RECORD modifier .read ;Do the I/O mov xrb+xrbc,bcount ;Copy the number of bytes read movb firqb,r0 ;Any error? beq 10$ ;Nope, good cmp r0,#14. ;Bogon device hung or write locked? beq geteth ;Yup, try it again (and again...) cmp r0,#13. ;Packets lost? beq geteth ;Yup, pretend it didn't happen... trap 377 ;Nope, let BP2 handle it 10$: return ;All done ; puteth::call clrxrb ;Clear out the XRB movb @2(r5),xrb+xrci ;Set the channel number aslb xrb+xrci ; * 2 mov 4(r5),xrb+xrloc ;Set buffer address mov @6(r5),xrb+xrlen ;Set buffer length mov @10(r5),xrb+xrbc ;Set byte count .write ;Do the I/O movb firqb,r0 ;Any error? beq 10$ ;Nope, good cmp r0,#14. ;Bogon device hung or write locked? beq puteth ;Yup, try it again (and again...) trap 377 ;Nope, let BP2 handle it 10$: return ;All done ; .end