| 2646 | } |
| 2647 | |
| 2648 | int asCByteCode::InstrSHORT_W(asEBCInstr bc, short a, asWORD b) |
| 2649 | { |
| 2650 | asASSERT(asBCInfo[bc].type == asBCTYPE_wW_DW_ARG || |
| 2651 | asBCInfo[bc].type == asBCTYPE_rW_DW_ARG || |
| 2652 | asBCInfo[bc].type == asBCTYPE_W_DW_ARG); |
| 2653 | asASSERT(asBCInfo[bc].stackInc == 0); |
| 2654 | |
| 2655 | if( AddInstruction() < 0 ) |
| 2656 | return 0; |
| 2657 | |
| 2658 | last->op = bc; |
| 2659 | last->wArg[0] = a; |
| 2660 | |
| 2661 | // We'll have to be careful to store the word correctly, independent of endianess. |
| 2662 | // Some optimizing compilers may change the order of operations, so we make sure |
| 2663 | // the value is not overwritten even if that happens. |
| 2664 | asWORD *argPtr = (asWORD*)ARG_DW(last->arg); |
| 2665 | argPtr[0] = b; // The value is always stored in the lower word |
| 2666 | argPtr[1] = 0; // and clear the rest of the DWORD |
| 2667 | |
| 2668 | last->size = asBCTypeSize[asBCInfo[bc].type]; |
| 2669 | last->stackInc = asBCInfo[bc].stackInc; |
| 2670 | |
| 2671 | return last->stackInc; |
| 2672 | } |
| 2673 | |
| 2674 | int asCByteCode::InstrSHORT_DW(asEBCInstr bc, short a, asDWORD b) |
| 2675 | { |