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

Subversion Repositories ao486

[/] [ao486/] [trunk/] [rtl/] [ao486/] [commands/] [CMD_SCAS.txt] - Rev 2

Compare with Previous | Blame | View Log


<defines>
`define CMD_SCAS        #AUTOGEN_NEXT_CMD

`define CMDEX_SCAS_STEP_0       4'd0
</defines>

<decode>
dec_ready_one && { decoder[7:1], 1'b0 } == 8'hAE
`CMD_SCAS
SET(dec_cmdex, `CMDEX_SCAS_STEP_0);
IF(decoder[0] == 1'b0); SET(dec_is_8bit); ENDIF();
SET(consume_one);
IF(dec_prefix_group_1_rep != 2'd0); SET(dec_is_complex); ENDIF();
</decode>

<microcode>
//complex instruction only if: dec_prefix_group_1 != 2'd0
LOOP(`CMDEX_SCAS_STEP_0);
</microcode>

<read>
IF(rd_cmd == `CMD_SCAS);
            
    SET(address_edi);

    //waiting for edi in 'address_waiting'
    
    IF(rd_mutex_busy_memory || (rd_mutex_busy_ecx && rd_prefix_group_1_rep != 2'd0)); SET(rd_waiting); //waiting for ecx for rd_string_ignore
    ELSE();
        
        IF(~(rd_string_ignore));
            SET(rd_dst_is_eax);
            SET(rd_src_is_memory);

            SET(read_virtual);

            IF(~(read_for_rd_ready)); SET(rd_waiting);
            ELSE();
                SET(rd_req_edi);
                SET(rd_req_eflags);
                //not needed -- reset after finish //IF(rd_prefix_group_1_rep != 2'd0); SET(rd_req_ecx); ENDIF();
            ENDIF();
        ENDIF();
    ENDIF();
ENDIF();
</read>

<execute>
IF(exe_cmd == `CMD_SCAS);
    
    SET(exe_result, exe_arith_sub[31:0]);
    SET(exe_arith_index, (`ARITH_VALID | `ARITH_SUB));
ENDIF();
</execute>

<write>
IF(wr_cmd == `CMD_SCAS);
    
    IF(~(wr_string_ignore));
        SAVE(edi, wr_edi_final);
        IF(wr_prefix_group_1_rep != 2'd0); SAVE(ecx, wr_ecx_final); ENDIF();

        SAVE(zflag, zflag_result);
        SAVE(sflag, sflag_result);
        SAVE(pflag, pflag_result);

        SAVE(aflag, aflag_arith);
        SAVE(cflag, cflag_arith);
        SAVE(oflag, oflag_arith);
    ENDIF();
    
    IF(wr_string_ignore || wr_string_zf_finish);
        SET(wr_req_reset_micro);
        SET(wr_req_reset_rd);
        SET(wr_req_reset_exe);
    ENDIF();
    
    IF(~(wr_string_ignore) && ~(wr_string_zf_finish) && wr_prefix_group_1_rep != 2'd0);
        SET(wr_not_finished);
        
        SET(wr_string_in_progress);
    ENDIF();
    
ENDIF();  
</write>

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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