home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / developm / source / oodleutl.cpt / oodles-of-utils / NotInROM / +OSUtils.lisp < prev    next >
Encoding:
Text File  |  1992-02-07  |  1.6 KB  |  44 lines

  1. ;; -*- package: NotInROM -*-
  2. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3. ;; +OSUtils.Lisp
  4. ;;
  5. ;; Copyright ⌐ 1992 Northwestern University Institute for the Learning Sciences
  6. ;; All Rights Reserved
  7. ;;
  8. ;; author: Michael S. Engber
  9. ;;
  10. ;; Provides the Operating System Utilites Routines
  11. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  12.  
  13. (eval-when (:compile-toplevel :load-toplevel :execute)
  14.   (require    :NotInROM-u)
  15.   (in-package :NotInROM))
  16.  
  17. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  18.  
  19. (deftrap-NotInROM _NGetTrapAddress :long ((trapNum :signed-integer) (tType :TrapType))
  20.   (%ptr-to-int (ecase tType
  21.                  (#.#$OSTrap   (#_GetOSTrapAddress   trapNum))
  22.                  (#.#$ToolTrap (#_GetToolTrapAddress trapNum)))))
  23.  
  24. (deftrap-NotInROM _NSetTrapAddress :none ((trapAddr :signed-long) (trapNum :signed-integer) (tType :TrapType))
  25.   (ecase tType
  26.     (#.#$OSTrap   (#_SetOSTrapAddress   (%int-to-ptr trapAddr) trapNum))
  27.     (#.#$ToolTrap (#_SetToolTrapAddress (%int-to-ptr trapAddr) trapNum))))
  28.  
  29. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  30.  
  31. (deftrap-NotInROM _Environs :none ((rom (:pointer :signed-integer)) (machine (:pointer :signed-integer)))
  32.   (with-macptrs ((ROMBase (%get-ptr (%int-to-ptr #$ROMBase))))
  33.     (let ((hi (%get-unsigned-byte ROMBase 8))
  34.           (lo (%get-unsigned-byte ROMBase 9)))
  35.       (if (= lo #xFF)
  36.         (progn
  37.           (%put-word machine 0)
  38.           (%put-word rom hi))
  39.         (progn
  40.           (%put-word rom lo)
  41.           (%put-word machine (1+ hi)))))))
  42.  
  43. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  44.