Mercurial > repos > blastem
comparison runtime.S @ 547:3090d016c9e9
Generate get_sr, set_sr and set_ccr at runtime so they can respect the flag_regs setting
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 18 Feb 2014 20:32:10 -0800 |
parents | 67cf0ce57d8d |
children | 6b248602ab84 5a6ff0d76032 |
comparison
equal
deleted
inserted
replaced
546:90aca661542b | 547:3090d016c9e9 |
---|---|
68 no_adjust_hs: | 68 no_adjust_hs: |
69 | 69 |
70 mov %rdi, %rax | 70 mov %rdi, %rax |
71 ret | 71 ret |
72 | 72 |
73 .global get_sr | |
74 get_sr: | |
75 mov 5(%rsi), %cl | |
76 shl $8, %cx | |
77 mov (%rsi), %cl | |
78 shl $1, %cl | |
79 or %bl, %cl | |
80 shl $1, %cl | |
81 or %dl, %cl | |
82 shl $1, %cl | |
83 or %bh, %cl | |
84 shl $1, %cl | |
85 or %dh, %cl | |
86 ret | |
87 | 73 |
88 .global set_sr | |
89 set_sr: | |
90 mov %cl, %dh | |
91 and $1, %dh | |
92 shr $1, %cl | |
93 mov %cl, %bh | |
94 and $1, %bh | |
95 shr $1, %cl | |
96 mov %cl, %dl | |
97 and $1, %dl | |
98 shr $1, %cl | |
99 mov %cl, %bl | |
100 and $1, %bl | |
101 shr $1, %cl | |
102 and $1, %cl | |
103 mov %cl, (%rsi) | |
104 shr $8, %cx | |
105 mov %cl, 5(%rsi) | |
106 ret | |
107 | 74 |
108 .global set_ccr | |
109 set_ccr: | |
110 mov %cl, %dh | |
111 and $1, %dh | |
112 shr $1, %cl | |
113 mov %cl, %bh | |
114 and $1, %bh | |
115 shr $1, %cl | |
116 mov %cl, %dl | |
117 and $1, %dl | |
118 shr $1, %cl | |
119 mov %cl, %bl | |
120 and $1, %bl | |
121 shr $1, %cl | |
122 and $1, %cl | |
123 mov %cl, (%rsi) | |
124 ret | |
125 |