News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

use the registry correctly

Started by elettronico_79, October 08, 2010, 05:35:43 PM

Previous topic - Next topic

Sevag.K

Quote from: elettronico_79 on December 18, 2010, 06:41:13 PM
if i've understood right, HLA support the highter level instruction like If, else, while, etc... but there is the possibility to use (in HLA) lower level sstuff like zero flag and other, right?

correct.

Quote
so, if a debugger is written in a  language, there should be some istruction or method to do what a debugger do? what are someone?

there are operating system api that allow you to do what a debugger does.  i haven't really looked into this api, but if you're interested, you should be able to find some information at msdn (for windows operating systems).

Quote
if i write a program in c++ and i need to use assembly, is HLA supported by c++ or i need another assembly language?

thanks and sorry if i bother  :(

many c++ languages support inline assembly of various syntax.  this is slowly being phased out.  however, in any modular linked language, you can write the various modules in any other modular linked language and link them together.

most of the assemblers you will find here and elsewhere (hla, masm, fasm, goasm, nasm, wasm to name a few ) are modular linked languages or support modular linking.

what this means is that you can compile your source to objects, libraries or dlls and link them with c++ programs.


elettronico_79

the logical instruction like XOR work only with the binaries number?
for example, is it possible to XOR a decimal or hexedecimal number? how?

and it's possible to XOR a phrase or a word ? what i obtain?


Thank!!

Sevag.K

Quote from: elettronico_79 on December 25, 2010, 07:33:38 PM
the logical instruction like XOR work only with the binaries number?

all the instructions work only with binary numbers.

Quote
for example, is it possible to XOR a decimal or hexedecimal number? how?

just use xor as you normally would, it won't change the outcome.  decimal or hexadecimal or floating point or whatever other format for human viewing are always converted from binary.

Quote
and it's possible to XOR a phrase or a word ? what i obtain?


Thank!!

the size of the object you can XOR depends on which instructions you use.  in standard 32bit assembly, without accessing floating/mmx/sse type instructions the maximum is dword size (4 bytes).  to XOR a phrase, you'll have to work through the phrase XORing one byte/word/dword at a time.

what you'll obtain is the compliment of the phrase.  in binary terms, it will toggle all the zeros to ones and all the ones to zeros.

eg:
.........10011
XOR..00101
----------------
.........10110


if you want a visual of this, you can download cCalc.zip (attachment on page 2 of this thread) enter some numbers in it (decimal or hexa, toggled by menu) and you'll see the binary representations of these numbers and you can try out some x/86 instructions to see what effect they have on the numbers you entered.


elettronico_79

ok, i will download cCalc, thank!
i have a doubt: if the XOR instruction only work with a pair of binary digits, what happen if the digits are more than two?
for example is possible to XOR 10011 or 00111 ?  what all the operations to do?

Thank!

clive

XOR is performed bitwise. = 10100
It could be a random act of randomness. Those happen a lot as well.

elettronico_79

what does "bitwise" mean? i haven't found that word in my translation vocabulary!

is the two complement's system another way to rappresent the binary numbers? so for example the classical-binary number "1101" isn't the same in the 2 complement's but i should change the bit and add one "0011", right?


thank!

FORTRANS

Quote from: elettronico_79 on January 20, 2011, 08:17:03 PM
what does "bitwise" mean? i haven't found that word in my translation vocabulary!
Hi,

   For an operation like XOR "bitwise" means the the exclusive
or is performed on each bit in the destination.  In a byte the
low order bit of the source operand would be XORed with the
low bit of the destination operand.  And the second bit from
the source is XORed with the second bit of the destination.
And the is repeated for the remaining six bits in the byte,
"Bitwise" means perfom the action bit by bit for all bits.

Regards,

Steve

dedndave

Steve is right, and it applies to all logic operations (OR, AND, XOR, NOT)
by contrast, math operations are not bitwise (ADD, SUB, NEG)
if you have the value 1 in a register, and ADD 1 to it, a carry is generated into the next bit
the logic functions do not generate carries, and the carry flag is always cleared, thus the term "bitwise"
well - for some reason, NOT does not clear carry - i don't know why they chose to do that

elettronico_79

so, to XOR i must have at least 2 binary terms?
i can't XOR only one term like 0100, right?

thanks!

dedndave

XOR is an operation, similar to ADD or SUB
it requires 2 operands   :U

elettronico_79

ok, i think to have understood now  :8) thanks!

i've seen some assembly files that have the ".asm" extension, so what difference is there between asm and hla?
in what assembly are writed into the asm files?

if i've the microsoft visual c++ compiler to use the hla syntax should I indicate to visual c++ the hla compiler, right?


thanks  :U

Sevag.K

Quote from: elettronico_79 on January 27, 2011, 10:27:40 PM
ok, i think to have understood now  :8) thanks!

i've seen some assembly files that have the ".asm" extension, so what difference is there between asm and hla?
in what assembly are writed into the asm files?

syntax.  hla represents a specific assembly syntax while asm represents any assembly syntax.

Quote
if i've the microsoft visual c++ compiler to use the hla syntax should I indicate to visual c++ the hla compiler, right?


thanks  :U

don't know enough about vc++ to comment on this.



TmX

Quote from: elettronico_79 on January 27, 2011, 10:27:40 PM
ok, i think to have understood now  :8) thanks!

i've seen some assembly files that have the ".asm" extension, so what difference is there between asm and hla?
in what assembly are writed into the asm files?

try hla -masm myprog.hla to generate the MASM code, or hla -fasm myprog.hla for the FASM code, for example