Changeset 1991 in vbox
- Timestamp:
- Apr 9, 2007 11:56:29 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/EMAllA.asm
r1986 r1991 654 654 retn 655 655 ENDPROC EMEmulateBtr 656 657 ;; 658 ; Emulate BTC instruction, CDECL calling conv. 659 ; EMDECL(uint32_t) EMEmulateBtc(uint32_t *pu32Param1, uint32_t u32Param2); 660 ; 661 ; @returns EFLAGS after the operation, only arithmetic flags is valid. 662 ; @param [esp + 04h] Param 1 - First parameter - pointer to data item. 663 ; @param [esp + 08h] Param 2 - Second parameter. 664 ; @uses eax, ecx, edx 665 ; 666 align 16 667 BEGINPROC EMEmulateBtc 668 %ifdef __AMD64__ 669 %ifndef __WIN64__ 670 mov rcx, rdi ; rcx = first parameter 671 mov rdx, rsi ; rdx = second parameter 672 %endif ; !__WIN64__ 673 %else ; !__AMD64__ 674 mov ecx, [esp + 04h] ; ecx = first parameter 675 mov edx, [esp + 08h] ; edx = second parameter 676 %endif 677 678 and edx, 7 679 btc [MY_PTR_REG], edx 680 681 ; collect flags and return. 682 pushf 683 pop MY_RET_REG 684 retn 685 ENDPROC EMEmulateBtc 686 687 ;; 688 ; Emulate BTS instruction, CDECL calling conv. 689 ; EMDECL(uint32_t) EMEmulateBts(uint32_t *pu32Param1, uint32_t u32Param2); 690 ; 691 ; @returns EFLAGS after the operation, only arithmetic flags is valid. 692 ; @param [esp + 04h] Param 1 - First parameter - pointer to data item. 693 ; @param [esp + 08h] Param 2 - Second parameter. 694 ; @uses eax, ecx, edx 695 ; 696 align 16 697 BEGINPROC EMEmulateBts 698 %ifdef __AMD64__ 699 %ifndef __WIN64__ 700 mov rcx, rdi ; rcx = first parameter 701 mov rdx, rsi ; rdx = second parameter 702 %endif ; !__WIN64__ 703 %else ; !__AMD64__ 704 mov ecx, [esp + 04h] ; ecx = first parameter 705 mov edx, [esp + 08h] ; edx = second parameter 706 %endif 707 708 and edx, 7 709 bts [MY_PTR_REG], edx 710 711 ; collect flags and return. 712 pushf 713 pop MY_RET_REG 714 retn 715 ENDPROC EMEmulateBts
Note:
See TracChangeset
for help on using the changeset viewer.