URL
https://opencores.org/ocsvn/ao486/ao486/trunk
Subversion Repositories ao486
[/] [ao486/] [trunk/] [rtl/] [ao486/] [commands/] [CMD_CLC_CMC_CLD_STC_STD_SAHF.txt] - Rev 2
Compare with Previous | Blame | View Log
<defines>
`define CMD_CLC #AUTOGEN_NEXT_CMD
`define CMD_CLD #AUTOGEN_NEXT_CMD
`define CMD_CMC #AUTOGEN_NEXT_CMD
`define CMD_STC #AUTOGEN_NEXT_CMD
`define CMD_STD #AUTOGEN_NEXT_CMD
`define CMD_SAHF #AUTOGEN_NEXT_CMD
</defines>
<decode>
dec_ready_one && decoder[7:0] == 8'hF8
`CMD_CLC
SET(consume_one);
</decode>
<decode>
dec_ready_one && decoder[7:0] == 8'hFC
`CMD_CLD
SET(consume_one);
</decode>
<decode>
dec_ready_one && decoder[7:0] == 8'hF5
`CMD_CMC
SET(consume_one);
</decode>
<decode>
dec_ready_one && decoder[7:0] == 8'hF9
`CMD_STC
SET(consume_one);
</decode>
<decode>
dec_ready_one && decoder[7:0] == 8'hFD
`CMD_STD
SET(consume_one);
</decode>
<decode>
dec_ready_one && decoder[7:0] == 8'h9E
`CMD_SAHF
SET(consume_one);
</decode>
<read>
IF(rd_cmd == `CMD_CLC || rd_cmd == `CMD_CMC || rd_cmd == `CMD_CLD || rd_cmd == `CMD_STC || rd_cmd == `CMD_STD || rd_cmd == `CMD_SAHF);
SET(rd_req_eflags);
ENDIF();
</read>
//NOTE: CMC does not wait on exe_mutex_current[`MUTEX_EFLAGS_BIT], because read in wr cycle
//NOTE: SAHF does not wait for eax, because read in wr cycle
<write>
IF(wr_cmd == `CMD_CLC); SAVE(cflag, `FALSE); ENDIF();
</write>
<write>
IF(wr_cmd == `CMD_CMC); SAVE(cflag, ~cflag); ENDIF();
</write>
<write>
IF(wr_cmd == `CMD_CLD); SAVE(dflag, `FALSE); ENDIF();
</write>
<write>
IF(wr_cmd == `CMD_STC); SAVE(cflag, `TRUE); ENDIF();
</write>
<write>
IF(wr_cmd == `CMD_STD); SAVE(dflag, `TRUE); ENDIF();
</write>
<write>
IF(wr_cmd == `CMD_SAHF);
SAVE(sflag, eax[15]);
SAVE(zflag, eax[14]);
SAVE(aflag, eax[12]);
SAVE(cflag, eax[8]);
SAVE(pflag, eax[10]);
ENDIF();
</write>