Mercurial > repos > blastem
annotate zruntime.S @ 254:64feb6b67244
Fix bug in end condition inside translate_z80_stream.
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 29 Apr 2013 22:37:47 -0700 |
parents | 3b34deba4ca0 |
children | d9417261366f |
rev | line source |
---|---|
249
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1 z_inccycles: |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2 cmp %edi, %ebp |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
3 jnb do_limit |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
4 no_sync: |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
5 add $3, %ebp |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
6 ret |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
7 do_limit: |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
8 cmp 112(%rsi), %ebp |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
9 jb no_sync |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
10 call z80_save_context_scratch |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
11 pop %rax /*return address in read/write func*/ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
12 pop 104(%rsi) /*return address in native code*/ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
13 sub $5, %rax /* adjust return addres to point to the call instruction that got us here */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
14 mov %rax, (%rsi) |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
15 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
16 pop %r15 /* restore callee saved regsiters */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
17 pop %r14 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
18 pop %r13 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
19 pop %r12 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
20 pop %rbp |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
21 pop %rbx |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
22 ret /* return to caller of z80_run */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
23 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
24 .global z80_handle_cycle_limit_int |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
25 z80_handle_cycle_limit_int: |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
26 cmp 116(%rsi), %ebp |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
27 jb zskip_int |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
28 mov 112(%rsi), %ebp /* set cycle limit to sync cycle */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
29 add $7, %ebp |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
30 sub $2, %r9w |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
31 mov %r9w, %r13w |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
32 call z_inccycles |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
33 push %r14 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
34 call z80_write_byte_noinc |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
35 pop %r14 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
36 mov %r9w, %r13w |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
37 add $1, %r13w |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
38 shr $8, %r14w |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
39 call z_inccycles |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
40 call z80_write_byte_noinc |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
41 /* TODO: Support interrupt mode 0 and 2 */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
42 mov $0x38, %r13w |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
43 call z80_native_addr |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
44 jmp *%r13 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
45 zskip_int: |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
46 cmp 112(%rsi), %ebp |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
47 jb zskip_sync |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
48 call z80_save_context |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
49 .global z80_do_sync |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
50 z80_do_sync: |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
51 pop (%rsi) /*return address in native code*/ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
52 pop %r15 /* restore callee saved regsiters */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
53 pop %r14 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
54 pop %r13 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
55 pop %r12 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
56 pop %rbp |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
57 pop %rbx |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
58 zskip_sync: |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
59 ret |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
60 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
61 .global z80_read_byte |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
62 z80_read_byte: |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
63 call z_inccycles |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
64 z80_read_byte_noinc: |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
65 cmp $0x4000, %r13w |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
66 jb z80_read_ram |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
67 cmp $0x8000, %r13w |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
68 jae z80_read_bank |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
69 /* TODO: Bank reg, YM-2612, PSG/VDP */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
70 ret |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
71 z80_read_ram: |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
72 and $0x1FFF, %r13 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
73 mov (%r11, %r13), %r13b |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
74 ret |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
75 z80_read_bank: |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
76 and $0x7FFF, %r13 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
77 cmp $0, %r12 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
78 je slow_bank_read |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
79 /* 68K memory is byte swapped */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
80 xor $1, %r13 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
81 mov (%r12, %r13), %r13b |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
82 ret |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
83 slow_bank_read: |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
84 /* TODO: Call into C to implement this */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
85 ret |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
86 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
87 .global z80_write_byte |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
88 z80_write_byte: |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
89 call z_inccycles |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
90 z80_write_byte_noinc: |
253
3b34deba4ca0
Squashing some bugs introduced when I switched the register assignments for z80_write_byte around.
Mike Pavone <pavone@retrodev.com>
parents:
252
diff
changeset
|
91 cmp $0x4000, %r14w |
249
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
92 jb z80_write_ram |
253
3b34deba4ca0
Squashing some bugs introduced when I switched the register assignments for z80_write_byte around.
Mike Pavone <pavone@retrodev.com>
parents:
252
diff
changeset
|
93 cmp $0x8000, %r14w |
249
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
94 jae z80_write_bank |
253
3b34deba4ca0
Squashing some bugs introduced when I switched the register assignments for z80_write_byte around.
Mike Pavone <pavone@retrodev.com>
parents:
252
diff
changeset
|
95 cmp $0x6000, %r14w |
249
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
96 je z80_write_bank_reg |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
97 /* TODO: YM-2612, PSG/VDP */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
98 ret |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
99 z80_write_ram: |
253
3b34deba4ca0
Squashing some bugs introduced when I switched the register assignments for z80_write_byte around.
Mike Pavone <pavone@retrodev.com>
parents:
252
diff
changeset
|
100 and $0x1FFF, %r14 |
3b34deba4ca0
Squashing some bugs introduced when I switched the register assignments for z80_write_byte around.
Mike Pavone <pavone@retrodev.com>
parents:
252
diff
changeset
|
101 mov %r13b, (%r11, %r14) |
3b34deba4ca0
Squashing some bugs introduced when I switched the register assignments for z80_write_byte around.
Mike Pavone <pavone@retrodev.com>
parents:
252
diff
changeset
|
102 mov %r14d, %r13d |
3b34deba4ca0
Squashing some bugs introduced when I switched the register assignments for z80_write_byte around.
Mike Pavone <pavone@retrodev.com>
parents:
252
diff
changeset
|
103 shr $7, %r13d |
3b34deba4ca0
Squashing some bugs introduced when I switched the register assignments for z80_write_byte around.
Mike Pavone <pavone@retrodev.com>
parents:
252
diff
changeset
|
104 bt %r13d, 152(%rsi) |
252
63b9a500a00b
Implement retranslating code when written to. Possibly broken, need to fix some other bugs before a proper test.
Mike Pavone <pavone@retrodev.com>
parents:
249
diff
changeset
|
105 jnc not_code |
63b9a500a00b
Implement retranslating code when written to. Possibly broken, need to fix some other bugs before a proper test.
Mike Pavone <pavone@retrodev.com>
parents:
249
diff
changeset
|
106 call z80_save_context |
253
3b34deba4ca0
Squashing some bugs introduced when I switched the register assignments for z80_write_byte around.
Mike Pavone <pavone@retrodev.com>
parents:
252
diff
changeset
|
107 mov %r14d, %edi |
252
63b9a500a00b
Implement retranslating code when written to. Possibly broken, need to fix some other bugs before a proper test.
Mike Pavone <pavone@retrodev.com>
parents:
249
diff
changeset
|
108 call z80_handle_code_write |
63b9a500a00b
Implement retranslating code when written to. Possibly broken, need to fix some other bugs before a proper test.
Mike Pavone <pavone@retrodev.com>
parents:
249
diff
changeset
|
109 mov %rax, %rsi |
63b9a500a00b
Implement retranslating code when written to. Possibly broken, need to fix some other bugs before a proper test.
Mike Pavone <pavone@retrodev.com>
parents:
249
diff
changeset
|
110 not_code: |
249
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
111 ret |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
112 z80_write_bank: |
253
3b34deba4ca0
Squashing some bugs introduced when I switched the register assignments for z80_write_byte around.
Mike Pavone <pavone@retrodev.com>
parents:
252
diff
changeset
|
113 and $0x7FFF, %r14 |
249
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
114 cmp $0, %r12 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
115 je slow_bank_write |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
116 /* 68K memory is byte swapped */ |
253
3b34deba4ca0
Squashing some bugs introduced when I switched the register assignments for z80_write_byte around.
Mike Pavone <pavone@retrodev.com>
parents:
252
diff
changeset
|
117 xor $1, %r14 |
3b34deba4ca0
Squashing some bugs introduced when I switched the register assignments for z80_write_byte around.
Mike Pavone <pavone@retrodev.com>
parents:
252
diff
changeset
|
118 mov %r13b, (%r12, %r14) |
249
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
119 ret |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
120 slow_bank_write: |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
121 /* TODO: Call into C to implement this */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
122 ret |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
123 z80_write_bank_reg: |
253
3b34deba4ca0
Squashing some bugs introduced when I switched the register assignments for z80_write_byte around.
Mike Pavone <pavone@retrodev.com>
parents:
252
diff
changeset
|
124 and $1, %r13w |
249
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
125 shl %r15w |
253
3b34deba4ca0
Squashing some bugs introduced when I switched the register assignments for z80_write_byte around.
Mike Pavone <pavone@retrodev.com>
parents:
252
diff
changeset
|
126 or %r13w, %r15w |
249
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
127 and $0x1FF, %r15w |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
128 xor %r12, %r12 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
129 cmp $0x80, %r15w |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
130 jb update_bank_ptr |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
131 ret |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
132 update_bank_ptr: |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
133 mov %r15w, %r12w |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
134 shl $15, %r12 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
135 add 80(%rsi), %r12 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
136 ret |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
137 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
138 .global z80_read_word |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
139 z80_read_word: |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
140 call z_inccycles |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
141 push %r13 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
142 call z80_read_byte_noinc |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
143 mov %r13b, %r14b |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
144 pop %r13 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
145 inc %r13 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
146 call z_inccycles |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
147 call z80_read_byte_noinc |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
148 shl $8, %r13w |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
149 mov %r14b, %r13b |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
150 ret |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
151 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
152 .global z80_write_word_highfirst |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
153 z80_write_word_highfirst: |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
154 call z_inccycles |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
155 push %r14 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
156 push %r13 |
253
3b34deba4ca0
Squashing some bugs introduced when I switched the register assignments for z80_write_byte around.
Mike Pavone <pavone@retrodev.com>
parents:
252
diff
changeset
|
157 add $1, %r14w |
3b34deba4ca0
Squashing some bugs introduced when I switched the register assignments for z80_write_byte around.
Mike Pavone <pavone@retrodev.com>
parents:
252
diff
changeset
|
158 shr $8, %r13w |
249
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
159 call z80_write_byte_noinc |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
160 pop %r13 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
161 pop %r14 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
162 call z_inccycles |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
163 call z80_write_byte_noinc |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
164 ret |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
165 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
166 .global z80_write_word_lowfirst |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
167 z80_write_word_lowfirst: |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
168 call z_inccycles |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
169 push %r14 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
170 push %r13 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
171 call z80_write_byte_noinc |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
172 pop %r13 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
173 pop %r14 |
253
3b34deba4ca0
Squashing some bugs introduced when I switched the register assignments for z80_write_byte around.
Mike Pavone <pavone@retrodev.com>
parents:
252
diff
changeset
|
174 add $1, %r14w |
3b34deba4ca0
Squashing some bugs introduced when I switched the register assignments for z80_write_byte around.
Mike Pavone <pavone@retrodev.com>
parents:
252
diff
changeset
|
175 shr $8, %r13w |
249
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
176 call z_inccycles |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
177 call z80_write_byte_noinc |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
178 ret |
252
63b9a500a00b
Implement retranslating code when written to. Possibly broken, need to fix some other bugs before a proper test.
Mike Pavone <pavone@retrodev.com>
parents:
249
diff
changeset
|
179 |
63b9a500a00b
Implement retranslating code when written to. Possibly broken, need to fix some other bugs before a proper test.
Mike Pavone <pavone@retrodev.com>
parents:
249
diff
changeset
|
180 .global z80_retrans_stub |
63b9a500a00b
Implement retranslating code when written to. Possibly broken, need to fix some other bugs before a proper test.
Mike Pavone <pavone@retrodev.com>
parents:
249
diff
changeset
|
181 z80_retrans_stub: |
63b9a500a00b
Implement retranslating code when written to. Possibly broken, need to fix some other bugs before a proper test.
Mike Pavone <pavone@retrodev.com>
parents:
249
diff
changeset
|
182 call z80_save_context |
63b9a500a00b
Implement retranslating code when written to. Possibly broken, need to fix some other bugs before a proper test.
Mike Pavone <pavone@retrodev.com>
parents:
249
diff
changeset
|
183 mov %r13d, %edi |
63b9a500a00b
Implement retranslating code when written to. Possibly broken, need to fix some other bugs before a proper test.
Mike Pavone <pavone@retrodev.com>
parents:
249
diff
changeset
|
184 push %rsi |
63b9a500a00b
Implement retranslating code when written to. Possibly broken, need to fix some other bugs before a proper test.
Mike Pavone <pavone@retrodev.com>
parents:
249
diff
changeset
|
185 call z80_retranslate_inst |
63b9a500a00b
Implement retranslating code when written to. Possibly broken, need to fix some other bugs before a proper test.
Mike Pavone <pavone@retrodev.com>
parents:
249
diff
changeset
|
186 pop %rsi |
63b9a500a00b
Implement retranslating code when written to. Possibly broken, need to fix some other bugs before a proper test.
Mike Pavone <pavone@retrodev.com>
parents:
249
diff
changeset
|
187 mov %rax, %r13 |
63b9a500a00b
Implement retranslating code when written to. Possibly broken, need to fix some other bugs before a proper test.
Mike Pavone <pavone@retrodev.com>
parents:
249
diff
changeset
|
188 call z80_load_context |
63b9a500a00b
Implement retranslating code when written to. Possibly broken, need to fix some other bugs before a proper test.
Mike Pavone <pavone@retrodev.com>
parents:
249
diff
changeset
|
189 jmp *%r13 |
249
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
190 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
191 .global z80_native_addr |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
192 z80_native_addr: |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
193 call z80_save_context |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
194 push %rsi |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
195 mov %rsi, %rdi |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
196 movzx %r13w, %esi |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
197 call z80_get_native_address_trans |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
198 mov %rax, %r13 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
199 pop %rsi |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
200 call z80_load_context |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
201 ret |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
202 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
203 z80_save_context_scratch: |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
204 mov %r13w, 98(%rsi) /* scratch1 */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
205 mov %r14w, 100(%rsi) /* scratch2 */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
206 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
207 .global z80_save_context |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
208 z80_save_context: |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
209 mov %r9w, 8(%rsi) /* SP */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
210 mov %r15w, 16(%rsi) /* bank register */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
211 mov %bx, 18(%rsi) /* BC */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
212 mov %cx, 20(%rsi) /* DE */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
213 mov %ax, 22(%rsi) /* HL */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
214 mov %dx, 24(%rsi) /* IX */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
215 mov %r8w, 26(%rsi) /* IY */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
216 mov %r10b, 30(%rsi) /* A */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
217 mov %edi, 48(%rsi) /* target_cycle */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
218 mov %ebp, 52(%rsi) /* current_cycle */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
219 mov %r12, 72(%rsi) /* cartridge bank pointer */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
220 ret |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
221 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
222 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
223 z80_load_context_scratch: |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
224 mov 98(%rsi), %r13w /* scratch1 */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
225 mov 100(%rsi), %r14w /* scratch2 */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
226 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
227 .global z80_load_context |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
228 z80_load_context: |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
229 mov 8(%rsi), %r9w /* SP */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
230 mov 16(%rsi), %r15w /* bank register */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
231 mov 18(%rsi), %bx /* BC */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
232 mov 20(%rsi), %cx /* DE */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
233 mov 22(%rsi), %ax /* HL */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
234 mov 24(%rsi), %dx /* IX */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
235 mov 26(%rsi), %r8w /* IY */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
236 mov 30(%rsi), %r10b /* A */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
237 mov 48(%rsi), %edi /* target_cycle */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
238 mov 52(%rsi), %ebp /* current_cycle */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
239 mov 64(%rsi), %r11 /* z80 RAM */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
240 mov 72(%rsi), %r12 /* cartridge bank pointer */ |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
241 ret |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
242 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
243 .global z80_run |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
244 z80_run: |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
245 push %rbx |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
246 push %rbp |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
247 push %r12 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
248 push %r13 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
249 push %r14 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
250 push %r15 |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
251 mov %rdi, %rsi |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
252 call z80_load_context_scratch |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
253 cmpq $0, 104(%rsi) |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
254 je no_extra |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
255 push 104(%rsi) |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
256 movq $0, 104(%rsi) |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
257 no_extra: |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
258 jmp *(%rsi) |
d94e6cd5a8a5
Forgot to commit zruntime a while back, adding it now.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
259 |