_sendrec.s 885 B

12345678910111213141516171819202122232425262728293031323334
  1. .sect .text; .sect .rom; .sect .data; .sect .bss
  2. .sect .text
  3. .define __send, __receive, __sendrec
  4. ! See ../h/com.h for C definitions
  5. SEND = 1
  6. RECEIVE = 2
  7. BOTH = 3
  8. SYSVEC = 32
  9. !*========================================================================*
  10. ! _send and _receive *
  11. !*========================================================================*
  12. ! _send(), _receive(), _sendrec() all save bp, but destroy ax, bx, and cx.
  13. .extern __send, __receive, __sendrec
  14. __send: mov cx,SEND ! _send(dest, ptr)
  15. jmp L0
  16. __receive:
  17. mov cx,RECEIVE ! _receive(src, ptr)
  18. jmp L0
  19. __sendrec:
  20. mov cx,BOTH ! _sendrec(srcdest, ptr)
  21. jmp L0
  22. L0: push bp ! save bp
  23. mov bp,sp ! can't index off sp
  24. mov ax,4(bp) ! ax = dest-src
  25. mov bx,6(bp) ! bx = message pointer
  26. int SYSVEC ! trap to the kernel
  27. pop bp ! restore bp
  28. ret ! return