Use x86 CPU assembly language to design a program that implements the following C statement function

Updated on technology 2024-05-04
18 answers
  1. Anonymous users2024-02-09

    data segment ;Defining a data segment, you say floating-point number type, and you don't talk about double or single precision. I'm using the word type here.

    x dw 1000 dup(?)

    s dw ?

    data ends

    code segment;Define the paragraph.

    assume cs:code,ds:datastart:

    mov ax,data

    mov ds,ax

    mov cx,1000 ;Set the number of cycles.

    lea bx,x ;Mount the first address of the array.

    mov ax,s

    l1: add [bx],ax ;Additive operations.

    add bx,2 ;The pointer moves back to point to the next array element. Because it's a word type, it's moved back by two bytes.

    loop l1

    mov ax,4c00h

    int 21h

    code ends

    end start

    This paragraph is super simple. I've run it natively. But you just run it like that, and the result is zero.

    Because you didn't give me the initial value of the array. But this paragraph does exactly what you want. If you don't understand, I can't help it.

    When you use it, just assign the initial value, and there is a ? I understand the data.

  2. Anonymous users2024-02-08

    Child, it's only called tomorrow, you're hairy today. o(∩_o~

    It's hard for others to know your name.

  3. Anonymous users2024-02-07

    Crystal oscillator, the cycle per second is 1ms=1000th of a second, let the crystal oscillator ** times 1000ths of a second, you can get a delay of 1ms. Please note! Each instruction of different CPUs may not be completed by a crystal oscillator cycle, first look at the machine cycle of a CPU, and you can calculate the accurate delay of 1ms.

  4. Anonymous users2024-02-06

    I don't understand, please describe it accurately.

  5. Anonymous users2024-02-05

    That is, before executing int 21h.

    After performing MOV AX, 4C00H.

  6. Anonymous users2024-02-04

    It's been a long time, but I hope to help friends who check this answer.

    Start by extracting keywords"The program returns"。So what is program return? That is, after a program is over, the control of the CPU is returned to the program that enables it to run, and we call this process:

    The program returnsAmount. It's abstract, right?

    It's okay if you don't understand, I'm just telling you that there is this concept. Wang Shuang and his old man have already made it very clear, so I won't talk about it here. (See Wang Shuang's compilation, third edition, p81).

    And MOV AX, 4C00H

    int 21h

    The function of these two directives is:"The program returns"。Obviously, before the program returns, it is before the above two instructions are executed.

  7. Anonymous users2024-02-03

    It can be understood that the so-called high-level language is to use language rules such as grammar that people can easily and memorize and recognize, and complete the programming of the program, and it must be compiled before the program is executed! Once compiled into machine language, it can be executed! All programs must be compiled into machine language before they can be executed!

    The compilation process is indispensable!

  8. Anonymous users2024-02-02

    Yes, programs written in high-level languages are called high-level language source programs, and must be translated into machine language target programs before they can be executed by computers.

  9. Anonymous users2024-02-01

    Type 8? Or is it (80 89) that is output if you input b?

  10. Anonymous users2024-01-31

    No, in addition to the application running, there are also system programs running, and so many process services in the system have to rotate the CPU time slice.

  11. Anonymous users2024-01-30

    Of course it's not right.,Exclusive CPU is not correct here.,Don't say anything else.,The system is a program.,And the CPU time slice upstairs should be used as a "thread".,It's better to understand :).

  12. Anonymous users2024-01-29

    Internal memory: It is a storage device that is directly linked to the CPU, including read-only memory (ROM), random memory (RAM), and cache. In a nutshell:

    The CMOS chip on the motherboard of a computer (the ROM that stores the BIOS), the memory, the L1 cache in the CPU, and the L2 cache in the CPU are all internal memory.

    The hard disk is external memory, and the CPU is the combinator and controller.

    So the answer is: 1. Internal memory is not a different hardware from memory and hard disk, and there is no one including whom.

  13. Anonymous users2024-01-28

    Wrong, CPU refers to **processor.

    Internal memory refers to memory modules.

    The CPU does not include any memory and hard disk, they are all separated.

  14. Anonymous users2024-01-27

    Internal memory is memory and hard disk, and CPU is the processor. A CPU is a computer microelectronic transistor processor that processes data and information from hard disks and memory.

  15. Anonymous users2024-01-26

    Wrong. The CPU is a processor.

    The CPU has nothing to do with memory and hard disk.

  16. Anonymous users2024-01-25

    Internal memory is memory.

    CPU processor.

    The CPU can directly access things in memory, but not directly in memory, and things on external memory, such as optical discs, must be read into memory before the CPU can access them.

  17. Anonymous users2024-01-24

    Computers are divided into five parts: computing, control, memory, input and output devices.

    The "operation and control" are collectively referred to as the "processing unit", that is, the CPU.

    Memory, there is only one kind. Hard drives, on the other hand, should not be called "external memory".

    In fact, printers, keyboards, disk drives, and so on, are all independent computers.

    Inside them, there are also CPUs, storage...

    Electric motors, laser heads. is the output device. Buttons, switches, various sensors. is the input device.

  18. Anonymous users2024-01-23

    CPU: including combinator and controller;

    The CPU and the memory (the memory that the CPU can directly access is the internal memory) together is the host;

    Memory: including cache, main memory (without cache, memory is main memory);

    Hard disks and USB flash drives are external storage;

    Mouse and keyboard are input devices;

    Monitors and printers are output devices.

Related questions
22 answers2024-05-04

There won't be much gap.,Photoshop is not so demanding on the CPU.,If you're short of money, it's good to use P4 531 or A64 3000+.。

10 answers2024-05-04

The normal temperature of the CPU is guaranteed to be stable within the range of 30 degrees Celsius. In other words, the CPU can withstand a temperature of 65 degrees, and the maximum temperature of the CPU is 30 degrees Celsius based on the maximum temperature of 35 degrees in summer. And so on, if your ambient temperature is 20 degrees now, it's best not to exceed 50 degrees on the CPU. >>>More

15 answers2024-05-04

Add the memory to at least 2G, and change the graphics card to a graphics card with high video memory.

8 answers2024-05-04

ARM and X86 are two CPU architectures, X86 is the CPU architecture dominated by Intel, mainly the CPUs produced by Intel and AMD. >>>More

31 answers2024-05-04

If it's a young man ... ck be" is good, this is a unisex perfume, that is to say, it is suitable for both men and women, the smell is lavender, and it is relatively plain, not as sweet as a girl's perfume. Linger for half a day to 1 day. >>>More