home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
OSK
/
TELECOM
/
mtp.lzh
/
mtpvalid.a
< prev
next >
Wrap
Text File
|
1993-09-05
|
2KB
|
55 lines
* mtpvalid.a, Version 1.1, Created 2/9/90
* Dr Alan M. McIvor, BP Sunbury Research Centre
use <oskdefs.d>
Typ equ 1
Edit equ 7
Stk equ 2048+1024 some default stack size
Cerror equ 257 arbitrary C error
psect mtpvalid,(Prgrm<<8)!Objct,(ReEnt<<8)!(SupStat<<8)!2,Edit,Stk,main,0
main:
moveq #1,d1 Put error code in d1
cmpi.l #4,d5 Bad number of args?
ble.s BadRet Yes, then exit
cmpi.l #$FEEDFEED,(a5)+ Does it have the right header?
bne.s BadRet No, then exit
move.l (a5)+,d0 Which command is it?
cmpi.l #0,d0 GetSysMem Command?
beq.s GetSysMem Yes, then go do it
cmpi.l #1,d0 FreeSysMem Command?
beq.s FreeSysMem Yes, then go do it
cmpi.l #2,d0 Validate Command?
bne.s BadRet No, then exit
Validate:
move.l (a5)+,a0 Get Pointer to the memory
move.l a0,d0 Save pointer to memory
move.l (a5)+,d1 Save memory size
OS9 F$VModul Validate module
bcs.s BadRet Some thing is wrong
bra GoodRet
GetSysMem:
move.l (a5)+,d0 Get size of buffer
OS9 F$SRqMem Get System memory
bcs.s BadRet
move.l (a5)+,a0
move.l a2,(a0) Store return address
bra GoodRet
FreeSysMem:
move.l (a5)+,a2 Get address of buffer
move.l (a5)+,d0 Get size of buffer
OS9 F$SRtMem Return System memory
bcs.s BadRet
bra GoodRet
GoodRet:
moveq #0,d1
BadRet:
OS9 F$Exit
ends