; public_domain_notice ; ; Copyright (c) 1996 David P. Murphy for Datametrics Systems Corporation --- ; please send all comments and bug reports to murphy@connor.datametrics.com ; ; Permission is granted to any individual or institution to use, copy, or ; redistribute this software so long as all of the original files are included, ; that it is not sold for profit, and that this copyright notice is retained. ; Use at your own risk. Neither Murphy nor Datametrics assumes responsibility. ; Do not taunt Happy Fun Ball. .title PROBEMEM .ident /V1.0/ ; these two functions determine if the process is allowed to access ; the specified area of memory in the desired manner (read or write). ; returns 1 (granted) or 0 (denied). ; ; C prototypes: ; int DSC_CanReadMemory(int memsize, void *memaddr); ; int DSC_CanWriteMemory(int memsize, void *memaddr); .psect $code pic,usr,con,rel,lcl,shr,exe,rd,nowrt,novec,long memsize = 4 memaddr = 8 .entry DSC_CanReadMemory, ^m<> clrl r0 ; assume failure prober #0, memsize(ap), @memaddr(ap) ; can we read from this area? beql ENDR ; nope movl #1, r0 ; yep ENDR: ret .entry DSC_CanWriteMemory, ^m<> clrl r0 ; assume failure probew #0, memsize(ap), @memaddr(ap) ; can we write to this area? beql ENDW ; nope movl #1, r0 ; yep ENDW: ret .end