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

Subversion Repositories ao486

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

Compare with Previous | Blame | View Log


<defines>
`define CMD_LAHF        #AUTOGEN_NEXT_CMD
`define CMD_CBW         #AUTOGEN_NEXT_CMD
`define CMD_CWD         #AUTOGEN_NEXT_CMD
</defines>

<decode>
dec_ready_one && decoder[7:0] == 8'h9F
`CMD_LAHF
SET(consume_one);
</decode>

<decode>
dec_ready_one && decoder[7:0] == 8'h98
`CMD_CBW
SET(consume_one);
</decode>

<decode>
dec_ready_one && decoder[7:0] == 8'h99
`CMD_CWD
SET(consume_one);
</decode>

<read>
IF(rd_cmd == `CMD_LAHF || rd_cmd == `CMD_CBW || rd_cmd == `CMD_CWD);
       
    SET(rd_req_eax, rd_cmd != `CMD_CWD);
    SET(rd_req_edx, rd_cmd == `CMD_CWD);
ENDIF();
</read>

<write>
IF(wr_cmd == `CMD_LAHF);
    SAVE(eax, { eax[31:16], sflag, zflag, 1'b0, aflag, 1'b0, pflag, 1'b1, cflag, eax[7:0] });
ENDIF();
</write>

<write>
IF(wr_cmd == `CMD_CBW);
    IF(wr_operand_32bit);   SAVE(eax, { {16{eax[15]}}, eax[15:0] });
    ELSE();                 SAVE(eax, { eax[31:16], {8{eax[7]}}, eax[7:0] });
    ENDIF();
ENDIF();
</write>

<write>
IF(wr_cmd == `CMD_CWD);
    IF(wr_operand_32bit);   SAVE(edx, {32{eax[31]}});
    ELSE();                 SAVE(edx, { edx[31:16], {16{eax[15]}} });
    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.