Detailed Explanation of Exception Masking and Unmasking in Assembly Language

Detailed Explanation of Exception Masking and Unmasking in Assembly Language

Overview of Exception Masking In the x86 architecture, the Floating Point Unit (FPU) provides a set of exception handling mechanisms. By default, all floating-point exceptions are masked, which means that when an exception occurs, the processor provides a default result and continues execution without interrupting the program flow. FPU Control Word Structure The FPU control … Read more

Accelerated C++ Notes (1-5)

Accelerated C++ const Modifies built-in type variables, custom objects, member functions, return values, and function parameters to ensure that a certain value remains unchanged. <span>const</span> modifies a variable, acting as a constant that can be assigned to a new variable, but the constant itself cannot change. const int a=7; int b = a; // valid … Read more

Exception Handling: Ensuring Robustness of Callback Functions and Thread Functions

Exception Handling: Ensuring Robustness of Callback Functions and Thread Functions In the development of Python automation office scripts, multithreading and callback mechanisms are often used to handle concurrent tasks. However, a common misconception is that the try-except block in the main function can catch all exceptions. In reality, callback functions and thread functions run in … Read more

Deep Dive into Python: Tuples, Sets, Object-Oriented Programming, File Operations, Exception Handling, and Generators

11. Tuples and Sets In addition to lists and dictionaries, these two data structures are also very common: 1. Tuples (Immutable Sequences) Defined using <span>()</span>, once the elements are set, they cannot be modified (immutable) Suitable for storing fixed data (such as coordinates, configuration items) # Define a tuple point = (10, 20) # Coordinates … Read more

Multicore Real-Time Operating System RTEMS (14) – BSP Initialization

Technical experience sharing, welcome to follow and provide guidance. Before performing the boot_card initialization, the BSP hook is set up in advance. This article analyzes the code of bsp_start_hook_1. A. AArch64 Start Set Vector Base This writes the vector table to the exception vector table VBAR_EL1, with the variable bsp_start_vector_table_begin defined as follows: bsp_start_vector_table_begin: .balign … Read more

Overview of C++

Overview of C++

C++ (C Plus Plus) is an object-oriented high-level programming language that extends and upgrades the C language. It was developed in 1979 by Bjarne Stroustrup at AT&T Bell Labs. Initially, C++ was referred to as “C With Classes”. It is a general-purpose programming language that supports static data type checking and multiple programming paradigms, including … Read more

Detailed Explanation of the C++ Object Model References

Detailed Explanation of the C++ Object Model References

I believe the references in this book are also worth considering, so I have listed them here for everyone’s reference.1. Design and Evolution of the C++ Language https://book.douban.com/subject/35198313/2. https://stackoverflow.com/questions/4993650/what-is-sizeofsomething-0 3. https://stackoverflow.com/questions/47352663/how-can-this-structure-have-sizeof-0/47352751#473527514. https://stackoverflow.com/questions/36577094/array-of-size-0-at-the-end-of-struct5. https://stackoverflow.com/questions/4178175/what-are-aggregates-and-trivial-types-pods-and-how-why-are-they-special/7189821#71898216. https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html#Zero-Length7. https://en.cppreference.com/w/cpp/types/is_standard_layout.html8. https://en.cppreference.com/w/cpp/types/is_trivially_copyable.html9. https://learn.microsoft.com/en-us/cpp/cpp/trivial-standard-layout-and-pod-types?view=msvc-17010. In-Depth Exploration of the C++ Object Model11. https://en.cppreference.com/w/cpp/language/unqualified_lookup.html12. https://en.cppreference.com/w/cpp/language/injected-class-name.html13. https://www.justsoftwaresolutions.co.uk/cplusplus/hidden-friends.html14. https://preshing.com/20210315/how-cpp-resolves-a-function-call/15. https://gcc.gnu.org/legacy-ml/gcc-patches/2000-01/msg00574.html16. https://en.cppreference.com/w/cpp/language/copy_elision.html17. https://devblogs.microsoft.com/cppblog/guaranteed-copy-elision-does-not-elide-copies/18. https://www.artima.com/articles/pure-virtual-function-called-an-explanation19 C++ Template Guide … Read more

C++ Notes: Techniques for Locating Runtime Errors – Turning Crashes into Controlled Debugging

C++ Notes: Techniques for Locating Runtime Errors - Turning Crashes into Controlled Debugging

The program compiled successfully, but crashes at runtime? Exceptions are thrown but the source cannot be found? Learn these runtime error localization techniques to transform your C++ program from “mysterious crashes” to “precise debugging”! 📖 Introduction 🎯 Why Master Runtime Error Localization? Compiling successfully does not equal a correct program! Runtime errors are one of … Read more

Automatic Hardware Behavior Triggered by Interrupts in ARMv8-A AArch64

Automatic Hardware Behavior Triggered by Interrupts in ARMv8-A AArch64

1. Automatic Hardware Behavior Triggered by Interrupts in ARMv8-A AArch64 1. Save PSTATE to SPSR_ELx; 2. Save return address to ELR_ELx; 3. Set PSTATE.{D,A,I,F} to 14; if it is a synchronous exception or SError, update the ESR_ELx exception characteristics register; 5. Jump to the exception vector table; 6. Select the target exception level's sp_elx

C++ Exception Handling: The Art of Transitioning from Crashes to Elegant Error Management

C++ Exception Handling: The Art of Transitioning from Crashes to Elegant Error Management

In the past, when writing C code, error handling often involved a series of if-else statements that returned error codes. For more complex business logic, these error codes would be nested, making tracking them quite cumbersome. If you find returning error codes through if-else statements troublesome, you could simply trigger an assertion with assert() and … Read more