Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

🧵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 görüntüleme • 1 yıl önce •via X (Twitter)

5 Yorum

tetsuo.ai profil fotoğrafı
tetsuo.ai1 yıl önce

🧵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:

Zeb profil fotoğrafı
Zeb1 yıl önce

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

Rishi profil fotoğrafı
Rishi1 yıl önce

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

Hovercar Mechanic profil fotoğrafı
Hovercar Mechanic1 yıl önce

This is so outdated

Siraj Florida profil fotoğrafı
Siraj Florida1 yıl önce

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.

Benzer Videolar

** Sega Genesis 3D Engine Day 3 ** Blast Processing kicks In !! Converted the Line Drawing and Triangle drawing to 68k Assembly and gained 25% in the line drawing and 33% speedups in the triangle drawing vs C ( so far ) . The scheduler calculating the vertexs is still in C , just the drawing routines are now are in assembly . Possibly 5-10 % gains will come from the scheduler being in ASM also. The Line and Triangle drawing C code took some beating , it was surprising - particularly the line drawing to get a speed up over the C code in ASM. I guess its not too surprising as the C code was basically handling pointers and integers so I had to get exotic to find the speedups. Initially my ASM Line draw was 100% slower than the C code - the first pass conversion from C to ASM is always rough as its more about getting it working then refine later , but yeah 100% slower on first pass was brutal, after 4 hrs tweaking it was 25% faster than the C code so thats a good start - might get more yet. So added more squares and more triangles for load testing at the same frame rate. Its still not anything cohesive but right now focussing on performance in rendering to see how much can be pushed. As rendering will be the biggest cpu soak the faster that goes the better. The smaller triangles take about 1/3 the CPU time of the larger triangles at present so theres definately a fill rate limit vs the setup time to consider. The same would go for the squares been line framed - smaller ones would allow al lot more . #SGDK #SegaGenesis #SegaMegadrive

Shannon Birt

21,104 görüntüleme • 3 ay önce

AI is changing the software engineering craft. Anders Hejlsberg (Anders Hejlsberg) - creator of C#, TypeScript and industry legend - on why code review needs to get more enjoyable in response: #1 - AI is shifting the craft from writing code, to reviewing code: "In a sense, we're all turning into project managers. We can have an army of junior programmers, called agents, that will just spit out reams of code but someone's got to have the big picture and review all of that. And so, increasingly, our craft is going from one of writing the code, to one of reviewing the code and building the architecture of the code and overseeing the work. It's a different kind of craft. It's a different kind of enjoyment. I've always liked writing the code. To me that was the fulfilling part, seeing it work. In a way, AI robs a little bit of that, because I am less interested in reviewing code." #2 - The code review experience should be improved: "I think we could also make the process of reviewing code much more interesting than it is today. I mean, today, you see a list of diffs in alphabetical order and now it's up to you to make heads or tails of it. There are more pedagogical ways of presenting that. And you could have commentary generated by the AI that tells you what the changes are and whatever, and then tries to guide you along. So that symbiotic relationship, I think we need to work on that more and to keep the enjoyment in there."

The Pragmatic Engineer

39,011 görüntüleme • 2 ay önce