Mercurial > repos > blastem
comparison runtime.S @ 87:60b5c9e2f4e0
vertical interrupts now work
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 26 Dec 2012 20:18:58 -0800 |
parents | 3d3966c254b2 |
children | dd3c680c618c |
comparison
equal
deleted
inserted
replaced
86:3d3966c254b2 | 87:60b5c9e2f4e0 |
---|---|
14 .global handle_cycle_limit_int | 14 .global handle_cycle_limit_int |
15 handle_cycle_limit_int: | 15 handle_cycle_limit_int: |
16 cmp 88(%rsi), %eax | 16 cmp 88(%rsi), %eax |
17 jb skip_int | 17 jb skip_int |
18 push %rcx | 18 push %rcx |
19 /* call print_int_dbg */ | |
19 /* swap USP and SSP if not already in supervisor mode */ | 20 /* swap USP and SSP if not already in supervisor mode */ |
20 bt $5, 5(%rsi) | 21 bt $5, 5(%rsi) |
21 jc already_supervisor | 22 jc already_supervisor |
22 mov 72(%rsi), %edi | 23 mov 72(%rsi), %edi |
23 mov %r15d, 72(%rsi) | 24 mov %r15d, 72(%rsi) |
48 /* discard function return address */ | 49 /* discard function return address */ |
49 pop %rdi | 50 pop %rdi |
50 jmp *%rcx | 51 jmp *%rcx |
51 skip_int: | 52 skip_int: |
52 ret | 53 ret |
54 | |
55 int_dbg_msg: | |
56 .asciz "Executing Interrupt!" | |
57 print_int_dbg: | |
58 call m68k_save_context | |
59 push %rsi | |
60 lea int_dbg_msg(%rip), %rdi | |
61 call puts | |
62 pop %rsi | |
63 call m68k_load_context | |
64 ret | |
53 | 65 |
54 .global get_sr | 66 .global get_sr |
55 get_sr: | 67 get_sr: |
56 mov 5(%rsi), %cl | 68 mov 5(%rsi), %cl |
57 shl $8, %cx | 69 shl $8, %cx |