Let's Code MS DOS 0x2B: Memory and Pointers

แชร์
ฝัง

ความคิดเห็น •

  • @youtubedude09
    @youtubedude09 3 หลายเดือนก่อน

    Thank you for still doing this series this is basically the only tutorial about ms-dos besides the 8086 tutorials and those aren't about the operating system

  • @wesbat9012
    @wesbat9012 4 หลายเดือนก่อน

    Thanks, this is a great intro to pointers! It might be good to touch on pointer arithmetic in a future video, a concept that drives home the flexibility of this misunderstood data type.

    • @root42
      @root42  4 หลายเดือนก่อน

      Yes good idea.

  • @mattj65816
    @mattj65816 4 หลายเดือนก่อน +1

    It's surprising how far you can get into programming without really understanding pointers. I started programming when I was ten years old, worked my way up through Pascal and started with C, without ever really understanding pointers. I didn't learn how they really worked until college. Prior to that I just sort of knew that I needed "@" and "^" in certain places (at least I think it was "@" and "^" to reference and dereference pointers in Pascal--I don't remember for sure.)

    • @redstone0234
      @redstone0234 4 หลายเดือนก่อน +1

      Especially nowdays with high-level languages like C#, Java or Javascript (but in C# you can chosse between byRef and byVal)

    • @root42
      @root42  4 หลายเดือนก่อน

      But even then there might be the requirement to interface with native libraries. And oftentimes that's when you can get in touch with pointers.

  • @IExSet
    @IExSet 4 หลายเดือนก่อน

    Thank you !

  • @Humble_Electronic_Musician
    @Humble_Electronic_Musician 4 หลายเดือนก่อน

    Cool !
    Thank you for sharing your knowledge!

  • @sLiv256
    @sLiv256 4 หลายเดือนก่อน

    Really nice content, thx.

  • @worroSfOretsevraH
    @worroSfOretsevraH 4 หลายเดือนก่อน

    Thank you.

  • @staticage6
    @staticage6 4 หลายเดือนก่อน +1

    Nice demonstration of how pointers work!
    Side note: you made a mistake declaring 'struct player'. struct's name must follow immediately after the 'struct' keyword. In this case you would get a compiler error at the line with:
    'void draw ( struct player *p );'
    because there is no 'struct player'. You just have a variable 'player' allocated as said unnamed struct with it's attributes.

    • @root42
      @root42  4 หลายเดือนก่อน

      Yes, it was just a quick example I came up on the spot. I used to do something like this back in the day, to get rid of the need to write "struct foo" all the time:
      typedef struct _foo { ... } foo;
      This way you could use foo as the type instead of "struct _foo". That's why I made the mistake...

  • @FrancoBugnano
    @FrancoBugnano 3 หลายเดือนก่อน

    Nice video, very well explained😁 The only thing that I'm not sure is that you use the FP_SEG and FP_OFF on near pointers, and those macros might not give the result you want, given that the FP_ prefix of those macros stands for far pointer. Besides, you have shown that a near pointer has a size of 2 and contains only the offset, so where would FP_SEG get the segment information from?

    • @root42
      @root42  3 หลายเดือนก่อน +2

      Probably the contents of DS/current data segment.

    • @FrancoBugnano
      @FrancoBugnano 3 หลายเดือนก่อน +1

      @@root42 makes sense, thank you😁

  • @tamsinlm
    @tamsinlm 4 หลายเดือนก่อน

    I have to ask, does this version of Turbo C not support typedefs or was that an intentional avoidance so as not to muddy the waters for this discussion?

    • @root42
      @root42  4 หลายเดือนก่อน +1

      Of course it supports typedefs. And yes, I avoided it as not to introduce another concept. I also could have talked about output parameters and how they could be implemented using pointers… and so on…

    • @tamsinlm
      @tamsinlm 4 หลายเดือนก่อน

      @@root42 *nods* I couldn't remember how old typedefs were. I keep running into the issue of still thinking of C/C++ in terms of the '99 versions of the spec since that's when I was taught them formally, and it got me thinking about when the concepts I'm accustomed to just assuming are supported actually saw widespread acceptance.

    • @root42
      @root42  4 หลายเดือนก่อน +1

      Turbo C 2.0 is mostly ANSI C compatible. That changed very little until C99. The latter got a lot of the quality of life changes from C++98. Like mixed declarations and code and C++ style comments. Basically C++ without the OOP cruft. ;)