]> git.lizzy.rs Git - plan9front.git/blob - sys/src/9/xen/l.s
import xen 32 bit paravirtual kernel from /n/sources/xen.
[plan9front.git] / sys / src / 9 / xen / l.s
1 #include "xendefs.h"
2 #include "mem.h"
3
4 /*
5  * Some machine instructions not handled by 8[al].
6  */
7 #define OP16            BYTE $0x66
8 #define DELAY           BYTE $0xEB; BYTE $0x00  /* JMP .+2 */
9 #define CPUID           BYTE $0x0F; BYTE $0xA2  /* CPUID, argument in AX */
10 #define WRMSR           BYTE $0x0F; BYTE $0x30  /* WRMSR, argument in AX/DX (lo/hi) */
11 #define RDTSC           BYTE $0x0F; BYTE $0x31  /* RDTSC, result in AX/DX (lo/hi) */
12 #define RDMSR           BYTE $0x0F; BYTE $0x32  /* RDMSR, result in AX/DX (lo/hi) */
13 #define HLT             BYTE $0xF4
14 #define BSFL            BYTE $0xf; BYTE $0xbc; BYTE $0xc0       /* bsfl AX,AX */
15
16 /*
17  * Macros for calculating offsets within the page directory base
18  * and page tables. Note that these are assembler-specific hence
19  * the '<<2'.
20  */
21 #define PDO(a)          (((((a))>>22) & 0x03FF)<<2)
22 #define PTO(a)          (((((a))>>12) & 0x03FF)<<2)
23
24 /*
25  * Entry point from XEN's "linux" builder.
26  * At this point RAM from 0..4M ("physical") is mapped at KZERO,
27  * the kernel is loaded, we're running on a boot stack and a 
28  * boot page table.  The start_info structure describes the
29  * situation, and is pointed to by SI.
30  * The stack is the highest used address.
31  */
32 TEXT _start(SB), $0
33         MOVL    SP, xentop(SB)          /* set global for top of mapped region */
34         MOVL    SI, xenstart(SB)                /* set global to start_info_t */
35         MOVL    $0, AX                  /* clear EFLAGS */
36         PUSHL   AX
37         POPFL
38         CALL    mmumapcpu0(SB)  /* make mapping before using stack */
39         MOVL    $(MACHADDR+MACHSIZE-4), SP      /* set stack */
40         CALL    main(SB)
41
42 /*
43  * Park a processor. Should never fall through a return from main to here,
44  * should only be called by application processors when shutting down.
45  */
46 TEXT idle(SB), $0
47 _idle:
48         STI
49         HLT
50         JMP     _idle
51
52 /*
53  * Read/write various system registers.
54  * CR4 and the 'model specific registers' should only be read/written
55  * after it has been determined the processor supports them
56  */
57 TEXT lgdt(SB), $0                               /* GDTR - global descriptor table */
58         MOVL    gdtptr+0(FP), AX
59         MOVL    (AX), GDTR
60         RET
61
62 TEXT lidt(SB), $0                               /* IDTR - interrupt descriptor table */
63         MOVL    idtptr+0(FP), AX
64         MOVL    (AX), IDTR
65         RET
66
67 TEXT ltr(SB), $0                                /* TR - task register */
68         MOVL    tptr+0(FP), AX
69         MOVW    AX, TASK
70         RET
71
72 TEXT rtsr(SB), $0
73         MOVW    TASK, AX
74         RET
75
76 TEXT _cycles(SB), $0                            /* time stamp counter; cycles since power up */
77         RDTSC
78         MOVL    vlong+0(FP), CX                 /* &vlong */
79         MOVL    AX, 0(CX)                       /* lo */
80         MOVL    DX, 4(CX)                       /* hi */
81         RET
82
83 TEXT rdmsr(SB), $0                              /* model-specific register */
84         MOVL    index+0(FP), CX
85         RDMSR
86         MOVL    vlong+4(FP), CX                 /* &vlong */
87         MOVL    AX, 0(CX)                       /* lo */
88         MOVL    DX, 4(CX)                       /* hi */
89         RET
90         
91 TEXT wrmsr(SB), $0
92         MOVL    index+0(FP), CX
93         MOVL    lo+4(FP), AX
94         MOVL    hi+8(FP), DX
95 /* Xen doesn't let us do this
96         WRMSR
97  */
98         RET
99
100 /*
101  * Try to determine the CPU type which requires fiddling with EFLAGS.
102  * If the Id bit can be toggled then the CPUID instruction can be used
103  * to determine CPU identity and features. First have to check if it's
104  * a 386 (Ac bit can't be set). If it's not a 386 and the Id bit can't be
105  * toggled then it's an older 486 of some kind.
106  *
107  *      cpuid(fun, regs[4]);
108  */
109 TEXT cpuid(SB), $0
110         MOVL    $0x240000, AX
111         PUSHL   AX
112         POPFL                                   /* set Id|Ac */
113         PUSHFL
114         POPL    BX                              /* retrieve value */
115         MOVL    $0, AX
116         PUSHL   AX
117         POPFL                                   /* clear Id|Ac, EFLAGS initialised */
118         PUSHFL
119         POPL    AX                              /* retrieve value */
120         XORL    BX, AX
121         TESTL   $0x040000, AX                   /* Ac */
122         JZ      _cpu386                         /* can't set this bit on 386 */
123         TESTL   $0x200000, AX                   /* Id */
124         JZ      _cpu486                         /* can't toggle this bit on some 486 */
125         MOVL    fn+0(FP), AX
126         CPUID
127         JMP     _cpuid
128 _cpu486:
129         MOVL    $0x400, AX
130         JMP     _maybezapax
131 _cpu386:
132         MOVL    $0x300, AX
133 _maybezapax:
134         CMPL    fn+0(FP), $1
135         JE      _zaprest
136         XORL    AX, AX
137 _zaprest:
138         XORL    BX, BX
139         XORL    CX, CX
140         XORL    DX, DX
141 _cpuid:
142         MOVL    regs+4(FP), BP
143         MOVL    AX, 0(BP)
144         MOVL    BX, 4(BP)
145         MOVL    CX, 8(BP)
146         MOVL    DX, 12(BP)
147         RET
148
149 /*
150  * Floating point.
151  * Note: the encodings for the FCLEX, FINIT, FSAVE, FSTCW, FSENV and FSTSW
152  * instructions do NOT have the WAIT prefix byte (i.e. they act like their
153  * FNxxx variations) so WAIT instructions must be explicitly placed in the
154  * code as necessary.
155  */
156 #define FPOFF(l)                                                 ;\
157         MOVL    CR0, AX                                          ;\
158         ANDL    $0xC, AX                        /* EM, TS */     ;\
159         CMPL    AX, $0x8                                         ;\
160         JEQ     l                                                ;\
161         WAIT                                                     ;\
162 l:                                                               ;\
163         MOVL    CR0, AX                                          ;\
164         ANDL    $~0x4, AX                       /* EM=0 */       ;\
165         ORL     $0x28, AX                       /* NE=1, TS=1 */ ;\
166         MOVL    AX, CR0
167
168 #define FPON                                                     ;\
169         MOVL    CR0, AX                                          ;\
170         ANDL    $~0xC, AX                       /* EM=0, TS=0 */ ;\
171         MOVL    AX, CR0
172         
173 TEXT fpoff(SB), $0                              /* disable */
174         FPOFF(l1)
175         RET
176
177 TEXT fpinit(SB), $0                             /* enable and init */
178         FPON
179         FINIT
180         WAIT
181         /* setfcr(FPPDBL|FPRNR|FPINVAL|FPZDIV|FPOVFL) */
182         /* note that low 6 bits are masks, not enables, on this chip */
183         PUSHW   $0x0232
184         FLDCW   0(SP)
185         POPW    AX
186         WAIT
187         RET
188
189 TEXT fpx87save(SB), $0                          /* save state and disable */
190         MOVL    p+0(FP), AX
191         FSAVE   0(AX)                           /* no WAIT */
192         FPOFF(l2)
193         RET
194
195 TEXT fpx87restore(SB), $0                               /* enable and restore state */
196         FPON
197         MOVL    p+0(FP), AX
198         FRSTOR  0(AX)
199         WAIT
200         RET
201
202 TEXT fpstatus(SB), $0                           /* get floating point status */
203         FSTSW   AX
204         RET
205
206 TEXT fpenv(SB), $0                              /* save state without waiting */
207         MOVL    p+0(FP), AX
208         FSTENV  0(AX)
209         RET
210
211 TEXT fpclear(SB), $0                            /* clear pending exceptions */
212         FPON
213         FCLEX                                   /* no WAIT */
214         FPOFF(l3)
215         RET
216
217 /*
218  * Test-And-Set
219  */
220 TEXT tas(SB), $0
221         MOVL    $0xDEADDEAD, AX
222         MOVL    lock+0(FP), BX
223         XCHGL   AX, (BX)                        /* lock->key */
224         RET
225
226 TEXT _xinc(SB), $0                              /* void _xinc(long*); */
227         MOVL    l+0(FP), AX
228         LOCK;   INCL 0(AX)
229         RET
230
231 TEXT _xdec(SB), $0                              /* long _xdec(long*); */
232         MOVL    l+0(FP), BX
233         XORL    AX, AX
234         LOCK;   DECL 0(BX)
235         JLT     _xdeclt
236         JGT     _xdecgt
237         RET
238 _xdecgt:
239         INCL    AX
240         RET
241 _xdeclt:
242         DECL    AX
243         RET
244
245 TEXT    getstack(SB), $0
246         MOVL    SP, AX
247         RET
248 TEXT mb386(SB), $0
249         POPL    AX                              /* return PC */
250         PUSHFL
251         PUSHL   CS
252         PUSHL   AX
253         IRETL
254
255 TEXT mb586(SB), $0
256         XORL    AX, AX
257         CPUID
258         RET
259
260 TEXT sfence(SB), $0
261         BYTE $0x0f
262         BYTE $0xae
263         BYTE $0xf8
264         RET
265
266 TEXT lfence(SB), $0
267         BYTE $0x0f
268         BYTE $0xae
269         BYTE $0xe8
270         RET
271
272 TEXT mfence(SB), $0
273         BYTE $0x0f
274         BYTE $0xae
275         BYTE $0xf0
276         RET
277
278
279 TEXT xchgw(SB), $0
280         MOVL    v+4(FP), AX
281         MOVL    p+0(FP), BX
282         XCHGW   AX, (BX)
283         RET
284
285 TEXT xchgb(SB), $0
286         MOVL    v+4(FP), AX
287         MOVL    p+0(FP), BX
288         XCHGB   AX, (BX)
289         RET
290
291 TEXT xchgl(SB), $0
292         MOVL    v+4(FP), AX
293         MOVL    p+0(FP), BX
294         XCHGL   AX, (BX)
295         RET
296
297 /* Return the position of the first bit set.  Undefined if zero. */
298 TEXT ffs(SB), $0
299         MOVL    v+0(FP), AX
300         BSFL
301         RET
302
303 TEXT cmpswap486(SB), $0
304         MOVL    addr+0(FP), BX
305         MOVL    old+4(FP), AX
306         MOVL    new+8(FP), CX
307         LOCK
308         BYTE $0x0F; BYTE $0xB1; BYTE $0x0B      /* CMPXCHGL CX, (BX) */
309         JNZ didnt
310         MOVL    $1, AX
311         RET
312 didnt:
313         XORL    AX,AX
314         RET
315
316 TEXT mul64fract(SB), $0
317         MOVL    r+0(FP), CX
318         XORL    BX, BX                          /* BX = 0 */
319
320         MOVL    a+8(FP), AX
321         MULL    b+16(FP)                        /* a1*b1 */
322         MOVL    AX, 4(CX)                       /* r2 = lo(a1*b1) */
323
324         MOVL    a+8(FP), AX
325         MULL    b+12(FP)                        /* a1*b0 */
326         MOVL    AX, 0(CX)                       /* r1 = lo(a1*b0) */
327         ADDL    DX, 4(CX)                       /* r2 += hi(a1*b0) */
328
329         MOVL    a+4(FP), AX
330         MULL    b+16(FP)                        /* a0*b1 */
331         ADDL    AX, 0(CX)                       /* r1 += lo(a0*b1) */
332         ADCL    DX, 4(CX)                       /* r2 += hi(a0*b1) + carry */
333
334         MOVL    a+4(FP), AX
335         MULL    b+12(FP)                        /* a0*b0 */
336         ADDL    DX, 0(CX)                       /* r1 += hi(a0*b0) */
337         ADCL    BX, 4(CX)                       /* r2 += carry */
338         RET
339
340 /*
341  *  label consists of a stack pointer and a PC
342  */
343 TEXT gotolabel(SB), $0
344         MOVL    label+0(FP), AX
345         MOVL    0(AX), SP                       /* restore sp */
346         MOVL    4(AX), AX                       /* put return pc on the stack */
347         MOVL    AX, 0(SP)
348         MOVL    $1, AX                          /* return 1 */
349         RET
350
351 TEXT setlabel(SB), $0
352         MOVL    label+0(FP), AX
353         MOVL    SP, 0(AX)                       /* store sp */
354         MOVL    0(SP), BX                       /* store return pc */
355         MOVL    BX, 4(AX)
356         MOVL    $0, AX                          /* return 0 */
357         RET
358
359 TEXT mwait(SB), $0
360         MOVL    addr+0(FP), AX
361         MOVL    (AX), CX
362         ORL     CX, CX
363         JNZ     _mwaitdone
364         XORL    DX, DX
365         BYTE $0x0f; BYTE $0x01; BYTE $0xc8      /* MONITOR */
366         MOVL    (AX), CX
367         ORL     CX, CX
368         JNZ     _mwaitdone
369         XORL    AX, AX
370         BYTE $0x0f; BYTE $0x01; BYTE $0xc9      /* MWAIT */
371 _mwaitdone:
372         RET
373
374 /*
375  * Interrupt/exception handling.
376  * Each entry in the vector table calls either _strayintr or _strayintrx depending
377  * on whether an error code has been automatically pushed onto the stack
378  * (_strayintrx) or not, in which case a dummy entry must be pushed before retrieving
379  * the trap type from the vector table entry and placing it on the stack as part
380  * of the Ureg structure.
381  * Exceptions to this are the syscall vector and the page fault
382  * vector.  Syscalls are dispatched seperately.  Page faults
383  * have to take care of the extra cr2 parameter that xen places
384  * at the top of the stack.
385  * The size of each entry in the vector table (6 bytes) is known in trapinit().
386  */
387 TEXT _strayintr(SB), $0
388         PUSHL   AX                      /* save AX */
389         MOVL    4(SP), AX               /* return PC from vectortable(SB) */
390         JMP     intrcommon
391
392 TEXT _strayintrx(SB), $0
393         XCHGL   AX, (SP)                /* swap AX with vectortable CALL PC */
394 intrcommon:
395         PUSHL   DS                      /* save DS */
396         PUSHL   $(KDSEL)
397         POPL    DS                      /* fix up DS */
398         MOVBLZX (AX), AX                /* trap type -> AX */
399         XCHGL   AX, 4(SP)               /* exchange trap type with saved AX */
400
401         PUSHL   ES                      /* save ES */
402         PUSHL   $(KDSEL)
403         POPL    ES                      /* fix up ES */
404
405         PUSHL   FS                      /* save the rest of the Ureg struct */
406         PUSHL   GS
407         PUSHAL
408
409         PUSHL   SP                      /* Ureg* argument to trap */
410         CALL    trap(SB)
411
412 TEXT forkret(SB), $0
413         POPL    AX
414         POPAL
415         POPL    GS
416         POPL    FS
417         POPL    ES
418         POPL    DS
419         ADDL    $8, SP                  /* pop error code and trap type */
420         IRETL
421
422 TEXT vectortable(SB), $0
423         CALL _strayintr(SB); BYTE $0x00         /* divide error */
424         CALL _strayintr(SB); BYTE $0x01         /* debug exception */
425         CALL _strayintr(SB); BYTE $0x02         /* NMI interrupt */
426         CALL _strayintr(SB); BYTE $0x03         /* breakpoint */
427         CALL _strayintr(SB); BYTE $0x04         /* overflow */
428         CALL _strayintr(SB); BYTE $0x05         /* bound */
429         CALL _strayintr(SB); BYTE $0x06         /* invalid opcode */
430         CALL _strayintr(SB); BYTE $0x07         /* no coprocessor available */
431         CALL _strayintrx(SB); BYTE $0x08        /* double fault */
432         CALL _strayintr(SB); BYTE $0x09         /* coprocessor segment overflow */
433         CALL _strayintrx(SB); BYTE $0x0A        /* invalid TSS */
434         CALL _strayintrx(SB); BYTE $0x0B        /* segment not available */
435         CALL _strayintrx(SB); BYTE $0x0C        /* stack exception */
436         CALL _strayintrx(SB); BYTE $0x0D        /* general protection error */
437         CALL _strayintrx(SB); BYTE $0x0E        /* page fault */
438         CALL _strayintr(SB); BYTE $0x0F         /*  */
439         CALL _strayintr(SB); BYTE $0x10         /* coprocessor error */
440         CALL _strayintrx(SB); BYTE $0x11        /* alignment check */
441         CALL _strayintr(SB); BYTE $0x12         /* machine check */
442         CALL _strayintr(SB); BYTE $0x13
443         CALL _strayintr(SB); BYTE $0x14
444         CALL _strayintr(SB); BYTE $0x15
445         CALL _strayintr(SB); BYTE $0x16
446         CALL _strayintr(SB); BYTE $0x17
447         CALL _strayintr(SB); BYTE $0x18
448         CALL _strayintr(SB); BYTE $0x19
449         CALL _strayintr(SB); BYTE $0x1A
450         CALL _strayintr(SB); BYTE $0x1B
451         CALL _strayintr(SB); BYTE $0x1C
452         CALL _strayintr(SB); BYTE $0x1D
453         CALL _strayintr(SB); BYTE $0x1E
454         CALL _strayintr(SB); BYTE $0x1F
455         CALL _strayintr(SB); BYTE $0x20         /* VectorLAPIC */
456         CALL _strayintr(SB); BYTE $0x21
457         CALL _strayintr(SB); BYTE $0x22
458         CALL _strayintr(SB); BYTE $0x23
459         CALL _strayintr(SB); BYTE $0x24
460         CALL _strayintr(SB); BYTE $0x25
461         CALL _strayintr(SB); BYTE $0x26
462         CALL _strayintr(SB); BYTE $0x27
463         CALL _strayintr(SB); BYTE $0x28
464         CALL _strayintr(SB); BYTE $0x29
465         CALL _strayintr(SB); BYTE $0x2A
466         CALL _strayintr(SB); BYTE $0x2B
467         CALL _strayintr(SB); BYTE $0x2C
468         CALL _strayintr(SB); BYTE $0x2D
469         CALL _strayintr(SB); BYTE $0x2E
470         CALL _strayintr(SB); BYTE $0x2F
471         CALL _strayintr(SB); BYTE $0x30
472         CALL _strayintr(SB); BYTE $0x31
473         CALL _strayintr(SB); BYTE $0x32
474         CALL _strayintr(SB); BYTE $0x33
475         CALL _strayintr(SB); BYTE $0x34
476         CALL _strayintr(SB); BYTE $0x35
477         CALL _strayintr(SB); BYTE $0x36
478         CALL _strayintr(SB); BYTE $0x37
479         CALL _strayintr(SB); BYTE $0x38
480         CALL _strayintr(SB); BYTE $0x39
481         CALL _strayintr(SB); BYTE $0x3A
482         CALL _strayintr(SB); BYTE $0x3B
483         CALL _strayintr(SB); BYTE $0x3C
484         CALL _strayintr(SB); BYTE $0x3D
485         CALL _strayintr(SB); BYTE $0x3E
486         CALL _strayintr(SB); BYTE $0x3F
487         CALL _syscallintr(SB); BYTE $0x40       /* VectorSYSCALL */
488         CALL _strayintr(SB); BYTE $0x41
489         CALL _strayintr(SB); BYTE $0x42
490         CALL _strayintr(SB); BYTE $0x43
491         CALL _strayintr(SB); BYTE $0x44
492         CALL _strayintr(SB); BYTE $0x45
493         CALL _strayintr(SB); BYTE $0x46
494         CALL _strayintr(SB); BYTE $0x47
495         CALL _strayintr(SB); BYTE $0x48
496         CALL _strayintr(SB); BYTE $0x49
497         CALL _strayintr(SB); BYTE $0x4A
498         CALL _strayintr(SB); BYTE $0x4B
499         CALL _strayintr(SB); BYTE $0x4C
500         CALL _strayintr(SB); BYTE $0x4D
501         CALL _strayintr(SB); BYTE $0x4E
502         CALL _strayintr(SB); BYTE $0x4F
503         CALL _strayintr(SB); BYTE $0x50
504         CALL _strayintr(SB); BYTE $0x51
505         CALL _strayintr(SB); BYTE $0x52
506         CALL _strayintr(SB); BYTE $0x53
507         CALL _strayintr(SB); BYTE $0x54
508         CALL _strayintr(SB); BYTE $0x55
509         CALL _strayintr(SB); BYTE $0x56
510         CALL _strayintr(SB); BYTE $0x57
511         CALL _strayintr(SB); BYTE $0x58
512         CALL _strayintr(SB); BYTE $0x59
513         CALL _strayintr(SB); BYTE $0x5A
514         CALL _strayintr(SB); BYTE $0x5B
515         CALL _strayintr(SB); BYTE $0x5C
516         CALL _strayintr(SB); BYTE $0x5D
517         CALL _strayintr(SB); BYTE $0x5E
518         CALL _strayintr(SB); BYTE $0x5F
519         CALL _strayintr(SB); BYTE $0x60
520         CALL _strayintr(SB); BYTE $0x61
521         CALL _strayintr(SB); BYTE $0x62
522         CALL _strayintr(SB); BYTE $0x63
523         CALL _strayintr(SB); BYTE $0x64
524         CALL _strayintr(SB); BYTE $0x65
525         CALL _strayintr(SB); BYTE $0x66
526         CALL _strayintr(SB); BYTE $0x67
527         CALL _strayintr(SB); BYTE $0x68
528         CALL _strayintr(SB); BYTE $0x69
529         CALL _strayintr(SB); BYTE $0x6A
530         CALL _strayintr(SB); BYTE $0x6B
531         CALL _strayintr(SB); BYTE $0x6C
532         CALL _strayintr(SB); BYTE $0x6D
533         CALL _strayintr(SB); BYTE $0x6E
534         CALL _strayintr(SB); BYTE $0x6F
535         CALL _strayintr(SB); BYTE $0x70
536         CALL _strayintr(SB); BYTE $0x71
537         CALL _strayintr(SB); BYTE $0x72
538         CALL _strayintr(SB); BYTE $0x73
539         CALL _strayintr(SB); BYTE $0x74
540         CALL _strayintr(SB); BYTE $0x75
541         CALL _strayintr(SB); BYTE $0x76
542         CALL _strayintr(SB); BYTE $0x77
543         CALL _strayintr(SB); BYTE $0x78
544         CALL _strayintr(SB); BYTE $0x79
545         CALL _strayintr(SB); BYTE $0x7A
546         CALL _strayintr(SB); BYTE $0x7B
547         CALL _strayintr(SB); BYTE $0x7C
548         CALL _strayintr(SB); BYTE $0x7D
549         CALL _strayintr(SB); BYTE $0x7E
550         CALL _strayintr(SB); BYTE $0x7F
551         CALL _strayintr(SB); BYTE $0x80         /* Vector[A]PIC */
552         CALL _strayintr(SB); BYTE $0x81
553         CALL _strayintr(SB); BYTE $0x82
554         CALL _strayintr(SB); BYTE $0x83
555         CALL _strayintr(SB); BYTE $0x84
556         CALL _strayintr(SB); BYTE $0x85
557         CALL _strayintr(SB); BYTE $0x86
558         CALL _strayintr(SB); BYTE $0x87
559         CALL _strayintr(SB); BYTE $0x88
560         CALL _strayintr(SB); BYTE $0x89
561         CALL _strayintr(SB); BYTE $0x8A
562         CALL _strayintr(SB); BYTE $0x8B
563         CALL _strayintr(SB); BYTE $0x8C
564         CALL _strayintr(SB); BYTE $0x8D
565         CALL _strayintr(SB); BYTE $0x8E
566         CALL _strayintr(SB); BYTE $0x8F
567         CALL _strayintr(SB); BYTE $0x90
568         CALL _strayintr(SB); BYTE $0x91
569         CALL _strayintr(SB); BYTE $0x92
570         CALL _strayintr(SB); BYTE $0x93
571         CALL _strayintr(SB); BYTE $0x94
572         CALL _strayintr(SB); BYTE $0x95
573         CALL _strayintr(SB); BYTE $0x96
574         CALL _strayintr(SB); BYTE $0x97
575         CALL _strayintr(SB); BYTE $0x98
576         CALL _strayintr(SB); BYTE $0x99
577         CALL _strayintr(SB); BYTE $0x9A
578         CALL _strayintr(SB); BYTE $0x9B
579         CALL _strayintr(SB); BYTE $0x9C
580         CALL _strayintr(SB); BYTE $0x9D
581         CALL _strayintr(SB); BYTE $0x9E
582         CALL _strayintr(SB); BYTE $0x9F
583         CALL _strayintr(SB); BYTE $0xA0
584         CALL _strayintr(SB); BYTE $0xA1
585         CALL _strayintr(SB); BYTE $0xA2
586         CALL _strayintr(SB); BYTE $0xA3
587         CALL _strayintr(SB); BYTE $0xA4
588         CALL _strayintr(SB); BYTE $0xA5
589         CALL _strayintr(SB); BYTE $0xA6
590         CALL _strayintr(SB); BYTE $0xA7
591         CALL _strayintr(SB); BYTE $0xA8
592         CALL _strayintr(SB); BYTE $0xA9
593         CALL _strayintr(SB); BYTE $0xAA
594         CALL _strayintr(SB); BYTE $0xAB
595         CALL _strayintr(SB); BYTE $0xAC
596         CALL _strayintr(SB); BYTE $0xAD
597         CALL _strayintr(SB); BYTE $0xAE
598         CALL _strayintr(SB); BYTE $0xAF
599         CALL _strayintr(SB); BYTE $0xB0
600         CALL _strayintr(SB); BYTE $0xB1
601         CALL _strayintr(SB); BYTE $0xB2
602         CALL _strayintr(SB); BYTE $0xB3
603         CALL _strayintr(SB); BYTE $0xB4
604         CALL _strayintr(SB); BYTE $0xB5
605         CALL _strayintr(SB); BYTE $0xB6
606         CALL _strayintr(SB); BYTE $0xB7
607         CALL _strayintr(SB); BYTE $0xB8
608         CALL _strayintr(SB); BYTE $0xB9
609         CALL _strayintr(SB); BYTE $0xBA
610         CALL _strayintr(SB); BYTE $0xBB
611         CALL _strayintr(SB); BYTE $0xBC
612         CALL _strayintr(SB); BYTE $0xBD
613         CALL _strayintr(SB); BYTE $0xBE
614         CALL _strayintr(SB); BYTE $0xBF
615         CALL _strayintr(SB); BYTE $0xC0
616         CALL _strayintr(SB); BYTE $0xC1
617         CALL _strayintr(SB); BYTE $0xC2
618         CALL _strayintr(SB); BYTE $0xC3
619         CALL _strayintr(SB); BYTE $0xC4
620         CALL _strayintr(SB); BYTE $0xC5
621         CALL _strayintr(SB); BYTE $0xC6
622         CALL _strayintr(SB); BYTE $0xC7
623         CALL _strayintr(SB); BYTE $0xC8
624         CALL _strayintr(SB); BYTE $0xC9
625         CALL _strayintr(SB); BYTE $0xCA
626         CALL _strayintr(SB); BYTE $0xCB
627         CALL _strayintr(SB); BYTE $0xCC
628         CALL _strayintr(SB); BYTE $0xCD
629         CALL _strayintr(SB); BYTE $0xCE
630         CALL _strayintr(SB); BYTE $0xCF
631         CALL _strayintr(SB); BYTE $0xD0
632         CALL _strayintr(SB); BYTE $0xD1
633         CALL _strayintr(SB); BYTE $0xD2
634         CALL _strayintr(SB); BYTE $0xD3
635         CALL _strayintr(SB); BYTE $0xD4
636         CALL _strayintr(SB); BYTE $0xD5
637         CALL _strayintr(SB); BYTE $0xD6
638         CALL _strayintr(SB); BYTE $0xD7
639         CALL _strayintr(SB); BYTE $0xD8
640         CALL _strayintr(SB); BYTE $0xD9
641         CALL _strayintr(SB); BYTE $0xDA
642         CALL _strayintr(SB); BYTE $0xDB
643         CALL _strayintr(SB); BYTE $0xDC
644         CALL _strayintr(SB); BYTE $0xDD
645         CALL _strayintr(SB); BYTE $0xDE
646         CALL _strayintr(SB); BYTE $0xDF
647         CALL _strayintr(SB); BYTE $0xE0
648         CALL _strayintr(SB); BYTE $0xE1
649         CALL _strayintr(SB); BYTE $0xE2
650         CALL _strayintr(SB); BYTE $0xE3
651         CALL _strayintr(SB); BYTE $0xE4
652         CALL _strayintr(SB); BYTE $0xE5
653         CALL _strayintr(SB); BYTE $0xE6
654         CALL _strayintr(SB); BYTE $0xE7
655         CALL _strayintr(SB); BYTE $0xE8
656         CALL _strayintr(SB); BYTE $0xE9
657         CALL _strayintr(SB); BYTE $0xEA
658         CALL _strayintr(SB); BYTE $0xEB
659         CALL _strayintr(SB); BYTE $0xEC
660         CALL _strayintr(SB); BYTE $0xED
661         CALL _strayintr(SB); BYTE $0xEE
662         CALL _strayintr(SB); BYTE $0xEF
663         CALL _strayintr(SB); BYTE $0xF0
664         CALL _strayintr(SB); BYTE $0xF1
665         CALL _strayintr(SB); BYTE $0xF2
666         CALL _strayintr(SB); BYTE $0xF3
667         CALL _strayintr(SB); BYTE $0xF4
668         CALL _strayintr(SB); BYTE $0xF5
669         CALL _strayintr(SB); BYTE $0xF6
670         CALL _strayintr(SB); BYTE $0xF7
671         CALL _strayintr(SB); BYTE $0xF8
672         CALL _strayintr(SB); BYTE $0xF9
673         CALL _strayintr(SB); BYTE $0xFA
674         CALL _strayintr(SB); BYTE $0xFB
675         CALL _strayintr(SB); BYTE $0xFC
676         CALL _strayintr(SB); BYTE $0xFD
677         CALL _strayintr(SB); BYTE $0xFE
678         CALL _strayintr(SB); BYTE $0xFF