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

Subversion Repositories rtf8088

[/] [rtf8088/] [trunk/] [rtl/] [verilog/] [CMPSB.v] - Blame information for rev 8

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 robfinch
//=============================================================================
2
//  CMPSB
3
//
4
//
5 7 robfinch
//  2009-2013 Robert Finch
6 2 robfinch
//  Stratford
7 7 robfinch
//  robfinch<remove>@finitron.ca
8 2 robfinch
//
9
//
10
// This source file is free software: you can redistribute it and/or modify 
11
// it under the terms of the GNU Lesser General Public License as published 
12
// by the Free Software Foundation, either version 3 of the License, or     
13
// (at your option) any later version.                                      
14
//                                                                          
15
// This source file is distributed in the hope that it will be useful,      
16
// but WITHOUT ANY WARRANTY; without even the implied warranty of           
17
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            
18
// GNU General Public License for more details.                             
19
//                                                                          
20
// You should have received a copy of the GNU General Public License        
21
// along with this program.  If not, see <http://www.gnu.org/licenses/>.    
22
//
23
//
24
//=============================================================================
25
//
26
CMPSB:
27 7 robfinch
        begin
28
                read(`CT_RDMEM,{seg_reg,`SEG_SHIFT} + si);
29 2 robfinch
                lock_o <= 1'b0;
30
                state <= CMPSB1;
31
        end
32
CMPSB1:
33
        if (ack_i) begin
34 7 robfinch
                nack();
35 2 robfinch
                state <= CMPSB2;
36
                lock_o <= 1'b0;
37
                a[ 7:0] <= dat_i[7:0];
38
                a[15:8] <= {8{dat_i[7]}};
39
        end
40
CMPSB2:
41
        begin
42
                state <= CMPSB3;
43 7 robfinch
                read(`CT_RDMEM,esdi);
44 2 robfinch
                lock_o <= 1'b0;
45
        end
46
CMPSB3:
47
        if (ack_i) begin
48 7 robfinch
                nack();
49 2 robfinch
                state <= CMPSB4;
50
                lock_o <= 1'b0;
51
                b[ 7:0] <= dat_i[7:0];
52
                b[15:8] <= {8{dat_i[7]}};
53
        end
54
CMPSB4:
55
        begin
56
                pf <= pres;
57
                zf <= reszb;
58
                sf <= resnb;
59
                af <= carry   (1'b1,a[3],b[3],alu_o[3]);
60
                cf <= carry   (1'b1,a[7],b[7],alu_o[7]);
61
                vf <= overflow(1'b1,a[7],b[7],alu_o[7]);
62
                if (df) begin
63
                        si <= si_dec;
64
                        di <= di_dec;
65
                end
66
                else begin
67
                        si <= si_inc;
68
                        di <= di_inc;
69
                end
70
                if ((repz & !cxz & zf) | (repnz & !cxz & !zf)) begin
71
                        cx <= cx_dec;
72 7 robfinch
                        ip <= ir_ip;
73
                        state <= IFETCH;
74 2 robfinch
                end
75
                else
76
                        state <= IFETCH;
77
        end
78
 

powered by: WebSVN 2.1.0

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