PageRenderTime 26ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/asmirc.asm

http://github.com/duckinator/asmirc
Assembly | 65 lines | 39 code | 17 blank | 9 comment | 0 complexity | 2bb5ee412d0b33a0015f3affca6e876a MD5 | raw file
  1. %include 'macros.asm'
  2. %define _networkNBO ; temporary. we're defining networkNBO later.
  3. %include 'socket.asm'
  4. ;section .bss
  5. ; networkNBO: resd 1
  6. section .data
  7. strStackSetupStart: string 'Setting up stack...'
  8. strStackSetupEnd: string 'Cleaning up stack...'
  9. strSocketInit: string 'Initializing socket...'
  10. strSocketConnect: string 'Connecting to '
  11. strSocketClose: string 'Closing socket...'
  12. strExit: string 'Exiting...'
  13. strDone: string 'Done.'
  14. strElipsis: string '...'
  15. strAs: string ' as '
  16. ircUser: string "USER asmirc * * :IRC bot using asmirc"
  17. strNick: string "NICK "
  18. nickname: string 'asmirc'
  19. network: string "72.14.179.233" ; Convert this to something able to be placed in socketaddr_in.sin_addr
  20. section .text
  21. global _start
  22. _start:
  23. ; Set up stack frame for file descriptor + socket + params for socket call
  24. stackSetupStart 16
  25. port equ htons(6667)
  26. networkNBO equ iptol(72, 14, 179, 233)
  27. ; Initialize socket
  28. print strSocketInit
  29. socketInit
  30. println strDone
  31. ; Connect socket
  32. ; prints "Connecting to [network] as [nickname]..."
  33. print strSocketConnect, network, strAs, nickname, strElipsis
  34. socketConnect
  35. println strDone
  36. ; Log in
  37. sendln ircUser
  38. sendln strNick, nickname
  39. ; close socket
  40. print strSocketClose
  41. socketClose
  42. println strDone
  43. stackSetupEnd 16
  44. println strExit
  45. ; exit(0)
  46. mov eax, 1
  47. mov ebx, 0
  48. int 0x80