linux assembly language programming PHẦN 6

Netw_short giá trị sẽ nhận được giá trị thích hợp từ việc chuyển đổi thứ tự mạng. Để chuyển đổi một giá trị từ mạng để trở lại đi vào trật tự chủ là bằng nhau đơn giản:Mẹo h trong tên chức năng đề cập đến "chủ nhà", trong khi n đề cập đến "mạng". Tương tự như vậy, s là "ngắn" và l đề cập đến "dài." | Although the ESP is called a general register because it is accessible to the programmer like the registers EAX EBX etc. writes to ESP should be done only with great care. Suppose that ESP contained the address 19H as in Figure 7-1. Then storing the byte 76H on the stack would fill the location 18H and the stack pointer would be changed as shown in Figure 7-2. This kind of operation is called zpush. The one-byte push shown here is essentially the same as the following two operations Figure 7-1. Before Push Figure 7-2. After Push Stack Pointer ESP 18H Stack Ibp DEC ESP Move the pointer to the first vacancy MOV ESP 76H store 76H at the address in ESP. In fact the x86 does not allow one-byte pushes. All pushes must be either two-byte or four-byte pushes. The number ofbytes pushed is determined by the size of the operand on the PUSH instruction. The PUSH Command The most common form of the PUSH instruction is PUSH reg Allowable registers include the 16- and 32-bit general registers but not the eight-bit registers. Memory and immediate operands can also be used with PUSH but the register operand form is the most useful. Figure 7-3 and Figure 7-4 show the effect ofa PUSH EAX instruction. Figure 7-3. Before PUSH EAX Figure 7-4. After PUSH EAX is very similar to SUB ESP 4 MOV ESP EAX Because the stack pointer points to the last occupied location rather than the first unoccupied location of the stack a PUSH must be carried out by subtracting from the stack pointer first and then transferring the bytes to the stack rather than the other way around. Having the stack pointer point to the first available location would be a reasonable policy if all pushes and pops were the same size. But since pushes and pops may be either two or four bytes this is not a tenable policy. The POP Command The opposite operation is called . Like the PUSH instruction POP takes register and memory operands which may be either two or four bytes. Unlike PUSH it does not take immediate

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
237    89    3    26-06-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.