Computers store programs and data in numbered locations. The first column shows the address in memory of that instruction. They have been simplified slightly and a description added. In the Figure 2 table, you can see the instructions produced by the compiler for the statements in the loop function. This can’t understand C++ statements, so the compiler converts them into a sequence of instructions that it can understand. We might want to run this function on an ESP32 device. To see how this works, consider the following loop function.Įach time the loop function is called, it will add 1 to the value in the variable i and subtract 1 from the value in the variable j. This machine code is loaded into the target computer which runs your code. A program called a compiler converts program source code into low-level machine code which tells the hardware what to do. Some languages, including C++, are compiled. To understand how a debugger works, we can start by considering the compilation process. This allows you to stop a program, look at what it is doing, and then continue, or even step through individual program statements. However, if you are writing a program on a desktop computer today, one of the tools at your disposal will be your trusty debugger. The very first programmers had no way of fixing their bugs other than staring at their code and trying to work out what had gone wrong. Bugs can be caused by many things, including poor specification, programmer error, or plain bad luck. An early bug was an insect that got stuck in the contacts of an early computer. Whenever your program doesn’t do what you want it to, you’ve got a bug. Figure 1: An ESP32-PROG (on the right) connected to a DOIT ESP32 device using direct connection to the JTAG pins Bug origins
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |