diff --git a/src/AMOSPro_BSDSocket.Lib b/src/AMOSPro_BSDSocket.Lib index 5ed4bb2..26b227a 100644 Binary files a/src/AMOSPro_BSDSocket.Lib and b/src/AMOSPro_BSDSocket.Lib differ diff --git a/src/BSDSocket.s b/src/BSDSocket.s index c465bff..6af1ca8 100644 --- a/src/BSDSocket.s +++ b/src/BSDSocket.s @@ -844,11 +844,11 @@ _SocketBind_SockaddrIn: ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Lib_Par SocketErrno ; - - - - - - - - - - - - - - PreserveStackInstruction + PreserveStackFunction EnsureBSDSocketLibrary _SocketErrno_LibraryOpen - RestoreStackInstruction + RestoreStackFunction Ret_Int _SocketErrno_LibraryOpen: @@ -859,7 +859,7 @@ _SocketErrno_LibraryOpen: MOVE.L D0,D3 - RestoreStackInstruction + RestoreStackFunction RTS ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1330,6 +1330,12 @@ _SocketSelect_PerformSelect ; - - - - - - - - - - - - - PreserveStackFunction + EnsureBSDSocketLibrary _SocketGetHost_LibraryOpen + + RestoreStackFunction + Ret_Int + +_SocketGetHost_LibraryOpen: MULU #len_sockaddr_in,D3 Dload A0 MOVE.L sockaddr_ram-MB(A0),A0 @@ -1350,6 +1356,13 @@ _SocketSelect_PerformSelect ; - - - - - - - - - - - - - PreserveStackFunction + EnsureBSDSocketLibrary _SocketGetPort_LibraryOpen + + RestoreStackFunction + Ret_Int + +_SocketGetPort_LibraryOpen: + MULU #len_sockaddr_in,D3 Dload A0 MOVE.L sockaddr_ram-MB(A0),A0 @@ -1659,7 +1672,7 @@ _SocketWaitAsyncWriting_LibraryOpen: Rbsr L_MicrosecondsToTimeval ; A3 contains timeval Dload A4 - MOVE.L D0,-(SP) + MOVEM.L D0,-(SP) ; set up WaitSelect MOVEQ #0,D1 LeaFdset D1,A1 ; write fdset @@ -1681,7 +1694,7 @@ _SocketWaitAsyncWriting_LibraryOpen: TST.L D0 BEQ _SocketWaitAsyncWriting_Timeout BMI _SocketWaitAsyncWriting_Error - MOVE.L (SP)+,D0 ; D0 contains socket again + MOVEM.L (SP)+,D0 ; D0 contains socket again Dload A4 ; a socket became interesting, check the Fdset @@ -1719,7 +1732,7 @@ _SocketWaitAsyncWriting_CheckSockopt: MOVE.L (SP)+,A3 TST.L D0 - BMI _SocketWaitAsyncWriting_Error + BMI _SocketWaitAsyncWriting_Error2 Dlea IoctlSockOptScratch,A0 MOVE.L (A0),D0 @@ -1741,6 +1754,7 @@ _SocketWaitAsyncWriting_Ready: _SocketWaitAsyncWriting_Error: MOVE.L (SP)+,D1 +_SocketWaitAsyncWriting_Error2: MOVEM.L (SP)+,A3-A4 MOVE.L #-1,D3 @@ -1822,7 +1836,6 @@ _SocketWaitAsyncReading_LibraryOpen: BMI _SocketWaitAsyncReading_Done MOVE.L (SP)+,D0 ; D0 contains socket again - ;Dload A4 ; a socket became interesting, check the Fdset MOVE.L D0,D3 ; socket in D3 MOVEQ #0,D1 ; fdset in D1 @@ -1933,7 +1946,7 @@ _SocketReuseAddr_LibraryOpen: ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; =Dns Get Address By Name$(Name String) ; -; Get the status of a socket +; Convert a host name to an IP address ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Lib_Par DnsGetHostAddressByName @@ -2014,24 +2027,28 @@ _DnsGetHostAddressByName_GetIPAddressLength: MOVE.L (SP)+,A2 SUBQ #1,D3 - MOVE.L D3,D4 + AND.W #$FFFE,D3 ADDQ #2,D3 Rjsr L_Demande ; string is in A0/A1 - LEA 2(A0,D3.W),A1 - MOVE.L A1,HiChaine(A5) - MOVE.L A0,D3 + MOVE.W D4,(A1)+ - MOVE.W D4,(A0)+ SUBQ #1,D4 _DnsGetHostAddressByName_KeepCopying: - MOVE.B (A2,D4),(A0,D4) + MOVE.B (A2)+,(A1)+ DBRA D4,_DnsGetHostAddressByName_KeepCopying + MOVE.W A1,D1 + AND.W #$0001,D1 + ADD.W D1,A1 + + MOVE.L A1,HiChaine(A5) + MOVE.L A0,D3 + RestoreStackFunction Ret_String diff --git a/src/BSDSocket_Labels.s b/src/BSDSocket_Labels.s index 5a289de..ff534f4 100644 --- a/src/BSDSocket_Labels.s +++ b/src/BSDSocket_Labels.s @@ -1,5 +1,5 @@ ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -; BSDSocket.s, list of the library functions on the 27-04-2024 07:03:15 +; BSDSocket.s, list of the library functions on the 28-04-2024 19:05:54 ; ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ L_Cold: set 0 diff --git a/src/BSDSocket_Size.s b/src/BSDSocket_Size.s index 472b193..edeb000 100644 --- a/src/BSDSocket_Size.s +++ b/src/BSDSocket_Size.s @@ -1,5 +1,5 @@ ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -; BSDSocket.s, library size on the 27-04-2024 07:03:15 +; BSDSocket.s, library size on the 28-04-2024 19:05:54 ; ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lib_Size equ 39 diff --git a/test/TestSuite b/test/TestSuite index a3b418b..429b8bf 100644 Binary files a/test/TestSuite and b/test/TestSuite differ diff --git a/test/TestSuite.amos b/test/TestSuite.amos index 7cc9b2a..3a345c6 100644 Binary files a/test/TestSuite.amos and b/test/TestSuite.amos differ