OpenCores
URL https://opencores.org/ocsvn/s80186/s80186/trunk

Subversion Repositories s80186

[/] [s80186/] [trunk/] [rtl/] [microcode/] [io.us] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 jamieiles
// Copyright Jamie Iles, 2017
2
//
3
// This file is part of s80x86.
4
//
5
// s80x86 is free software: you can redistribute it and/or modify
6
// it under the terms of the GNU General Public License as published by
7
// the Free Software Foundation, either version 3 of the License, or
8
// (at your option) any later version.
9
//
10
// s80x86 is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
// GNU General Public License for more details.
14
//
15
// You should have received a copy of the GNU General Public License
16
// along with s80x86.  If not, see .
17
 
18
// out imm8, al
19
.at 0xe6;
20
    width W8, read_immed, b_sel IMMEDIATE, alu_op SELB,
21
        mar_wr_sel Q, mar_write, jmp oute6, ra_sel AL;
22
// out imm16, al
23
.at 0xe7;
24
    width W8, read_immed, b_sel IMMEDIATE, alu_op SELB, mar_wr_sel Q,
25
        mar_write, jmp oute6;
26
.auto_address;
27
oute6:
28
    a_sel MAR, b_sel IMMEDIATE, immediate 0xff, alu_op AND, mar_write,
29
        mar_wr_sel Q;
30
    a_sel RA, alu_op SELA, mdr_write;
31
    width WAUTO, io, mem_write, next_instruction;
32
 
33
// out dx, al
34
.at 0xee;
35
    width W8, ra_sel AL, jmp outee;
36
// out dx, ax
37
.at 0xef;
38
    ra_sel AX, jmp outee;
39
.auto_address;
40
outee:
41
    a_sel RA, alu_op SELA, mdr_write, ra_sel DX;
42
    a_sel RA, alu_op SELA, mar_write, mar_wr_sel Q;
43
    width WAUTO, io, mem_write, next_instruction;
44
 
45
// in al, immed8
46
.at 0xe4;
47
    width W8, read_immed, b_sel IMMEDIATE, alu_op SELB,
48
        mar_wr_sel Q, mar_write, jmp ine4;
49
// in ax, immed16
50
.at 0xe5;
51
    width W8, read_immed, b_sel IMMEDIATE, alu_op SELB,
52
        mar_wr_sel Q, mar_write, jmp ine4;
53
.auto_address;
54
ine4:
55
    a_sel MAR, b_sel IMMEDIATE, immediate 0xff, alu_op AND, mar_write,
56
        mar_wr_sel Q;
57
    width WAUTO, io, mem_read;
58
    a_sel MDR, alu_op SELA, rd_sel_source MICROCODE_RD_SEL,
59
        rd_sel AL, width WAUTO, next_instruction;
60
 
61
// in dx, al
62
.at 0xec;
63
    ra_sel DX, jmp inec;
64
// in dx, ax
65
.at 0xed;
66
    ra_sel DX, jmp inec;
67
.auto_address;
68
inec:
69
    a_sel RA, alu_op SELA, mar_write, mar_wr_sel Q;
70
    width WAUTO, io, mem_read;
71
    a_sel MDR, alu_op SELA, rd_sel_source MICROCODE_RD_SEL,
72
        rd_sel AL, width WAUTO, next_instruction;
73
 
74
.at 0x6e;
75
    jmp outsb;
76
 
77
.auto_address;
78
outsb:
79
    ra_sel SI, jmp_if_not_rep outsb_no_rep;
80
    rb_cl;
81
outsb_rep_loop:
82
    ra_sel CX, a_sel RA, b_sel IMMEDIATE, immediate 0x0, alu_op SUB,
83
        jmp_rb_zero outsb_done;
84
    ra_sel SI, a_sel RA, b_sel IMMEDIATE, immediate 0x1, alu_op SUB,
85
        rd_sel_source MICROCODE_RD_SEL, rd_sel CX;
86
outsb_no_rep:
87
    ra_sel SI, a_sel RA, alu_op SELA, mar_wr_sel Q, mar_write, segment DS;
88
    a_sel RA, b_sel IMMEDIATE, immediate 0x1, alu_op NEXT,
89
        rd_sel_source MICROCODE_RD_SEL, rd_sel SI, segment DS;
90
    width W8, segment DS, mem_read;
91
    ra_sel DX;
92
    a_sel RA, alu_op SELA, mar_write, mar_wr_sel Q;
93
    width W8, io, mem_write, jmp_if_not_rep outsb_done;
94
    rb_cl, ext_int_yield, jmp outsb_rep_loop;
95
outsb_done:
96
    next_instruction;
97
 
98
.at 0x6f;
99
    jmp outsw;
100
 
101
.auto_address;
102
outsw:
103
    ra_sel SI, jmp_if_not_rep outsw_no_rep;
104
    rb_cl;
105
outsw_rep_loop:
106
    ra_sel CX, a_sel RA, b_sel IMMEDIATE, immediate 0x0, alu_op SUB,
107
        jmp_rb_zero outsw_done;
108
    ra_sel SI, a_sel RA, b_sel IMMEDIATE, immediate 0x1, alu_op SUB,
109
        rd_sel_source MICROCODE_RD_SEL, rd_sel CX;
110
outsw_no_rep:
111
    ra_sel SI, a_sel RA, alu_op SELA, mar_wr_sel Q, mar_write, segment DS;
112
    a_sel RA, b_sel IMMEDIATE, immediate 0x2, alu_op NEXT,
113
        rd_sel_source MICROCODE_RD_SEL, rd_sel SI, segment DS;
114
    segment DS, mem_read;
115
    ra_sel DX;
116
    a_sel RA, alu_op SELA, mar_write, mar_wr_sel Q;
117
    io, mem_write, jmp_if_not_rep outsw_done;
118
    rb_cl, ext_int_yield, jmp outsw_rep_loop;
119
outsw_done:
120
    next_instruction;
121
 
122
.at 0x6c;
123
    jmp insb;
124
 
125
.auto_address;
126
insb:
127
    ra_sel DX, jmp_if_not_rep insb_no_rep;
128
    rb_cl;
129
insb_rep_loop:
130
    ra_sel CX, a_sel RA, b_sel IMMEDIATE, immediate 0x0, alu_op SUB,
131
        jmp_rb_zero insb_done;
132
    ra_sel DI, a_sel RA, b_sel IMMEDIATE, immediate 0x1, alu_op SUB,
133
        rd_sel_source MICROCODE_RD_SEL, rd_sel CX, ra_sel DX;
134
insb_no_rep:
135
    a_sel RA, alu_op SELA, mar_wr_sel Q, mar_write;
136
    width W8, io, mem_read;
137
    ra_sel DI;
138
    a_sel RA, alu_op SELA, mar_write, mar_wr_sel Q, segment ES, segment_force;
139
    segment ES, segment_force, width W8, mem_write;
140
    ra_sel DI;
141
    a_sel RA, b_sel IMMEDIATE, immediate 0x1, alu_op NEXT,
142
        rd_sel_source MICROCODE_RD_SEL, rd_sel DI,
143
        jmp_if_not_rep insb_done;
144
    rb_cl, ext_int_yield, jmp insb_rep_loop;
145
insb_done:
146
    next_instruction;
147
 
148
.at 0x6d;
149
    jmp insw;
150
 
151
.auto_address;
152
insw:
153
    ra_sel DX, jmp_if_not_rep insw_no_rep;
154
    rb_cl;
155
insw_rep_loop:
156
    ra_sel CX, a_sel RA, b_sel IMMEDIATE, immediate 0x0, alu_op SUB,
157
        jmp_rb_zero insw_done;
158
    ra_sel DI, a_sel RA, b_sel IMMEDIATE, immediate 0x1, alu_op SUB,
159
        rd_sel_source MICROCODE_RD_SEL, rd_sel CX, ra_sel DX;
160
insw_no_rep:
161
    a_sel RA, alu_op SELA, mar_wr_sel Q, mar_write;
162
    io, mem_read;
163
    ra_sel DI;
164
    a_sel RA, alu_op SELA, mar_write, mar_wr_sel Q, segment ES, segment_force;
165
    segment ES, segment_force, mem_write;
166
    ra_sel DI;
167
    a_sel RA, b_sel IMMEDIATE, immediate 0x2, alu_op NEXT,
168
        rd_sel_source MICROCODE_RD_SEL, rd_sel DI,
169
        jmp_if_not_rep insw_done;
170
    rb_cl, ext_int_yield, jmp insw_rep_loop;
171
insw_done:
172
    next_instruction;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.