Changeset 4f508e6 in buchla-68k for iolib/rtraps.s


Ignore:
Timestamp:
07/01/2017 02:34:46 PM (7 years ago)
Author:
Thomas Lopatic <thomas@…>
Branches:
master
Children:
08e1da1
Parents:
f40a309
Message:

Converted assembly language files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • iolib/rtraps.s

    rf40a309 r4f508e6  
    1 * ------------------------------------------------------------------------------
    2 * rtraps.s -- define ROMP debug trap
    3 * Version 7 -- 1988-01-12 -- Copyright 1987, 1988 by D.N. Lynx Crowe
    4 * ------------------------------------------------------------------------------
     1| ------------------------------------------------------------------------------
     2| rtraps.s -- define ROMP debug trap
     3| Version 7 -- 1988-01-12 -- Copyright 1987, 1988 by D.N. Lynx Crowe
     4| ------------------------------------------------------------------------------
    55                .text
    6 *
     6
    77                .xdef   _trap15
    8 *
     8
    99                .xref   _rompbp
    10 *
     10
    1111                .xref   tr1sav,tr13sav,tr14sav
    1212                .xref   tr1rmp,tr13rmp,tr14rmp
    13 *
    14 BUCHLA          .equ    1               * IPL value:  0 = NASA , 1 = Buchla
    15 *
     13
     14BUCHLA          =       1               | IPL value:  0 = NASA , 1 = Buchla
     15
    1616                .ifeq   BUCHLA
    17 IPLEVEL         .equ    $0400           * NASA IPL = 4    (enable 5 and above)
     17IPLEVEL         =       0x0400          | NASA IPL = 4    (enable 5 and above)
    1818                .endc
    19 *
     19
    2020                .ifne   BUCHLA
    21 IPLEVEL         .equ    $0200           * Buchla IPL = 2  (enable 3 and above)
     21IPLEVEL         =       0x0200          | Buchla IPL = 2  (enable 3 and above)
    2222                .endc
    23 *
    24 IPL7            .equ    $0700           * IPL 7
    25 *
    26 * _trap15 -- ROMP debug trap  (used to implement breakpoints)
    27 * -------    ------------------------------------------------
    28 _trap15:        ori.w   #IPL7,sr                * Disable interrupts
    29                 move.w  #0,-(a7)                * Keep stack long aligned
    30                 movem.l d0-d7/a0-a7,-(a7)       * Save regs on stack
    31                 move.l  tr1sav,tr1rmp           * Save trap save areas
    32                 move.l  tr13sav,tr13rmp         * ...
    33                 move.l  tr14sav,tr14rmp         * ...
    34                 move.w  sr,d0                   * Get status register
    35                 andi.w  #$F8FF,d0               * Enable serial I/O interrupts
    36                 ori.w   #IPLEVEL,d0             * ...
    37                 move.w  d0,sr                   * ...
    38                 jsr     _rompbp                 * Pass control to ROMP
    39 *
    40                 ori.w   #IPL7,sr                * Disable interrupts
    41                 move.l  tr14rmp,tr14sav         * Restore trap save areas
    42                 move.l  tr13rmp,tr13sav         * ...
    43                 move.l  tr1rmp,tr1sav           * ...
    44                 movem.l (a7)+,d0-d7/a0-a7       * Restore regs
    45                 addq.l  #2,a7                   * Discard alignment filler word
    46                 rte                             * Back to what we interrupted
    47 *
     23
     24IPL7            =       0x0700          | IPL 7
     25
     26| _trap15 -- ROMP debug trap  (used to implement breakpoints)
     27| -------    ------------------------------------------------
     28_trap15:        ori.w   #IPL7,sr                | Disable interrupts
     29                move.w  #0,-(a7)                | Keep stack long aligned
     30                movem.l d0-d7/a0-a7,-(a7)       | Save regs on stack
     31                move.l  tr1sav,tr1rmp           | Save trap save areas
     32                move.l  tr13sav,tr13rmp         | ...
     33                move.l  tr14sav,tr14rmp         | ...
     34                move.w  sr,d0                   | Get status register
     35                andi.w  #0xF8FF,d0              | Enable serial I/O interrupts
     36                ori.w   #IPLEVEL,d0             | ...
     37                move.w  d0,sr                   | ...
     38                jsr     _rompbp                 | Pass control to ROMP
     39
     40                ori.w   #IPL7,sr                | Disable interrupts
     41                move.l  tr14rmp,tr14sav         | Restore trap save areas
     42                move.l  tr13rmp,tr13sav         | ...
     43                move.l  tr1rmp,tr1sav           | ...
     44                movem.l (a7)+,d0-d7/a0-a7       | Restore regs
     45                addq.l  #2,a7                   | Discard alignment filler word
     46                rte                             | Back to what we interrupted
     47
    4848                .end
Note: See TracChangeset for help on using the changeset viewer.