Board index » delphi » BP7: mov eax,something in an assebler statement?

BP7: mov eax,something in an assebler statement?

The subject sais it.

Is it possible to use 386 assembler instructions with the
BP's 'asm' command?

--------------------------------------------------------------------------
Aki Lumme                 | Why Windows?
amlu...@cc.helsinki.fi    |
www.helsinki.fi/~amlumme  | - You can press 'OK' before the crash!

 

Re:BP7: mov eax,something in an assebler statement?


amlu...@cc.Helsinki.FI (Aki M Lumme) writes:

Quote
>The subject sais it.
>Is it possible to use 386 assembler instructions with the
>BP's 'asm' command?

No. But, if you type something like
db 66
mov ax,<something>

the system uses eax. If the 32-bit register (actually its some 'alternate')
opcode is too unreliable or otherwise difficult, i'd recommed using TASM.

Quote
>--------------------------------------------------------------------------
>Aki Lumme                 | Why Windows?
>amlu...@cc.helsinki.fi    |
>www.helsinki.fi/~amlumme  | - You can press 'OK' before the crash!

--
I am Smilodon.           * Email   : smilo...@niksula.hut.fi
 Saber-toothed.          * Address : --
  Born to maul, to kill. * Phone   : --
*************************************************************************

Re:BP7: mov eax,something in an assebler statement?


Aki M Lumme (amlu...@cc.Helsinki.FI) wrote:
: The subject sais it.

: Is it possible to use 386 assembler instructions with the
: BP's 'asm' command?

: --------------------------------------------------------------------------
: Aki Lumme                 | Why Windows?
: amlu...@cc.helsinki.fi    |
: www.helsinki.fi/~amlumme  | - You can press 'OK' before the crash!

 Hello Aki !

 The only way to use 32bit wide commands in BP7.0 ASM statements is to
 use the prefix bytes of intel's 386 and newer ones.

 The usage is as follows:

 ...
 ASM

             mov  AX, WORD PTR [some_Word]
   DB $66;   mov  BX, WORD PTR [some_LongInt]

 END;
 ...

 The prefix byte $66 would tell the proc that the next command opcode
 has to exec with 32 bit access. The address itself is still 16:16 bits
 (SEG:OFS). You could use the $67 prefix to switch the address to
 16:32 bits, but without heavy workarounds it goes straight hang up
 the machine.

 The prefix bytes depends on the size bit in the codesegment descriptor
 which would be accessed with CS reg. If the CODE segment is a 16 bit
 segment (like BP7.0) it works like above. But if it is a 32 bit segment,
 the effect of the prefix byte is vice versa: The ACCESS is 16 bit, but
 the address is still 16:32 bits.

 For a detail description I suggest you the Assembler Reference coming
 with the BP7.0 paket. There is a nice table just before the list of
 assembler opcodes...

 Hope I could help you,

    Rudi, coder for NETZWERK dev. group.

 P.S.: If you still have trouble with it, send me an e-mail
       (mr...@cs.uni-sb.de).
       Because we develope games with BP7.0, I am looking for
       a 32bit version of BPascal + 32bit DPMI-extender.
       If you know where or when to get, let me know.

Other Threads