Today, we work on the lab designed jointly by hardware and software. After the CPU is designed, we burn it into the Cyclone II chip of Altera and use the following simple C language:ProgramTest whether the CPU design is successful.
1 # Define Switch_pio (volatile char X) 0x0000800
2 # Define Led_pio (char *) 0x0000810
3
4 Void Main () {
5While(1)
6*Led_pio= *Switch_pio;
7}
8
9
Switch_pio is pointer, which records the memory address of the switch's current data.
Led_pio is also pointer, recording the memory address of the current led data.
In an infinite loop, data from the memory address in switch _ PIO is continuously sent to the memory address in led_pio. Therefore, when switch is on, the LED will be on, when switch is off, the LED will be dark.
Therefore, the C language can capture values directly from the memory address, so that hardware data can be transferred to each other, so that all other languages will be dumped to the ground.
Therefore, the C language will not really die. It's okay if you try again in 100.