DIRECTORY Basics, DragOps; PrincOpsUtils: DEFINITIONS IMPORTS Basics = BEGIN OPEN DragOps; PagesForWords: SAFE PROC [words: INT] RETURNS [pages: PageCount] = TRUSTED INLINE { RETURN[Basics.ShiftRight[[li[li: words+(wordsPerPage-1)]], logWordsPerPage].li] }; WordsForPages: SAFE PROC [pages: PageCount] RETURNS [words: INT] = TRUSTED INLINE { RETURN[Basics.ShiftLeft[[li[li: pages]], logWordsPerPage].li] }; PagesForBytes: SAFE PROC [bytes: INT] RETURNS [pages: PageCount] = TRUSTED INLINE { RETURN[Basics.ShiftRight[[li[li: bytes+(bytesPerPage-1)]], logBytesPerPage].li] }; BytesForPages: SAFE PROC [pages: PageCount] RETURNS [bytes: INT] = TRUSTED INLINE { RETURN[Basics.ShiftLeft[[li[li: pages]], logBytesPerPage].li] }; AddressForPageNumber: SAFE PROC [page: PageNumber] RETURNS [address: LONG POINTER] = TRUSTED INLINE { RETURN[Basics.ShiftLeft[[li[li: page]], logWordsPerPage].lp] }; PageNumberForAddress: SAFE PROC [address: LONG POINTER] RETURNS [page: PageNumber] = TRUSTED INLINE { RETURN[Basics.ShiftRight[ [lp[address]], logWordsPerPage].li] }; LongZero: PROC [where: LONG POINTER, nwords: CARDINAL] = MACHINE CODE { zMISC, aZERO; zPOP; zPOP}; PUSH: PROC RETURNS [WORD] = MACHINE CODE {zPUSH}; GetClockPulses: SAFE PROC RETURNS [CARD] = TRUSTED MACHINE CODE {zMISC, aRCLK}; VERSION: SAFE PROC RETURNS [VersionResult] = TRUSTED MACHINE CODE {zMISC, aVERSION}; END. DragOpsUtils.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Levin on September 20, 1983 10:57 am Birrell, July 8, 1983 1:16 pm Russ Atkinson (RRA) February 27, 1985 8:05:00 pm PST Doug Wyatt, February 26, 1985 3:17:11 pm PST Note to the casual reader: The definitions in this interface are primarily intended for use by wizards. General clients should probably look in the "Basics" interface for the operations they need before looking here. Utilities for Basic Data Structures Conversion among various memory size measures Conversion among various memory address measures Block copying utilities - Moved to Basics Long Pointer Manipulation - No longer needed Miscellaneous Utilities for BitBlt and TextBlt (wizards only) - moved to basics Utilities for Stack data structures (wizards only) To be replaced with things appropriate to Dragon Control links GetReturnLink: PROC RETURNS [ControlLink] = MACHINE CODE {zLLB, returnOffset}; SetReturnLink: PROC [ControlLink] = MACHINE CODE {zSLB, returnOffset}; IsBound: SAFE PROC [link: ControlLink] RETURNS [BOOL] = TRUSTED INLINE {RETURN[link ~= UnboundLink AND link ~= NullLink]}; Local Frames GetReturnFrame: PROC RETURNS [FrameHandle] = LOOPHOLE[GetReturnLink]; SetReturnFrame: PROC [FrameHandle] = LOOPHOLE[SetReturnLink]; MyLocalFrame: PROC RETURNS [FrameHandle] = MACHINE CODE {zLADRB, 0}; MakeFsi: SAFE PROC [words: [0..MaxFrameSize]] RETURNS [fsi: FrameSizeIndex] = TRUSTED INLINE { FOR fsi IN [0..LastAVSlot) DO IF FrameVec[fsi] >= words THEN RETURN; ENDLOOP; ERROR }; FrameSize: SAFE PROC [fsi: FrameSizeIndex[0..LargeReturnSlot)] RETURNS [[0..MaxFrameSize]] = TRUSTED INLINE {RETURN[FrameVec[fsi]]}; Global Frames MyGlobalFrame: PROC RETURNS [GlobalFrameHandle] = MACHINE CODE {zGADRB, 0}; GlobalFrame: SAFE PROC [link: ControlLink] RETURNS [GlobalFrameHandle]; GlobalFrameAndEntryPoint: SAFE PROC [link: ControlLink] RETURNS [gf: GlobalFrameHandle, ep: CARDINAL]; Code segments Codebase: PROC [frame: GlobalFrameHandle] RETURNS [PrefixHandle] = INLINE { c: FrameCodeBase _ frame.code; c.out _ FALSE; RETURN[c.cseg] }; Allocation Vector Alloc: PROC [FrameSizeIndex] RETURNS [POINTER] = MACHINE CODE {zALLOC}; Free: PROC [POINTER] = MACHINE CODE {zFREE}; Utilities for Process data structures (wizards only) - moved to Process Utilities for Virtual Memory Map (wizards only) Note: these utilities have been moved to VMInternal and BootFile. They need to exist in two versions to allow for running on different machines. Miscellaneous (wizards only) - anything to go here? Κ·– "Cedar" style˜codešœ™Kšœ Οmœ1™