source: buchla-68k/orig/MT/MTNEXT.S@ 66b48e7

Last change on this file since 66b48e7 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Imported original source code.

  • Property mode set to 100755
File size: 2.2 KB
Line 
1* ------------------------------------------------------------------------------
2* mtnext.s -- Multi-tasker -- C function linkages
3* Version 2 -- 1988-04-14 -- D.N. Lynx Crowe
4* (c) Copyright 1988 -- D.N. Lynx Crowe
5* Machine cycles are given as the first number in the comments for timing.
6* ------------------------------------------------------------------------------
7 .text
8*
9DEBUGGER .equ 0 * define non-zero for debug
10*
11 .xdef _MTNext
12 .xdef _MTSwap
13*
14 .ifne DEBUGGER
15*
16 .xref _DB_Cmnt
17*
18 .endc
19*
20TRAP_SWP .equ 8 * swapper TRAP number 1
21TRAP_NXT .equ 9 * swapper TRAP number 2
22*
23* ------------------------------------------------------------------------------
24*
25* MTSwap() -- C linkage to the task swapper TRAP -- swap
26* -------- ------------------------------------------
27*
28* ------------------------------------------------------------------------------
29 .ifne DEBUGGER
30*
31_MTSwap: movem.l d0-d7/a0-a6,-(a7) * DB_CMNT("MTSwap");
32 move.l #DB_msg1,-(a7) * ...
33 jsr _DB_Cmnt * ...
34 tst.l (a7)+ * ...
35 movem.l (a7)+,d0-d7/a0-a6 * ...
36 trap #TRAP_SWP * 37 trap to the swapper
37 .endc
38*
39 .ifeq DEBUGGER
40*
41_MTSwap: trap #TRAP_SWP * 37 trap to the swapper
42*
43 .endc
44*
45* ------------------------------------------------------------------------------
46 rts * 16 return to the caller
47*
48 .page
49*
50* ------------------------------------------------------------------------------
51*
52* MTNext() -- C linkage to the task swapper TRAP -- next
53* -------- ------------------------------------------
54*
55* ------------------------------------------------------------------------------
56 .ifne DEBUGGER
57*
58_MTNext: movem.l d0-d7/a0-a6,-(a7) * DB_CMNT("MTNext");
59 move.l #DB_msg2,-(a7) * ...
60 jsr _DB_Cmnt * ...
61 tst.l (a7)+ * ...
62 movem.l (a7)+,d0-d7/a0-a6 * ...
63 trap #TRAP_NXT * 37 trap to the swapper
64*
65 .endc
66*
67 .ifeq DEBUGGER
68*
69_MTNext: trap #TRAP_NXT * 37 trap to the swapper
70*
71 .endc
72*
73* ------------------------------------------------------------------------------
74 rts * 16 return to the caller
75*
76 .ifne DEBUGGER
77*
78 .data
79*
80DB_msg1: dc.b 'MTSwap',0
81DB_msg2: dc.b 'MTNext',0
82*
83 .endc
84*
85 .end
Note: See TracBrowser for help on using the repository browser.