Please wait until the page is fully downloaded and then press the "Expand" button or the blue line numbers.

0065001 .sect .text; .sect .rom; .sect .data; .sect .bss
0065002 .define __send, __receive, __sendrec
0065003 
0065004 ! See ../h/com.h for C definitions
0065005 SEND = 1
0065006 RECEIVE = 2
0065007 BOTH = 3
0065008 SYSVEC = 33
0065009 
0065010 SRCDEST = 8
0065011 MESSAGE = 12
0065012 
0065013 !*========================================================================*
0065014 ! _send and _receive *
0065015 !*========================================================================*
0065016 ! _send(), _receive(), _sendrec() all save ebp, but destroy eax and ecx.
0065017 .define __send, __receive, __sendrec
0065018 .sect .text
0065019 __send:
0065020          push       ebp
0065021          mov       ebp, esp
0065022          push       ebx
0065023          mov       eax, SRCDEST(ebp)       ! eax = dest-src
0065024          mov       ebx, MESSAGE(ebp)       ! ebx = message pointer
0065025          mov       ecx, SEND              ! _send(dest, ptr)
0065026          int       SYSVEC                     ! trap to the kernel
0065027          pop       ebx
0065028          pop       ebp
0065029          ret
0065030 
0065031 __receive:
0065032          push       ebp
0065033          mov       ebp, esp
0065034          push       ebx
0065035          mov       eax, SRCDEST(ebp)       ! eax = dest-src
0065036          mov       ebx, MESSAGE(ebp)       ! ebx = message pointer
0065037          mov       ecx, RECEIVE              ! _receive(src, ptr)
0065038          int       SYSVEC                     ! trap to the kernel
0065039          pop       ebx
0065040          pop       ebp
0065041          ret
0065042 
0065043 __sendrec:
0065044          push       ebp
0065045          mov       ebp, esp
0065046          push       ebx
0065047          mov       eax, SRCDEST(ebp)       ! eax = dest-src
0065048          mov       ebx, MESSAGE(ebp)       ! ebx = message pointer
0065049          mov       ecx, BOTH              ! _sendrec(srcdest, ptr)
0065050          int       SYSVEC                     ! trap to the kernel
0065051          pop       ebx
0065052          pop       ebp
0065053          ret