spectranet.inc 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. ;The MIT License
  2. ;
  3. ;Copyright (c) 2008 Dylan Smith
  4. ;
  5. ;Permission is hereby granted, free of charge, to any person obtaining a copy
  6. ;of this software and associated documentation files (the "Software"), to deal
  7. ;in the Software without restriction, including without limitation the rights
  8. ;to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. ;copies of the Software, and to permit persons to whom the Software is
  10. ;furnished to do so, subject to the following conditions:
  11. ;
  12. ;The above copyright notice and this permission notice shall be included in
  13. ;all copies or substantial portions of the Software.
  14. ;
  15. ;THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. ;IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. ;FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. ;AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. ;LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. ;OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21. ;THE SOFTWARE.
  22. ; This file can be included in assembly language programs to give
  23. ; symbolic access to the public jump table entry points.
  24. ; Avoid double inclusion
  25. #ifndef __SPECTRANET_INC__
  26. #define __SPECTRANET_INC__
  27. NAMESPACE Spectranet ; NAME PREFIX to avoid naming clash
  28. ; Hardware page-in entry points
  29. MODULECALL equ $3FF8
  30. MODULECALL_NOPAGE equ $28
  31. PAGEIN equ $3FF9
  32. PAGEOUT equ $007C
  33. HLCALL equ $3FFA
  34. IXCALL equ $3FFD
  35. ; Port defines
  36. CTRLREG equ $033B
  37. CPLDINFO equ $023B
  38. ; Jump table entry points
  39. SOCKET equ $3E00 ; Allocate a socket
  40. CLOSE equ $3E03 ; Close a socket
  41. LISTEN equ $3E06 ; Listen for incoming connections
  42. ACCEPT equ $3E09 ; Accept an incoming connection
  43. BIND equ $3E0C ; Bind a local address to a socket
  44. CONNECT equ $3E0F ; Connect to a remote host
  45. SEND equ $3E12 ; Send data
  46. RECV equ $3E15 ; Receive data
  47. SENDTO equ $3E18 ; Send data to an address
  48. RECVFROM equ $3E1B ; Receive data from an address
  49. POLL equ $3E1E ; Poll a list of sockets
  50. POLLALL equ $3E21 ; Poll all open sockets
  51. POLLFD equ $3E24 ; Poll a single socket
  52. GETHOSTBYNAME equ $3E27 ; Look up a hostname
  53. PUTCHAR42 equ $3E2A ; 42 column print write a character
  54. PRINT42 equ $3E2D ; 42 column print a null terminated string
  55. CLEAR42 equ $3E30 ; Clear the screen and reset 42-col print
  56. SETPAGEA equ $3E33 ; Sets page area A
  57. SETPAGEB equ $3E36 ; Sets page area B
  58. LONG2IPSTRING equ $3E39 ; Convert a 4 byte big endian long to an IP
  59. IPSTRING2LONG equ $3E3C ; Convert an IP to a 4 byte big endian long
  60. ITOA8 equ $3E3F ; Convert a byte to ascii
  61. RAND16 equ $3E42 ; 16 bit PRNG
  62. REMOTEADDRESS equ $3E45 ; Fill struct sockaddr_in
  63. IFCONFIG_INET equ $3E48 ; Set IPv4 address
  64. IFCONFIG_NETMASK equ $3E4B ; Set netmask
  65. IFCONFIG_GW equ $3E4E ; Set gateway
  66. INITHW equ $3E51 ; Set the MAC address and initial hw registers
  67. GETHWADDR equ $3E54 ; Read the MAC address
  68. DECONFIG equ $3E57 ; Deconfigure inet, netmask and gateway
  69. MAC2STRING equ $3E5A ; Convert 6 byte MAC address to a string
  70. STRING2MAC equ $3E5D ; Convert a hex string to a 6 byte MAC address
  71. ITOH8 equ $3E60 ; Convert accumulator to hex string
  72. HTOI8 equ $3E63 ; Convert hex string to byte in A
  73. GETKEY equ $3E66 ; Get a key from the keyboard, and put it in A
  74. KEYUP equ $3E69 ; Wait for key release
  75. INPUTSTRING equ $3E6C ; Read a string into buffer at DE
  76. GET_IFCONFIG_INET equ $3E6F ; Gets the current IPv4 address
  77. GET_IFCONFIG_NETMASK equ $3E72 ; Gets the current netmask
  78. GET_IFCONFIG_GW equ $3E75 ; Gets the current gateway address
  79. SETTRAP equ $3E78 ; Sets the programmable trap
  80. DISABLETRAP equ $3E7B ; Disables the programmable trap
  81. ENABLETRAP equ $3E7E ; Enables the programmable trap
  82. PUSHPAGEA equ $3E81 ; Pages a page into area A, pushing the old one
  83. POPPAGEA equ $3E84 ; Restores the previous page in area A
  84. PUSHPAGEB equ $3E87 ; Pages into area B pushing the old one
  85. POPPAGEB equ $3E8A ; Restores the previous page in area B
  86. PAGETRAPRETURN equ $3E8D ; Returns from a trap to page area B
  87. TRAPRETURN equ $3E90 ; Returns from a trap that didn't page area B
  88. ADDBASICEXT equ $3E93 ; Adds a BASIC command
  89. STATEMENT_END equ $3E96 ; Check for statement end, exit at syntax time
  90. EXIT_SUCCESS equ $3E99 ; Use this to exit successfully after cmd
  91. PARSE_ERROR equ $3E9C ; Use this to exit to BASIC with a parse error
  92. RESERVEPAGE equ $3E9F ; Reserve a page of static RAM
  93. FREEPAGE equ $3EA2 ; Free a page of static RAM
  94. REPORTERR equ $3EA5 ; report an error via BASIC
  95. ; Filesystem functions
  96. MOUNT equ $3EA8
  97. UMOUNT equ $3EAB
  98. OPENDIR equ $3EAE
  99. OPEN equ $3EB1
  100. UNLINK equ $3EB4
  101. MKDIR equ $3EB7
  102. RMDIR equ $3EBA
  103. SIZE equ $3EBD
  104. FREE equ $3EC0
  105. STAT equ $3EC3
  106. CHMOD equ $3EC6
  107. READ equ $3EC9
  108. WRITE equ $3ECC
  109. LSEEK equ $3ECF
  110. VCLOSE equ $3ED2
  111. VPOLL equ $3ED5
  112. READDIR equ $3ED8
  113. CLOSEDIR equ $3EDB
  114. CHDIR equ $3EDE
  115. GETCWD equ $3EE1
  116. RENAME equ $3EE4
  117. SETMOUNTPOINT equ $3EE7
  118. FREEMOUNTPOINT equ $3EEA
  119. RESALLOC equ $3EED
  120. ; Definitions
  121. ALLOCFD equ 1
  122. FREEFD equ 0
  123. ALLOCDIRHND equ 3
  124. FREEDIRHND equ 2
  125. ; POLL status bits
  126. BIT_RECV equ 2
  127. BIT_DISCON equ 1
  128. BIT_CONN equ 0
  129. NAMESPACE DEFAULT ; Clears namespace
  130. #endif