home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / dirs / setcpu_400.lzh / SetCPU / setcpu.i < prev    next >
Text File  |  1990-11-03  |  4KB  |  192 lines

  1. ;======================================================================
  2. ;
  3. ;    SetCPU V1.60
  4. ;    by Dave Haynie, April 13, 1990
  5. ;    Released to the Public Domain
  6. ;
  7. ;    Assembly Header File
  8. ;
  9. ;    All assembly files need this included
  10. ;
  11. ;======================================================================
  12.  
  13. ;======================================================================
  14. ;
  15. ;    Macros & constants used herein.  The Manx assembler is supposed
  16. ;    to handle the 68881 and some of the 68020/30 instructions, but
  17. ;    these macros will help out on older assemblers, and complete the
  18. ;    set of instructions I need.
  19. ;
  20. ;======================================================================
  21.  
  22. CALLSYS        macro   *
  23.         jsr     LVO\1(A6)
  24.         endm
  25.  
  26. PMOVE_        macro    *
  27.         ifc '\1','tc'
  28.             ifc '\2','(sp)'
  29.             dc.w    $f017    ; PMOVE tc,(sp)
  30.             dc.w    $4200
  31.             mexit
  32.             endc
  33.             ifc '\2','(a0)'
  34.             dc.w    $f010    ; PMOVE tc,(a0)
  35.             dc.w    $4200
  36.             mexit
  37.             endc
  38.         endc
  39.         ifc '\1','crp'
  40.             ifc '\2','(a0)'
  41.             dc.w    $f010    ; PMOVE    crp,(a0)
  42.             dc.w    $4e00
  43.             mexit
  44.             endc
  45.         endc
  46.         ifc '\1','(a0)'
  47.             ifc '\2','crp'
  48.             dc.w    $f010    ; PMOVE    (a0),crp
  49.             dc.w    $4c00
  50.             mexit
  51.             endc
  52.             ifc '\2','tc'
  53.             dc.w    $f010    ; PMOVE (a0),tc
  54.             dc.w    $4000
  55.             mexit
  56.             endc
  57.         endc
  58.         ifc '\1','(a1)'
  59.             ifc '\2','crp'
  60.             dc.w    $f011    ; PMOVE (a1),crp
  61.             dc.w    $4c00
  62.             mexit
  63.             endc
  64.         endc
  65.         endm
  66. PFLUSHA_    macro    *
  67.         dc.w    $f000
  68.         dc.w    $2400
  69.         endm
  70.  
  71. MOVEC_        macro    *
  72.         ifc '\1','cacr'
  73.             ifc '\2','d0'
  74.             dc.w    $4e7a    ; MOVEC    cacr,d0
  75.             dc.w    $0002
  76.             mexit
  77.             endc
  78.             ifc '\2','d1'
  79.             dc.w    $4e7a    ; MOVEC    cacr,d1
  80.             dc.w    $1002
  81.             mexit
  82.             endc
  83.         endc
  84.         ifc '\2','cacr'
  85.             ifc '\1','d0'
  86.             dc.w    $4e7b    ; MOVEC d0,cacr
  87.             dc.w    $0002
  88.             mexit
  89.             endc
  90.             ifc '\1','d1'
  91.             dc.w    $4e7b    ; MOVEC d1,cacr
  92.             dc.w    $1002
  93.             mexit
  94.             endc
  95.         endc
  96.         ifc '\1','vbr'
  97.             ifc '\2','d0'
  98.             dc.w    $4e7a    ; MOVEC    vbr,d0
  99.             dc.w    $0801
  100.             mexit
  101.             endc
  102.         endm
  103.  
  104. CIB_ENABLE    EQU    0
  105. CIB_FREEZE    EQU    1
  106. CIB_ENTRY    EQU    2
  107. CIB_CLEAR    EQU    3
  108. CIB_BURST    EQU    4
  109.  
  110. CDB_ENABLE    EQU    8
  111. CDB_FREEZE    EQU    9
  112. CDB_ENTRY    EQU    10
  113. CDB_CLEAR    EQU    11
  114. CDB_BURST    EQU    12
  115. CDB_WALLOC    EQU    13
  116.  
  117. CIB_ENABLE40    EQU    15
  118. CDB_ENABLE40    EQU    31
  119.  
  120. AFB_68030    EQU    2
  121. AFB_68040    EQU    3
  122. AFB_68882    EQU    5
  123.  
  124. ATNFLGS        EQU    $129
  125.  
  126. LVOSupervisor    EQU    -30
  127. LVOSuperState    EQU    -150
  128. LVOFindTask    EQU    -294
  129. LVOAllocTrap    EQU    -342
  130. LVOFreeTrap    EQU    -348
  131. LVOCacheClearU    EQU    -636
  132. LVOCacheControl    EQU    -648
  133.  
  134. ANYCREG        EQU    $00dff010
  135.  
  136. ;======================================================================
  137. ;
  138. ;    Need just a little more stuff
  139. ;
  140. ;======================================================================
  141.  
  142.     NOLIST
  143.     include "exec/types.i"
  144.     include "exec/execbase.i"
  145.     include "exec/tasks.i"
  146.     LIST
  147.  
  148. ;======================================================================
  149. ;
  150. ;    The assembly version of my tag structure
  151. ;
  152. ;======================================================================
  153.  
  154.  STRUCTURE    TAG,0
  155.    ULONG     TAG_TAGSIZE        ; Size of this tag
  156.    ULONG    TAG_PROGVER        ; The program version
  157.    APTR        TAG_MAINTABLE        ; The main ROM table
  158.    APTR        TAG_ROMHI        ; The main ROM image
  159.    UWORD     TAG_ROMTYPE        ; Type of MMU ROM
  160.    UWORD     TAG_PATCHES        ; The number of other patches applied
  161.    APTR     TAG_PATCHLIST        ; List of installed patches
  162.    APTR        TAG_DEVS        ; Translated device ROMs
  163.    ULONG    TAG_TC            ; Precomputed TC used for KICK.
  164.    ULONG    TAG_CRP_0        ; Precomputed CRP used for KICK.
  165.    ULONG    TAG_CRP_1
  166.    UWORD    TAG_CONFIG        ; Configuration status.
  167.    ULONG    TAG_BERRSIZE        ; Size of bus error handler.
  168.    APTR        TAG_OLDBERR        ; The old BERR routine.
  169.    APTR        TAG_BERRHANDLER        ; My BERR routine.
  170.    SHORT    TAG_WRAPUP        ; Upper address wrap bound.
  171.    SHORT    TAG_WRAPDOWN        ; Lower address wrap bound.
  172.    ULONG    TAG_TABLESIZE        ; Main table size.
  173.    APTR        TAG_RESETCODE        ; Actual reset routine
  174.    ULONG    TAG_ROMSIZE        ; Size of ROM image
  175.    ULONG    TAG_ROMLOC        ; Where does the fool thing go?
  176.    ULONG    TAG_ROMSTART        ; And where do we start it up? 
  177.    APTR        TAG_ROMLO        ; Secondary ROM image, if needed
  178.    APTR        TAG_SYSSTACK        ; Physical system stack image
  179.    ULONG    TAG_SYSSTKSIZE        ; System Stack allocated size
  180.    ULONG    TAG_RESETSIZE        ; Size of the reset code.
  181.    APTR        TAG_OLDRESET        ; Old Reset Code
  182.    LABEL    TAG_SIZE
  183.  
  184. ;TAG_TC        EQU    28
  185. ;TAG_CRP_0    EQU    32
  186. ;TAG_RESETCODE    EQU    62
  187. ;TAG_ROMSTART    EQU    74
  188.  
  189.     machine mc68020
  190.         mc68881
  191.  
  192.