home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 1
/
GoldFishApril1994_CD1.img
/
d1xx
/
d169
/
src
/
suplib
/
resource.asm
< prev
next >
Wrap
Assembly Source File
|
1988-11-22
|
1KB
|
56 lines
;
; EXEC resource support
; 4(sp) 8(sp)
; AutoAllocMiscResource(resno, value)
; resno: MR_SERIALPORT, SERIALBITS, PARALLELPORT, PARALLELBITS
; value: -1 to allocate, 0 to check
;
; returns 0 on success
;
; AutoFreeMiscResource(resno)
; 4(sp)
; Free a misc resource you allocated
;
; No need to open the misc.resource
public _AutoAllocMiscResource
public _AutoFreeMiscResource
public _LVOOpenResource
FAR DATA
_AutoAllocMiscResource:
move.l A6,-(sp)
bsr OpenMiscResource
beq amfail
move.l 8(sp),D0
move.l 12(sp),A1
jsr -6(A6)
bra amret
amfail moveq.l #-1,D0
amret move.l (sp)+,A6
rts
_AutoFreeMiscResource:
move.l A6,-(sp)
bsr OpenMiscResource
beq fmret
move.l 8(sp),D0
jsr -12(A6)
fmret move.l (sp)+,A6
rts
OpenMiscResource:
move.l 4,A6
lea.l MiscName,A1
jsr _LVOOpenResource(A6)
move.l D0,A6
tst.l D0
rts
MiscName: dc.b "misc.resource",0