WinAsm Studio, The Assembly IDE - Free Downloads, Source Code
Sponsors
Articles
Programming Quick Start
32-bit Assembler is Easy
Porting Iczelion tutorials
What is FASM
What is FASM G
Hard Drive Recovery
Wiring your own LAN
Personal menu
Welcome Guest
User:
Pass:
Register!
Resend Validation Email
 
Forum
 

The BSWAP instruction is not supported, instruction or register not accepted in current CPU mode - here is a quick replacement for the BSWAP instruction.

lavendalla
Quote Post


New Member
*

Group: Members
Posts: 2
Member No.: 19580
Joined: 7-March 09


Sponsored Links
Would it be possible to add support for the BSWAP command?

When I try to use it in winasm studio, it says "instruction or register not accepted in current CPU mode"

However, when I open up the program in Olly and add the BSWAP instruction, it works.

Basically, BSWAP will reverse the order of the bytes in a 32 bit register. The byte codes for bswap ebx are 0F CB.

Here's a link for more info BSWAP info

Hope to see this added in soon.
PMEmail Poster
Top
lavendalla
Quote Post


New Member
*

Group: Members
Posts: 2
Member No.: 19580
Joined: 7-March 09


I coded a temporary replacement for the BSWAP command.
It requires that the original data be passed in ebx.

CODE
xor eax,eax
mov ah,bl
mov al,bh
shl eax,16
shr ebx,16
mov ah,bl
mov al,bh

hope this helps someone else as well

lavendalla
PMEmail Poster
Top
XeS
Quote Post


Extremely Active Member
******

Group: Members
Posts: 253
Member No.: 15879
Joined: 3-December 08


BSWAP support has nothing to do with WinAsm Studio! It have to be supported by the assembler/compiler (guessed masm). And you have to use .486 instruction set or higher.

Snippet from "opcodes.hlp"
CODE

BSWAP - Byte Swap       (486+)
       Usage:  BSWAP   reg32
       Modifies flags: none
       Changes the byte order of a 32 bit register from big endian to
       little endian or vice versa.   Result left in destination register
       is undefined if the operand is a 16 bit register.
                                Clocks                 Size
       Operands         808x  286   386   486          Bytes

       reg32             -     -     -     1             2

       0F C8+ rd BSWAP r32 Reverses the byte order of a 32-bit register.


You can use "Intel Hex Opcodes And Mnemonics" as a reference which is located in your masm directory!
Example:
C:\masm32\help\opcodes.hlp

Hope this helps!

Regards,

XeS
PMEmail PosterUsers WebsiteICQ
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll

 

Sponsors
Computer Science

Internet
C/C++
Hardware & PC maintenance

HiEditor

General Discussions
Suggestions/Bug Reports
WinAsm Studio

General Discussions
Suggestions/Bug Reports
WinAsm Studio FAQ
Multilingual User Interface
Add-Ins
Assembly Programming

Main
Newbies
Projects
Custom Controls
Snippets
Announcements & Rules

Announcements

General

Online Degrees - Distance Learning
The Heap
Russian
Google