Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

🧵1/2 MIT's Charles Leiserson lectures on how C code is compiled into assembly and machine code, leading to hardware-level execution. 👇 Full MIT Performance Engineering of Software Systems Course in C and Assembly👇

56,241 Aufrufe • vor 1 Jahr •via X (Twitter)

5 Kommentare

Profilbild von tetsuo.ai
tetsuo.aivor 1 Jahr

🧵2/2 Full yt video playlist: Performance Engineering of Software Systems is an 18-unit class where everything is done in the C programming language, and it also covers assembly:

Profilbild von Zeb
Zebvor 1 Jahr

This course is one of the best resource if someone wants to learn how to write high performance software.... thumbs up 👍

Profilbild von Rishi
Rishivor 1 Jahr

what is "just enough assembly" you need to know to watch these videos

Profilbild von Hovercar Mechanic
Hovercar Mechanicvor 1 Jahr

This is so outdated

Profilbild von Siraj Florida
Siraj Floridavor 1 Jahr

The AF (Adjust Flag) in the RFLAGS (or EFLAGS in 32-bit mode, FLAGS in 16-bit mode) register is a bit that indicates whether an arithmetic operation (typically addition or subtraction) has resulted in a carry or borrow between the lower four bits (nibble) of the result. Function of the Adjust Flag: Carry/borrow between bits 3 and 4: The AF is set (AF = 1) if there is a carry out of or a borrow into bit 3 (the low nibble) during an arithmetic operation, such as addition or subtraction. If no carry or borrow occurs, AF is cleared (AF = 0). Usage of the Adjust Flag: Binary Coded Decimal (BCD) operations: The Adjust Flag is primarily used in Binary-Coded Decimal (BCD) arithmetic, where each nibble represents a decimal digit. This type of arithmetic was more common in earlier computing systems, but it still exists for compatibility and specific use cases. The AF helps manage carry/borrow between digits in BCD operations, ensuring correct decimal results.For example:If you're adding two 4-bit numbers (nibbles) and the sum exceeds 9 (as the result would no longer be valid as a BCD digit), the AF will be set. This helps signal that an adjustment is needed to correct the result to stay within the bounds of valid BCD values (0–9). Example of AF behavior in binary addition: Suppose we are adding two 8-bit values: 0x19 + binary: 00011001 + 00001001 = 00100010 Here, there is no carry from the 4th bit (bit 3) to the 5th bit (bit 4), so AF = 0. Now suppose we add 0x19 + binary: 00011001 + 00001000 = 00010001 (carry occurs from the lower nibble) In this case, a carry occurs between the 4th bit (bit 3) and the 5th bit (bit 4), so AF = 1. Key Points: AF is used internally in the CPU for specialized cases like BCD correction but is not as commonly encountered in modern programming as other flags like CF (Carry Flag) or ZF (Zero Flag). The AF is checked after certain instructions that modify the flags, such as the ADD, SUB, and ADC (add with carry) instructions.

Ähnliche Videos