XDEF  Double64,Add64,Sub64

; Double64(src: Int64bit, VAR dst: Int64Bit);

Double64
  MOVE.L  8(SP),A0  ; src address
  MOVE.L  4(SP),A1  ; dst address
  MOVE.L  4(A0),D0  ; Get Lo Long of src
  ADD.L   D0,D0     ; Double it
  MOVE.L  D0,4(A1)  ; Store into Lo Long of dst
  MOVE.L  (A0),D0   ; Get Hi Long of src
  ADDX.L  D0,D0     ; Double it with Carry
  MOVE.L  D0,(A1)   ; Store into Hi Long of dst
  MOVE.L  (SP),A0   ; Return Address
  ADD.L   #12,SP    ; Restore Stack Pointer
  JMP     (A0)      ; Returen to Caller
  
; Add64(src: Int64bit, VAR dst: Int64Bit);

Add64
  MOVE.L  8(SP),A0  ; src address
  MOVE.L  4(SP),A1  ; dst address
  MOVE.L  4(A0),D0  ; Get Lo Long of src
  ADD.L   D0,4(A1)  ; Add src to dst for Lo Long
  MOVE.L  (A0),D0   ; Get Hi Long of src
  MOVE.L  (A1),D1   ; Get Hi Long of dst
  ADDX.L  D0,D1     ; Add src to dst for Hi Long
  MOVE.L  D1,(A1)   ; Store Hi Long of dst
  MOVE.L  (SP),A0   ; Return Address
  ADD.L   #12,SP    ; Restore Stack Pointer
  JMP     (A0)      ; Returen to Caller

; Sub64(src: Int64bit, VAR dst: Int64Bit);

Sub64
  MOVE.L  8(SP),A0  ; src address
  MOVE.L  4(SP),A1  ; dst address
  MOVE.L  4(A0),D0  ; Get Lo Long of src
  SUB.L   D0,4(A1)  ; Sub src from dst for Lo Long
  MOVE.L  (A0),D0   ; Get Hi Long of src
  MOVE.L  (A1),D1   ; Get Hi Long of dst
  SUBX.L  D0,D1     ; Sub src from dst for Hi Long
  MOVE.L  D1,(A1)   ; Store Hi Long of dst
  MOVE.L  (SP),A0   ; Return Address
  ADD.L   #12,SP    ; Restore Stack Pointer
  JMP     (A0)      ; Returen to Caller