Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!wuarchive!rice!uupsi!cmcl2!lab!jai From: jai@lab.ultra.nyu.edu (Benchiao Jai) Newsgroups: comp.os.minix Subject: NYUMINIX:LIB\UTIL.ASM Message-ID: <1991Feb24.070854.6671@cmcl2.nyu.edu> Date: 24 Feb 91 07:08:54 GMT Sender: notes@cmcl2.nyu.edu (Notes Person) Organization: New York University Ultracomputer Research Lab Lines: 61 Nntp-Posting-Host: lab.ultra.nyu.edu public _get_base, _get_tot_mem _TEXT segment byte public 'CODE' assume cs:_TEXT _get_base: ; return click at which prog starts mov ax,ds ret _get_tot_mem: cli push es mov ax,9FFFh mov es,ax mov bx,0Eh mov ax,es:[bx] not ax mov es:[bx],ax cmp ax,es:[bx] jne L1 not ax mov es:[bx],ax mov ax,0A000h pop es sti ret L1: mov ax,8000h pop es sti ret ; See ../h/com.h for C definitions SEND = 1 RECEIVE = 2 BOTH = 3 SYSVEC = 32 ;*========================================================================* ; send and receive * ;*========================================================================* ; send(), receive(), sendrec() all save bp, but destroy ax, bx, and cx. public _send, _receive, _sendrec _sendrec: mov cx, BOTH ; sendrec(srcdest, ptr) L0: push bp ; save bp mov bp,sp ; can't index off sp mov ax,4[bp] ; ax = dest-src mov bx,6[bp] ; bx = message pointer int SYSVEC ; trap to the kernel pop bp ; restore bp ret ; return _send: mov cx, SEND ; send(dest, ptr) jmp L0 _receive: mov cx, RECEIVE ; receive(src, ptr) jmp L0 _TEXT ends end Brought to you by Super Global Mega Corp .com