home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Scene Xplorer 1
/
Scene_Xplorer_1.iso
/
Tools
/
ProNet
/
source
/
devio_ports.s
next >
Wrap
Text File
|
1978-01-11
|
762b
|
50 lines
; -- Create a MsgPort
CreatePort ; RETURNS d0 *MsgPort or NULL
movem.l a3/a6,-(sp)
move.l 4.w,a6
moveq #34,d0
move.l #MEMF_CLEAR^MEMF_PUBLIC,d1
LIBCALL AllocMem
move.l d0,a3
tst.l d0
beq.s .ende
moveq #-1,d0
LIBCALL AllocSignal
tst.b d0
bmi.s dpfreemem
move.b #4,8(a3)
clr.b 9(a3)
clr.b 14(a3)
move.b d0,15(a3)
move.l 276(a6),16(a3)
lea 20(a3),a1
move.l a1,(a1)
addq.l #4,(a1)
clr.l 4(a1)
move.l a1,8(a1)
move.l a3,d0
.ende movem.l (sp)+,a3/a6
rts
; -- Delete a MsgPort got by CreatePort
DeletePort ; a0 *MsgPort
movem.l a3/a6,-(sp)
move.l 4.w,a6
move.l a0,a3
move.b 15(a3),d0
LIBCALL FreeSignal
dpfreemem moveq #34,d0
move.l a3,a1
LIBCALL FreeMem
movem.l (sp)+,a3/a6
moveq #0,d0
rts