www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Inserting raw data in inline asm

reply Leopold Walkling <leopold_walkling web.de> writes:
What are those "pseudo-ops" in inline asm like db, dw, dd, dl, df... for?
Jan 04 2007
next sibling parent reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"Leopold Walkling" <leopold_walkling web.de> wrote in message 
news:enjsji$kjj$1 digitaldaemon.com...
 What are those "pseudo-ops" in inline asm like db, dw, dd, dl, df... for?
Doesn't your topic answer your question? I guess they're for inserting static data without using D syntax..
Jan 04 2007
parent reply Leopold Walkling <leopold_walkling web.de> writes:
Jarrett Billingsley schrieb:
 "Leopold Walkling" <leopold_walkling web.de> wrote in message 
 news:enjsji$kjj$1 digitaldaemon.com...
 What are those "pseudo-ops" in inline asm like db, dw, dd, dl, df... for?
Doesn't your topic answer your question? I guess they're for inserting static data without using D syntax..
I found out what it does, but for what reason should I insert a raw float into the machine code?
Jan 04 2007
parent reply BCS <nothing pathlink.com> writes:
Leopold Walkling wrote:
 Jarrett Billingsley schrieb:
 "Leopold Walkling" <leopold_walkling web.de> wrote in message 
 news:enjsji$kjj$1 digitaldaemon.com...
 What are those "pseudo-ops" in inline asm like db, dw, dd, dl, df... 
 for?
Doesn't your topic answer your question? I guess they're for inserting static data without using D syntax..
I found out what it does, but for what reason should I insert a raw float into the machine code?
for doing something like this in ASM; float a, b; a = b * 7.35235532; or maybe float[] arr;
Jan 04 2007
parent Frits van Bommel <fvbommel REMwOVExCAPSs.nl> writes:
BCS wrote:
 Leopold Walkling wrote:
 Jarrett Billingsley schrieb:
 "Leopold Walkling" <leopold_walkling web.de> wrote in message 
 news:enjsji$kjj$1 digitaldaemon.com...
 What are those "pseudo-ops" in inline asm like db, dw, dd, dl, df... 
 for?
Doesn't your topic answer your question? I guess they're for inserting static data without using D syntax..
I found out what it does, but for what reason should I insert a raw float into the machine code?
for doing something like this in ASM; float a, b; a = b * 7.35235532; or maybe float[] arr;
I think you'll find you'd put the floats into instructions that move them to the coprocessor (or whatever, never used floats from asm). But I'm pretty sure you wouldn't want to just paste the raw binary representation of a float into a spot where the cpu will expect a new instruction to start. That sounds like a recipe for disaster... I guess those pseudo-ops are not very useful in an inline assembler. Though I suppose you could jump over them and use them as values in memory from other instructions[1]. Or you could use them to generate opcodes for (new) instructions that the compiler doesn't (yet) know about :)... [1]: which is probably as good as useless, since you typically can't modify the code section, which is where they'd be stored...
Jan 04 2007
prev sibling parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Leopold Walkling schrieb am 2007-01-04:
 What are those "pseudo-ops" in inline asm like db, dw, dd, dl, df... for?
sample: asm{inc EAX;} and asm{db 0x40;} result in the same output, because the x86 encoding of "inc EAX" is 0x40. Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFFnY7aLK5blCcjpWoRAjH+AJ9mEzCj8/h679vEEtAbQ7qU8IreIACfSRIf EvPCKdOFMhC4wUCZ/FGCQO0= =YE1e -----END PGP SIGNATURE-----
Jan 04 2007