Remove unneeded files
This commit is contained in:
parent
6c216b31e8
commit
5c70c42570
|
@ -1,42 +0,0 @@
|
||||||
; get the effective address of something in extension memory
|
|
||||||
Dlea MACRO
|
|
||||||
MOVE.L ExtAdr+ExtNb*16(A5),\2
|
|
||||||
ADD.W #\1-MB,\2
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
; load the base of extension memory into a register
|
|
||||||
Dload MACRO
|
|
||||||
MOVE.L ExtAdr+ExtNb*16(A5),\1
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
; wrap code that doesn't take arguments with these
|
|
||||||
PreserveStackInstruction MACRO
|
|
||||||
MOVEM.L A2-A6/D6-D7,-(SP)
|
|
||||||
ENDM
|
|
||||||
RestoreStackInstruction MACRO
|
|
||||||
MOVEM.L (SP)+,A2-A6/D6-D7
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
; wrap code that takes arguments with these
|
|
||||||
PreserveStackFunction MACRO
|
|
||||||
MOVEM.L A2/A4-A6/D6-D7,-(SP)
|
|
||||||
ENDM
|
|
||||||
RestoreStackFunction MACRO
|
|
||||||
MOVEM.L (SP)+,A2/A4-A6/D6-D7
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
; Push and pop the extension's data storage into A3
|
|
||||||
WithDataStorageToA3 MACRO
|
|
||||||
MOVE.L A3,-(SP)
|
|
||||||
Dload A3
|
|
||||||
ENDM
|
|
||||||
EndDataStorage MACRO
|
|
||||||
MOVE.L (SP)+,A3
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
EvenOutStringAddress MACRO
|
|
||||||
MOVE.W \1,\2
|
|
||||||
AND.W #$0001,\2
|
|
||||||
ADD.W \2,\1
|
|
||||||
ENDM
|
|
||||||
|
|
|
@ -1,43 +0,0 @@
|
||||||
; bsdsocket library stuff
|
|
||||||
; ported from the various C include headers
|
|
||||||
SOCK_STREAM EQU 1
|
|
||||||
PF_INET EQU 2
|
|
||||||
AF_INET EQU PF_INET
|
|
||||||
IPPROTO_TCP EQU 6
|
|
||||||
|
|
||||||
INADDR_ANY EQU 0
|
|
||||||
|
|
||||||
FIONBIO EQU $8004667E
|
|
||||||
FIONASYNC EQU $8004667D
|
|
||||||
|
|
||||||
SOL_SOCKET EQU $FFFF
|
|
||||||
SO_REUSEADDR EQU $4
|
|
||||||
|
|
||||||
MAX_SOCKETS EQU 64
|
|
||||||
|
|
||||||
len_sockaddr_in EQU 16
|
|
||||||
sockaddr_in_sin_len EQU 0
|
|
||||||
sockaddr_in_sin_family EQU 1
|
|
||||||
sockaddr_in_sin_port EQU 2
|
|
||||||
sockaddr_in_sin_addr EQU 4
|
|
||||||
|
|
||||||
; global errors
|
|
||||||
Error_OtherError EQU -1
|
|
||||||
Error_LibraryNotOpen EQU -2
|
|
||||||
Error_PortOutOfRange EQU -11
|
|
||||||
Error_FdsetOutOfRange EQU -11
|
|
||||||
Error_UnableToBind EQU -12
|
|
||||||
|
|
||||||
; socket herrno and tag lists
|
|
||||||
; built from:
|
|
||||||
; * https://wiki.amigaos.net/amiga/autodocs/bsdsocket.doc.txt
|
|
||||||
; * https://github.com/deplinenoise/amiga-sdk/blob/master/netinclude/amitcp/socketbasetags.h
|
|
||||||
; * http://amigadev.elowar.com/read/ADCD_2.1/Includes_and_Autodocs_2._guide/node012E.html
|
|
||||||
|
|
||||||
TAG_USER EQU (1<<31)
|
|
||||||
SBTF_REF EQU $8000
|
|
||||||
SBTB_CODE EQU 1
|
|
||||||
SBTS_CODE EQU $3FFF
|
|
||||||
SBTC_HERRNO EQU 6
|
|
||||||
|
|
||||||
HerrnoTag EQU (TAG_USER|SBTF_REF|((SBTC_HERRNO&SBTS_CODE)<<SBTB_CODE))
|
|
|
@ -1,43 +0,0 @@
|
||||||
; d0 = value to be divided
|
|
||||||
; d1 = divisor
|
|
||||||
; returns:
|
|
||||||
; d0 = divided value
|
|
||||||
; d1 = remainder
|
|
||||||
LongDivideD0ByD1 MACRO
|
|
||||||
CMP.L D0,D1
|
|
||||||
BMI _LongDivide_StartDivide\@
|
|
||||||
|
|
||||||
MOVE.L D0,D1
|
|
||||||
MOVEQ #0,D0
|
|
||||||
BRA _LongDivide_Skip\@
|
|
||||||
|
|
||||||
_LongDivide_StartDivide\@:
|
|
||||||
|
|
||||||
MOVEM.L D2-D4,-(SP)
|
|
||||||
MOVEQ #0,D2 ; remainder
|
|
||||||
MOVE.L #31,D3 ; bit tracking
|
|
||||||
; d4 tracks the status register
|
|
||||||
|
|
||||||
_LongDivide_ContinueDivide\@:
|
|
||||||
ASL.L #1,D0
|
|
||||||
SCS D4 ; bit that got rolled out
|
|
||||||
AND.L #1,D4
|
|
||||||
ROL.L #1,D2
|
|
||||||
ADD.L D4,D2 ; roll the value onto the remainder
|
|
||||||
|
|
||||||
MOVE.L D2,D4
|
|
||||||
SUB.L D1,D4
|
|
||||||
|
|
||||||
BMI _LongDivide_NotDivisible\@
|
|
||||||
ADDQ #1,D0
|
|
||||||
MOVE.L D4,D2
|
|
||||||
|
|
||||||
_LongDivide_NotDivisible\@:
|
|
||||||
DBRA D3,_LongDivide_ContinueDivide\@
|
|
||||||
MOVE.L D2,D1
|
|
||||||
MOVEM.L (SP)+,D2-D4
|
|
||||||
|
|
||||||
_LongDivide_Skip\@:
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
|
|
47
src/fd_set.s
47
src/fd_set.s
|
@ -1,47 +0,0 @@
|
||||||
; fdset macros
|
|
||||||
EnsureValidFdset MACRO
|
|
||||||
CMP.L #MaxFd_sets,\1
|
|
||||||
BLT \2
|
|
||||||
|
|
||||||
MOVE.L #Error_FdsetOutOfRange,D3
|
|
||||||
RestoreStackFunction
|
|
||||||
Ret_Int
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
EnsureValidFdsetBit MACRO
|
|
||||||
CMP.L #64,\1
|
|
||||||
BGE _EnsureValidFdsetBit_Fail\@
|
|
||||||
BRA \2
|
|
||||||
_EnsureValidFdsetBit_Fail\@:
|
|
||||||
MOVE.L \3,D3
|
|
||||||
RestoreStackFunction
|
|
||||||
Ret_Int
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
; LeaFdset fd_set reg,target
|
|
||||||
LeaFdset MACRO
|
|
||||||
MOVE.L \1,-(SP)
|
|
||||||
Dlea fd_sets,\2 ; base of all, these are longs
|
|
||||||
ROL.L #3,\1 ; multiply by 8
|
|
||||||
ADD.L \1,\2 ; add to base of all
|
|
||||||
MOVE.L (SP)+,\1
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
; LeaFdsetForBit fd_set reg,target address,target bit in address
|
|
||||||
LeaFdsetForBit MACRO
|
|
||||||
LeaFdset \1,\2 ; get fdset base address in \2
|
|
||||||
MOVE.L D3,-(SP)
|
|
||||||
MOVE.L \3,D3 ; Put target bit into D3
|
|
||||||
ROR.L #5,D3 ; lop off the first 5 bits
|
|
||||||
AND.L #$7,D3 ; only keep the top three
|
|
||||||
ROL.L #2,D3 ; multiply by 4
|
|
||||||
ADD.L D3,\2 ; add that value to the fdset address
|
|
||||||
|
|
||||||
AND.L #$1F,\3 ; only keep 0-31 in \3
|
|
||||||
|
|
||||||
MOVEQ #1,D3
|
|
||||||
ROL.L \3,D3 ; shift that bit left as many as target
|
|
||||||
MOVE.L D3,\3 ; put that in the target
|
|
||||||
MOVE.L (SP)+,D3
|
|
||||||
|
|
||||||
ENDM
|
|
Loading…
Reference in New Issue