head     56.3;
access   paws bayes jws quist brad dew jwh;
symbols  ;
locks    ; strict;
comment  @# @;


56.3
date     93.01.27.13.26.22;  author jwh;  state Exp;
branches ;
next     56.2;

56.2
date     93.01.27.12.04.54;  author jwh;  state Exp;
branches ;
next     56.1;

56.1
date     91.11.05.09.46.35;  author jwh;  state Exp;
branches ;
next     55.1;

55.1
date     91.08.25.10.23.43;  author jwh;  state Exp;
branches ;
next     54.1;

54.1
date     91.03.18.15.27.07;  author jwh;  state Exp;
branches ;
next     53.1;

53.1
date     91.03.11.19.28.08;  author jwh;  state Exp;
branches ;
next     52.1;

52.1
date     91.02.19.09.12.06;  author jwh;  state Exp;
branches ;
next     51.1;

51.1
date     91.01.30.16.11.52;  author jwh;  state Exp;
branches ;
next     50.1;

50.1
date     90.10.29.16.26.32;  author jwh;  state Exp;
branches ;
next     49.1;

49.1
date     90.08.14.14.10.47;  author jwh;  state Exp;
branches ;
next     48.1;

48.1
date     90.07.26.11.16.57;  author jwh;  state Exp;
branches ;
next     47.1;

47.1
date     90.05.14.10.59.47;  author dew;  state Exp;
branches ;
next     46.1;

46.1
date     90.05.07.08.46.58;  author jwh;  state Exp;
branches ;
next     45.1;

45.1
date     90.04.19.15.54.48;  author jwh;  state Exp;
branches ;
next     44.1;

44.1
date     90.04.01.22.11.57;  author jwh;  state Exp;
branches ;
next     43.1;

43.1
date     90.03.20.14.03.55;  author jwh;  state Exp;
branches ;
next     42.1;

42.1
date     90.01.23.17.48.40;  author jwh;  state Exp;
branches ;
next     41.1;

41.1
date     89.12.22.11.30.44;  author jwh;  state Exp;
branches ;
next     40.1;

40.1
date     89.09.29.11.52.43;  author jwh;  state Exp;
branches ;
next     39.1;

39.1
date     89.09.26.16.36.54;  author dew;  state Exp;
branches ;
next     38.1;

38.1
date     89.08.29.11.29.03;  author jwh;  state Exp;
branches ;
next     37.2;

37.2
date     89.08.23.13.59.08;  author jwh;  state Exp;
branches ;
next     37.1;

37.1
date     89.05.12.11.41.27;  author dew;  state Exp;
branches ;
next     36.1;

36.1
date     89.02.06.10.19.45;  author dew;  state Exp;
branches ;
next     35.1;

35.1
date     89.02.02.13.34.47;  author dew;  state Exp;
branches ;
next     34.1;

34.1
date     89.01.23.16.09.51;  author jwh;  state Exp;
branches ;
next     33.1;

33.1
date     89.01.16.11.41.47;  author dew;  state Exp;
branches ;
next     32.1;

32.1
date     89.01.10.11.50.30;  author bayes;  state Exp;
branches ;
next     31.2;

31.2
date     89.01.06.09.13.07;  author quist;  state Exp;
branches ;
next     31.1;

31.1
date     88.12.14.18.11.38;  author bayes;  state Exp;
branches ;
next     30.1;

30.1
date     88.12.09.13.48.28;  author dew;  state Exp;
branches ;
next     29.1;

29.1
date     88.10.31.15.33.30;  author bayes;  state Exp;
branches ;
next     28.1;

28.1
date     88.10.06.11.00.10;  author dew;  state Exp;
branches ;
next     27.1;

27.1
date     88.09.29.11.35.50;  author bayes;  state Exp;
branches ;
next     26.1;

26.1
date     88.09.28.13.15.14;  author bayes;  state Exp;
branches ;
next     25.1;

25.1
date     88.03.02.09.31.43;  author bayes;  state Exp;
branches ;
next     24.1;

24.1
date     88.02.04.11.05.17;  author quist;  state Exp;
branches ;
next     1.1;

1.1
date     88.02.04.10.40.53;  author larry;  state tmp;
branches ;
next     ;


desc
@Base file for PWS 3.2 release.

@


56.3
log
@
pws2rcs automatic delta on Wed Jan 27 13:14:25 MST 1993
@
text
@	TTL LANASM - LAN DRIVER ASSEMBLY SUPPORT
	PAGE
*******************************************************************************
*       LAN LANASM
*******************************************************************************
*
*       Date:           18/06/86
*       Author:         Robert Quist
*
* fixes/changes history
* 15 jan 88 : changed START_TIMER & TIME_EXPIRED to use the PWS timer code
*             uses a timer record instead of just an integer.
*             must check timer presence and fake it.
*******************************************************************************
    sprint
    nosyms
    llen    132
    page
********************************************************************************
*       The following lines are used to tell the LINKER/LOADER what this module
*       looks like in PASCAL terms.
********************************************************************************
	MNAME LANASM
	SRC MODULE LANASM;
	SRC IMPORT SYSGLOBALS,LANDECS;
	SRC EXPORT
	SRC
	SRC   TYPE
	SRC     TIMER_REC = RECORD
	SRC                   TIME : INTEGER;
	SRC                   FLAG : SHORTINT;
	SRC                 END;
	SRC     WWINDOW = PACKED ARRAY[1..MAXINT] OF SHORTINT;
	SRC     FUNCTION  B_OR(B1,B2:BYTE):BYTE;
	SRC     FUNCTION  W_OR(B1,B2:SHORTINT):SHORTINT;
	SRC     FUNCTION  HW_READ_LOCAL_ADDRESS
	SRC                    (VAR CARD:LANCARD_TYPE;
	SRC                     VAR LOCAL_LINK_ADDRESS: LINK_ADDRESS_TYPE)
	SRC                    :BOOLEAN;
	SRC     PROCEDURE START_TIMER(VAR TIME : TIMER_REC);
	SRC     FUNCTION  TIME_EXPIRED(VAR TIME : TIMER_REC):BOOLEAN;
	SRC     PROCEDURE CHECKSUM1(VAR CS:SHORTINT; ANYVAR BUF:WWINDOW; SIZE:INTEGER);
	SRC END; { of extdc }
	PAGE
*******************************************************************************
*
*       SYMBOLS FOR EXPORT AS PROCEDURE NAMES
*
*******************************************************************************
	DEF LANASM_B_OR
	DEF LANASM_W_OR
	DEF LANASM_HW_READ_LOCAL_ADDRESS
	DEF LANASM_LANASM
	DEF LANASM_START_TIMER
	DEF LANASM_TIME_EXPIRED
	DEF LANASM_CHECKSUM1
*******************************************************************************
*       SYMBOLS FOR INTERNAL USE
*******************************************************************************
timer_present   equ     1
sysflag2        equ     $FFFFFEDA
		REFA    CHECK_TIMER   in system POWERUP code
		LMODE   CHECK_TIMER
	PAGE

LANASM_W_OR EQU *  RETURN THE BITWISE OR OF THE TWO WORD ARGUMENTS
	MOVEA.L  (SP)+,A0  POP RETURN ADDRESS
	MOVE.W   (SP)+,D0
	OR.W     (SP)+,D0
	MOVE.W   D0,(SP)
	JMP      (A0)

LANASM_B_OR EQU *  RETURN THE BITWISE OR OF THE TWO BYTE ARGUMENTS
	MOVEA.L  (SP)+,A0  POP RETURN ADDRESS
	MOVE.B   (SP)+,D0
	OR.B     (SP)+,D0
	MOVE.B   D0,(SP)
	JMP      (A0)

	PAGE
hwr_nextb equ   *
	move.w  (a3)+,d0    get first nibble
	andi.w  #$F,d0      clear high bits for add later
	asl.b   #4,d0       first nibble * 16
	move.w  (a3)+,d1    get second nibble
	andi.b  #$F,d1
	or.b    d1,d0       plus second nibble
	rts

LANASM_HW_READ_LOCAL_ADDRESS EQU *

	MOVEA.L (SP)+,A0      RETURN ADDRESS
	MOVEA.L (SP)+,A1      LINK ADDRESS
	MOVEA.L (SP)+,A2      CARD BASE ADDRESS
*                     A3      NOVRAM BANK ADDRESS
*                     D7      checksum
	movea.l a2,a3
	adda.l  #$C000,a3   check the bank flag
	bsr     hwr_nextb
	tst.b   d0
	beq.s   hw_r1
	adda.l  #$040,a3    use bank 2
hw_r1   bsr     hwr_nextb   get leading zeroes to
	moveq   #0,d7       initialize the checksum
	move.b  d0,d7
	moveq   #5,d2       set loop count for 6 passes
hw_r2   bsr     hwr_nextb
	add.w   d0,d7       add it to checksum
	move.b  d0,(a1)+    move it to returned link address
	dbra    d2,hw_r2
	moveq   #6,d2       set loop count for 7 more
hw_r3   bsr     hwr_nextb
	add.w   d0,d7       add it to checksum
	dbra    d2,hw_r3
	bsr     hwr_nextb   get the stored checksum
	andi.w  #$FF,d7     mod 256 of computed checksum
	cmp.b   d0,d7
	seq     (sp)    set return code
	jmp     (a0)

	PAGE
*************************************************************************
* START_TIMER                           timing setup
*
*   ASSUMES:
*       - sp+4 points to location of a timer record
*              the TIME field is a delay in milliseconds
*   RETURNS:
*       - The TIME field contains a value to match against the timer
*         (no timer present then this field is a scaled count)
*************************************************************************

LANASM_START_TIMER equ *
	movea.l 4(sp),a0        get addr of timer rec
	btst    #timer_present,sysflag2
	bne.s   soft_start
	st      4(a0)   set the first time flag
	jmp     CHECK_TIMER

soft_start equ  *
*       scale the time out value for use as a counter
	move.l  (a0),d0
	move.l  d0,d1   scale the timeout value
	lsl.l   #4,d1   n*16
	lsl.l   #5,d0   n*32
	add.l   d1,d0
	lsr.l   #1,d0   To = ((n*16)+(n*32))/2
	move.l  d0,(a0)
	move.l  (sp)+,(sp)      move the return address
	rts
*************************************************************************
* FUNCTION TIME_EXPIRED(VAR TIME: INTEGER):BOOLEAN;
*   ASSUMES:
*       - sp+4 points to a timer record (set up by start_timer)
*************************************************************************

LANASM_TIME_EXPIRED  EQU *
	clr.b   8(sp)           clear the function value
	btst    #timer_present,sysflag2
	bne.s   soft_check
	move.l  4(sp),-(sp)     copy the timer rec address
	jsr     CHECK_TIMER
	bpl.s   timex1
timex0  move.b  #1,8(sp)
timex1  move.l  (sp)+,(sp)      move the return address
	rts
soft_check equ  *
	movea.l 4(sp),a0
	subq.l  #1,(a0)
	bpl     timex1
	bra     timex0
*************************************************************************
* PROCEDURE CHECKSUM1(VAR CS:SHORTINT; ANYVAR BUF:WWINDOW; SIZE:INTEGER);
* compute 1s compliment 16 bit checksum
*************************************************************************
LANASM_CHECKSUM1 equ *
	movea.l (sp)+,a2        return
	move.l  (sp)+,d0        size
	movea.l (sp)+,a1        buf address
	movea.l (sp)+,a0        checksum address
	moveq   #0,d1   checksum value
	bra.s   cs_1
cs_0    move.w  (a1)+,d2
	addx.w  d2,d1
cs_1    dbra    d0,cs_0
	moveq   #0,d2
	addx.w  d2,d1
	not.w   d1
	move.w  d1,(a0)
	jmp     (a2)
*************************************************************************
LANASM_LANASM EQU *  MODULE INIT BODY
	RTS
	END

@


56.2
log
@
pws2rcs automatic delta on Wed Jan 27 11:57:27 MST 1993
@
text
@d1 195
@


56.1
log
@Automatic bump of revision number for PWS version 3.25
@
text
@a0 195
	TTL LANASM - LAN DRIVER ASSEMBLY SUPPORT
	PAGE
*******************************************************************************
*       LAN LANASM
*******************************************************************************
*
*       Date:           18/06/86
*       Author:         Robert Quist
*
* fixes/changes history
* 15 jan 88 : changed START_TIMER & TIME_EXPIRED to use the PWS timer code
*             uses a timer record instead of just an integer.
*             must check timer presence and fake it.
*******************************************************************************
    sprint
    nosyms
    llen    132
    page
********************************************************************************
*       The following lines are used to tell the LINKER/LOADER what this module
*       looks like in PASCAL terms.
********************************************************************************
	MNAME LANASM
	SRC MODULE LANASM;
	SRC IMPORT SYSGLOBALS,LANDECS;
	SRC EXPORT
	SRC
	SRC   TYPE
	SRC     TIMER_REC = RECORD
	SRC                   TIME : INTEGER;
	SRC                   FLAG : SHORTINT;
	SRC                 END;
	SRC     WWINDOW = PACKED ARRAY[1..MAXINT] OF SHORTINT;
	SRC     FUNCTION  B_OR(B1,B2:BYTE):BYTE;
	SRC     FUNCTION  W_OR(B1,B2:SHORTINT):SHORTINT;
	SRC     FUNCTION  HW_READ_LOCAL_ADDRESS
	SRC                    (VAR CARD:LANCARD_TYPE;
	SRC                     VAR LOCAL_LINK_ADDRESS: LINK_ADDRESS_TYPE)
	SRC                    :BOOLEAN;
	SRC     PROCEDURE START_TIMER(VAR TIME : TIMER_REC);
	SRC     FUNCTION  TIME_EXPIRED(VAR TIME : TIMER_REC):BOOLEAN;
	SRC     PROCEDURE CHECKSUM1(VAR CS:SHORTINT; ANYVAR BUF:WWINDOW; SIZE:INTEGER);
	SRC END; { of extdc }
	PAGE
*******************************************************************************
*
*       SYMBOLS FOR EXPORT AS PROCEDURE NAMES
*
*******************************************************************************
	DEF LANASM_B_OR
	DEF LANASM_W_OR
	DEF LANASM_HW_READ_LOCAL_ADDRESS
	DEF LANASM_LANASM
	DEF LANASM_START_TIMER
	DEF LANASM_TIME_EXPIRED
	DEF LANASM_CHECKSUM1
*******************************************************************************
*       SYMBOLS FOR INTERNAL USE
*******************************************************************************
timer_present   equ     1
sysflag2        equ     $FFFFFEDA
		REFA    CHECK_TIMER   in system POWERUP code
		LMODE   CHECK_TIMER
	PAGE

LANASM_W_OR EQU *  RETURN THE BITWISE OR OF THE TWO WORD ARGUMENTS
	MOVEA.L  (SP)+,A0  POP RETURN ADDRESS
	MOVE.W   (SP)+,D0
	OR.W     (SP)+,D0
	MOVE.W   D0,(SP)
	JMP      (A0)

LANASM_B_OR EQU *  RETURN THE BITWISE OR OF THE TWO BYTE ARGUMENTS
	MOVEA.L  (SP)+,A0  POP RETURN ADDRESS
	MOVE.B   (SP)+,D0
	OR.B     (SP)+,D0
	MOVE.B   D0,(SP)
	JMP      (A0)

	PAGE
hwr_nextb equ   *
	move.w  (a3)+,d0    get first nibble
	andi.w  #$F,d0      clear high bits for add later
	asl.b   #4,d0       first nibble * 16
	move.w  (a3)+,d1    get second nibble
	andi.b  #$F,d1
	or.b    d1,d0       plus second nibble
	rts

LANASM_HW_READ_LOCAL_ADDRESS EQU *

	MOVEA.L (SP)+,A0      RETURN ADDRESS
	MOVEA.L (SP)+,A1      LINK ADDRESS
	MOVEA.L (SP)+,A2      CARD BASE ADDRESS
*                     A3      NOVRAM BANK ADDRESS
*                     D7      checksum
	movea.l a2,a3
	adda.l  #$C000,a3   check the bank flag
	bsr     hwr_nextb
	tst.b   d0
	beq.s   hw_r1
	adda.l  #$040,a3    use bank 2
hw_r1   bsr     hwr_nextb   get leading zeroes to
	moveq   #0,d7       initialize the checksum
	move.b  d0,d7
	moveq   #5,d2       set loop count for 6 passes
hw_r2   bsr     hwr_nextb
	add.w   d0,d7       add it to checksum
	move.b  d0,(a1)+    move it to returned link address
	dbra    d2,hw_r2
	moveq   #6,d2       set loop count for 7 more
hw_r3   bsr     hwr_nextb
	add.w   d0,d7       add it to checksum
	dbra    d2,hw_r3
	bsr     hwr_nextb   get the stored checksum
	andi.w  #$FF,d7     mod 256 of computed checksum
	cmp.b   d0,d7
	seq     (sp)    set return code
	jmp     (a0)

	PAGE
*************************************************************************
* START_TIMER                           timing setup
*
*   ASSUMES:
*       - sp+4 points to location of a timer record
*              the TIME field is a delay in milliseconds
*   RETURNS:
*       - The TIME field contains a value to match against the timer
*         (no timer present then this field is a scaled count)
*************************************************************************

LANASM_START_TIMER equ *
	movea.l 4(sp),a0        get addr of timer rec
	btst    #timer_present,sysflag2
	bne.s   soft_start
	st      4(a0)   set the first time flag
	jmp     CHECK_TIMER

soft_start equ  *
*       scale the time out value for use as a counter
	move.l  (a0),d0
	move.l  d0,d1   scale the timeout value
	lsl.l   #4,d1   n*16
	lsl.l   #5,d0   n*32
	add.l   d1,d0
	lsr.l   #1,d0   To = ((n*16)+(n*32))/2
	move.l  d0,(a0)
	move.l  (sp)+,(sp)      move the return address
	rts
*************************************************************************
* FUNCTION TIME_EXPIRED(VAR TIME: INTEGER):BOOLEAN;
*   ASSUMES:
*       - sp+4 points to a timer record (set up by start_timer)
*************************************************************************

LANASM_TIME_EXPIRED  EQU *
	clr.b   8(sp)           clear the function value
	btst    #timer_present,sysflag2
	bne.s   soft_check
	move.l  4(sp),-(sp)     copy the timer rec address
	jsr     CHECK_TIMER
	bpl.s   timex1
timex0  move.b  #1,8(sp)
timex1  move.l  (sp)+,(sp)      move the return address
	rts
soft_check equ  *
	movea.l 4(sp),a0
	subq.l  #1,(a0)
	bpl     timex1
	bra     timex0
*************************************************************************
* PROCEDURE CHECKSUM1(VAR CS:SHORTINT; ANYVAR BUF:WWINDOW; SIZE:INTEGER);
* compute 1s compliment 16 bit checksum
*************************************************************************
LANASM_CHECKSUM1 equ *
	movea.l (sp)+,a2        return
	move.l  (sp)+,d0        size
	movea.l (sp)+,a1        buf address
	movea.l (sp)+,a0        checksum address
	moveq   #0,d1   checksum value
	bra.s   cs_1
cs_0    move.w  (a1)+,d2
	addx.w  d2,d1
cs_1    dbra    d0,cs_0
	moveq   #0,d2
	addx.w  d2,d1
	not.w   d1
	move.w  d1,(a0)
	jmp     (a2)
*************************************************************************
LANASM_LANASM EQU *  MODULE INIT BODY
	RTS
	END

@


55.1
log
@Automatic bump of revision number for PWS version 3.25A
@
text
@@


54.1
log
@Automatic bump of revision number for PWS version 3.24
@
text
@@


53.1
log
@Automatic bump of revision number for PWS version 3.24B
@
text
@@


52.1
log
@Automatic bump of revision number for PWS version 3.24A
@
text
@@


51.1
log
@Automatic bump of revision number for PWS version 3.24d
@
text
@@


50.1
log
@Automatic bump of revision number for PWS version 3.23c
@
text
@@


49.1
log
@Automatic bump of revision number for PWS version 3.24b
@
text
@@


48.1
log
@Automatic bump of revision number for PWS version 3.24a
@
text
@@


47.1
log
@Automatic bump of revision number for PWS version 3.23
@
text
@@


46.1
log
@Automatic bump of revision number for PWS version 3.23
@
text
@@


45.1
log
@Automatic bump of revision number for PWS version 3.23C
@
text
@@


44.1
log
@Automatic bump of revision number for PWS version 3.23B
@
text
@@


43.1
log
@Automatic bump of revision number for PWS version 3.23aA
@
text
@@


42.1
log
@Automatic bump of revision number for PWS version 3.23e
@
text
@@


41.1
log
@Automatic bump of revision number for PWS version 3.23d
@
text
@@


40.1
log
@Automatic bump of revision number for PWS version 3.23c
@
text
@@


39.1
log
@Automatic bump of revision number for PWS version 3.23b
@
text
@@


38.1
log
@Automatic bump of revision number for PWS version 3.23a
@
text
@@


37.2
log
@

       SRM-UX changes.
@
text
@@


37.1
log
@Automatic bump of revision number for PWS version 3.3a
@
text
@d33 1
d42 1
a42 1
	SRC
d56 1
d172 20
a191 1

@


36.1
log
@Automatic bump of revision number for PWS version 3.22
@
text
@@


35.1
log
@Automatic bump of revision number for PWS version 3.22
@
text
@@


34.1
log
@Automatic bump of revision number for PWS version 3.22
@
text
@@


33.1
log
@Automatic bump of revision number for PWS version 3.22D
@
text
@@


32.1
log
@Automatic bump of revision number for PWS version 3.22C
@
text
@@


31.2
log
@changed scale factor on timeout value, when TICKER
is not available.
RDQ 6jan89

@
text
@@


31.1
log
@Automatic bump of revision number for PWS version 3.22B
@
text
@d141 5
a145 1
	lsl.l   #6,d0           x 64 is a realy rough guess
@


30.1
log
@Automatic bump of revision number for PWS version 3.22A
@
text
@@


29.1
log
@Automatic bump of revision number for PWS version 3.22b
@
text
@@


28.1
log
@Automatic bump of revision number for PWS version 3.3b
@
text
@@


27.1
log
@Automatic bump of revision number for PWS version 3.3a
@
text
@@


26.1
log
@Automatic bump of revision number for PWS version 3.3 Synch
@
text
@@


25.1
log
@Automatic bump of revision number for PWS version 3.2Y
@
text
@@


24.1
log
@initial RCS submission
@
text
@@


1.1
log
@Initial revision
@
text
@@
