Pytanie: Any assembly Programmer here?? i need your help please :(?
( Wstecz )
Answer #1:
The (general-purpose) registers are not "extra", they exist for the express purpose of being used by programs. In fact, Intel architecture is notoriously stringent when it comes to the number of registers available for programs.For each instruction in Intel instruction set manual ( Click Here ) there is a list of flag effects. Learn them as you learn each instruction. Typical commands that set ZF=1 are arithmetics that result in a zero, such as sub ax, ax (subtract ax from ax and store result in ax) or test ax, ax (subtract ax from ax and discard result).
"bitness" of a processor is not a well-defined concept. it can refer to the size of the general-purpose register (16 bit for ax,bx,cx,dx on 8088/8086), to the size of the memory address (20 bits on 8088/8086, with a 16-bit linear "offset"), width of the data bus (8 bit on 8088, 16 bit on 8086), etc. I don't know what you mean by "tray".
Answer #2:
Think of registers as a placeholder for data that is accessed by a chip and the programmer. Registers are used in other complex digital chips, not just CPUs. For example, a chip that is designed for computer audio will have registers. In order to access the chip and tell the chip to do something, the programmer writes data (byte, word, dword, whatever) to a chip's register. Then the chip can read the register and process it. Some chips may incorporate 1 or more 'read only' registers that are used for just providing status information that a programmer can access. Yet other chips may have 1 or more 'write only' registers where the programmer can only write data to the chip, but cannot directly read the data back from the register.On a CPU, a programmer accesses it's registers in order to give or recieve instructions or data. CPU registers have specific uses. For example, the Instruction Pointer register contains the memory address of the CPU instruction that the CPU is processing.
CPUs contain a flag register that has various purposes. Each bit in the register provides specific status information. Some CPU instructions modify the flags and the programmer can also directly modify the flags in the flags register.
For example:
mov al,10 ;mov 10 into AL register
add al,255 ;add AL + 255 and store result in AL
The result is that AL now equals 9. The result 'rolled over' to 9 because AL is a byte register that can only hold a maximum value of 255. Since the AL register 'rolled-over' past 0, the CPU set the 'carry' flag to 1 in the flag register.
In this example:
mov al,5
sub al,5 ;subtract 5 from AL and put the result in AL
The value in AL is zero and since the result is zero, the CPU sets the 'zero' flag to 1 in the flags register.
Any type of arithmetic operation that results in zero will set the 'zero' flag.
A CPU instruction reference guide will list explain all the CPU instructions. You will be able to see which CPU instructions modifies the flags in the flags register. Usually, any CPU intruction that does some sort of arithmetic will modify the overflow, sign, carry, and zero flags, depending on the outcome of the instruction.
One word = 16 bits = 2 bytes.
Okay, now I REALLY suggest that you buy 1 or more books on learning assembly language. A well written book will start off by teaching you about binary and hexadecimal numbers. You MUST know this in assembly language programming. A book will also explain about the flags register.
You are asking way too much from people if you refuse to buy books and then you ask questions that can be easily found in a book. It will also take you much longer to learn assembly language without books.
Don't waste your time on on-line tutorials either because they all suck.
You also need a CPU instruction reference which explains all the CPU instructions available to you.
Click Here
** Powered by Yahoo Answers