Asm_USOCKET In: A[1] holds socket type (0 for UDP, 1 for TCP, 2 for RAW) Out: A[A] holds the socket number (always 0 for now, but you *mustn't* rely on this, as it may change ! carry set on error, C[A] holds the error number Asm_UBIND In: A[A] holds socket number (must be 0 for now, but please don't rely on it! D[A] holds the port number to bind to Out: A[A] still holds the socket number carry set on error, C[A] holds the error number Asm_UCONNECT In: A[A] holds socket number, always 0 for now, but please don't rely on it ! D[A] holds target port number B[8] holds target IP address Out: carry is set if an error occured, C then holds the error number XXX: even if already connected, erases IP & port ! Asm_UCLOSE In: A[A] holds socket number, 0 for now, but please don't rely on this ! Out: cary set if an error occured, whose number will then be in C[A] Asm_UREAD In: A[A] holds the address of the caller's buffer, or 00000 if none used D[A] holds the buffer's size, if some used, in nibbles (hence must be even) B[A] holds the socket number Out: A[A] holds the address of the read string undefined if A[A] was != 0 or if D[A]==0 D[A] holds its size in nibbles (hence even), if CR/LF parsed line or UDP packet overflew the buffer, the real size is returned carry set if an error occured Hence two ways to call: (provided D0 points to the Asm_CALLS array, and R0[A] holds the socket number) One may don't want to manage buffer, but simply pick out from usinagaz' A=DAT0 A R4=A.F A Upar's address D0+ 5*(iUREAD) C=DAT0 A read C=R0.F A socket number B=C A A=0 A no caller's buffer GOSUB =PC=C GOC =erreur ?D=0 A GOYES nothing_in_buffer ... treat data @A[A] nothing_in_buffer GOVLNG =GETPTRLOOP =PC=C PC=C =erreur GOVLNG =GPErrjmpC Or one may want to manage its own buffer and give its address: A=DAT0 A R4=A.F A Upar's address D0+ 5*(iUREAD) C=DAT0 A LA(5) bufsize D=A A A=R0.F A socket number B=A A AD1EX get buffer's address GOSUB =PC=C GOC =erreur ?D=0 A GOYES nothing_in_buffer ... treat data in own own buffer nothing_in_buffer GOVLNG =GETPTRLOOP But be careful with your buffer size: it is announced to the remote host, which will expect this space to be available... so you can't shrink as desired, only according to what was filled. don't forget to set ST flags as needed for non blocking mode or readln the description of User flags is available in usinagaz.txt, you just need to do the flag number conversion thanks to usinagaz-asm.a, embedded in asm.txt if you are getting data from Usinagaz' buffer, don't call any Usinagaz function which could call rechdlc before having copied it, since if more data come, they will surely erase the old one. Asm_UWRITE In: A[A] holds socket number, always 0 for now, but please don't rely on it ! D[A] holds string length in nibbles D0 points to that string Out: carry set if an error occured, C then holds the error number Asm_UACCEPT In: A[A] holds socket number, 0 for now, but please don't rely on this ! Out: A[A] holds the resulting socket number, 0 for now (yes, oddly enough), but please don't rely on this ! Carry set if an error occured, whose number will then be in C[A] Asm_RESOLV In: D0 points on the hostname D holds string's size in nibbles Out: B[8] holds the wanted IP (hopefully) Carry is set on error, and C[A] holds the error number