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

Subversion Repositories s80186

[/] [s80186/] [trunk/] [rtl/] [microcode/] [jmp.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
.at 0xe9;
19
    read_immed, jmp jmpe9;
20
.auto_address;
21
jmpe9:
22
    a_sel IP, b_sel IMMEDIATE, alu_op ADD, load_ip,
23
        next_instruction;
24
 
25
.at 0xea;
26
    read_immed, jmp jmpea;
27
.auto_address;
28
jmpea:
29
    b_sel IMMEDIATE, alu_op SELB, load_ip;
30
    // read_immed can't be combined in the previous microinstruction as
31
    // otherwise it will clobber the immediate during stalling whilst load_ip
32
    // is asserted and we'll load an invalid IP.
33
    read_immed;
34
    b_sel IMMEDIATE, alu_op SELB, segment_wr_en,
35
        segment_force, segment CS, next_instruction;
36
 
37
.at 0xeb;
38
    width W8, read_immed, jmp jmpeb;
39
.auto_address;
40
jmpeb:
41
    a_sel IP, b_sel IMMEDIATE, alu_op ADD, load_ip,
42
        next_instruction;
43
 
44
jmpff_indirect_intra_reg:
45
    a_sel RA, alu_op SELA, load_ip,
46
        next_instruction;
47
jmpff_indirect_intra_mem:
48
    segment DS, mem_read;
49
    a_sel MDR, alu_op SELA, load_ip,
50
        next_instruction;
51
 
52
jmpff_indirect_inter_reg:
53
    next_instruction;
54
jmpff_indirect_inter_mem:
55
    segment DS, mem_read;
56
    a_sel MDR, alu_op SELA, load_ip;
57
    immediate 0x2, a_sel MAR, b_sel IMMEDIATE, alu_op ADD,
58
        mar_wr_sel Q, mar_write, segment DS;
59
    segment DS, mem_read;
60
    a_sel MDR, alu_op SELA, segment_wr_en,
61
        segment_force, segment CS, next_instruction;
62
 
63
// JCXZ
64
.at 0xe3;
65
    width W8, read_immed, jmp jcxz;
66
 
67
.auto_address;
68
jcxz:
69
    rb_cl;
70
    jmp_rb_zero jcxz_taken;
71
    next_instruction;
72
jcxz_taken:
73
    a_sel IP, b_sel IMMEDIATE, alu_op ADD, load_ip, next_instruction;
74
 
75
#define JUMP(opcode) \
76
.at opcode; \
77
    width W8, read_immed, jmp test_jump
78
 
79
JUMP(0x70);
80
JUMP(0x71);
81
JUMP(0x72);
82
JUMP(0x73);
83
JUMP(0x74);
84
JUMP(0x75);
85
JUMP(0x76);
86
JUMP(0x77);
87
JUMP(0x78);
88
JUMP(0x79);
89
JUMP(0x7a);
90
JUMP(0x7b);
91
JUMP(0x7c);
92
JUMP(0x7d);
93
JUMP(0x7e);
94
JUMP(0x7f);
95
 
96
.auto_address;
97
test_jump:
98
    jmp_if_taken jmp_taken;
99
    next_instruction;
100
jmp_taken:
101
    a_sel IP, b_sel IMMEDIATE, alu_op ADD, load_ip, next_instruction;

powered by: WebSVN 2.1.0

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