MAC/65 Assembler Editor and Atari 8-bit Machine Language Programming - Part 10

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 ก.ย. 2024
  • The 13th in a series of videos in programming in Assembly Language for the Atari 8-bit computers using the MAC/65 Assembler Editor cartridge.
    This video covers:
    Two more ways to deal with MAC/65 co-resident in memory overwriting your code, including how to use .INCLUDE files. More available zero page locations! A new general purpose subroutine to move/copy any size memory from one place to another in memory. Works on any 6502 machine. How to use DDT not just as a debugging tool, but also as a testing tool. Finally, what good a good test plan should be, a discussion of code coverage.
    Code for my videos are at my GitHub at GitHub.com/Davi.... Expect a couple days lag for each videos code to be uploaded since they will be more heavily commented.
    Atari Books referenced in this video and where you can download them:
    MAC/65 and DDT Manual:
    www.atarimania...
    Mapping the Atari by Ian Chadwick:
    www.atarimania...
    Compute's Machine Language for Beginners by Richard Mansfield:
    www.atarimania...
    Compute's Second Book of Machine Language by Richard Mansfield:
    www.atarimania...
    Atari Roots by Mark Andrews:
    www.atarimania...
    SAMS Programmer's Reference Guide for the Atari 400/800 Computers:
    www.atarimania...
    Your Atari Computer by Poole, McNiff, and Cook:
    www.atarimania...
    Tom Hudson's Machine Language Boot Camp Series Analog Magazine (starting in Issue 13):
    archive.org/de...

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

  • @davidarlington1206
    @davidarlington1206  6 วันที่ผ่านมา +4

    Just some minor notes this time:
    1) I broke one of my own rules at 38:30, should have kept that label to 6 chars like MOVMEM :)
    2) At 47:00 or thereabouts, I'm not sure that LDY #$00 at line 430 is really necessary (since it should still be 0 from rolling over) but it doesn't hurt anything there.
    Overall, this may be the video I'm most happy with how it came out as far as content is concerned.

  • @KaltOhm
    @KaltOhm 6 วันที่ผ่านมา +3

    This series is so fascinating! I really appreciate your efforts and the incredible value of preserving this knowledge about the early times of personal computing. Thanks and please keep this great work coming!

    • @davidarlington1206
      @davidarlington1206  6 วันที่ผ่านมา +1

      Thanks for the kind words. I've been having fun rediscovering the things that got me started as a developer in the first place, long ago!

    • @STN-t5k
      @STN-t5k 6 วันที่ผ่านมา +1

      @@davidarlington1206 Yeah, this series is great. I love how you take the time to go into the subject in detail, 80 minutes seems about the right length for it.

    • @davidarlington1206
      @davidarlington1206  5 วันที่ผ่านมา +1

      @@STN-t5k I can't seem to get away from that 80 minutes length despite my best plans LoL

  • @user-nd8zh3ir7v
    @user-nd8zh3ir7v 4 วันที่ผ่านมา +2

    I really enjoy this content, keep up the good work! thx

  • @nickfolino8228
    @nickfolino8228 5 วันที่ผ่านมา

    Interesting way of doing it. I've never copied single bytes in these routines. It's usually a page or 1k blocks at a time.
    Instead of reserving space in zero page, then setting variables, then writing code to put those variables into the reserved locations, it would be much easier to just store your data when you reserve the space.
    130 SRCADR .WORD $E200
    140 DESTADR .WORD $5000
    Then you can eliminate lines 180, 190 and 210-300
    It's much more easier to read too.
    Also the MVRMDR can be sped up using a decrement. If you load size into the x or y register you can just decrement that, no need to use another register to count up and compare it to SIZE Just count down and you only need the BEQ. I provided sample code in an earlier video.
    Great series! I like watching you do this live. Don't worry. We all make the same typing mistakes! Some of us more than you 🙂

    • @davidarlington1206
      @davidarlington1206  5 วันที่ผ่านมา

      1) What native 6502 instruction lets you copy a whole page at a time?
      2) For the purposes of the demo, I could have put the source and destination values directly into zero page, but then it's a zero page constant not a variable and I was thinking ahead to the next video when SRCADR and DSTADR are going to be used several times with different values.
      2a) In a side note, I DID try to set SIZE as a constant in zero page, but MAC/65 did not like that for some reason and overwrote my constant even though the compiler said it compiled OK. I'm going to investigate that later. As mentioned in the video, the MAC/65 manual is unclear about its own usage of the top half of zero page locations.
      3) My first version of this DID use a decrement method for MVRMDR, but I wasn't happy with my explanations being as clear as they were for the way I ended up doing it. As mentioned in reply to some other comments, I'm not always looking for the fastest or most efficient way to do something, but rather something I can clearly explain the concepts and reasoning and then hopefully inspire people to try their own ways. It was also easier to explain the DDT testing part doing it that way and giving examples of testing was another goal here.
      I did try to make a point that there are plenty of examples of this code you can find a lot of places (especially since this logic is not Atari-specific) of how to code this subroutine and that I was sure someone could find a better way out there with just a little effort. A goal of the series though is not to tell people how to write code by telling them a certain way, but how to explain things so they can write their own code. Someone commented with a working example of the decrement way for MVRMDR and that made me feel great because that's what I'm hoping for in the end. I get you started, you think up better ways or your own ways on your own!

  • @AlexEvans1
    @AlexEvans1 6 วันที่ผ่านมา +1

    How about:
    420 bne mvpage
    430 ;
    440 ;

    • @davidarlington1206
      @davidarlington1206  6 วันที่ผ่านมา

      Yeah, watching it back I realized I didn't really need 430 and if I don't need that then your suggestion is the best way. Those are the things you clean up AFTER you make sure it's working and you have a bunch of tests to test it. Or when you're watching it back LOL

    • @STN-t5k
      @STN-t5k 6 วันที่ผ่านมา +1

      @@davidarlington1206 On a similar note, the loop for the reminder could be:
      iny
      cpy size
      bne move

    • @STN-t5k
      @STN-t5k 5 วันที่ผ่านมา +1

      The loop for the reminder would also be shorter and faster if the X register was used to count how many elements are left to copy, instead of using the Y register to compare if it’s equal to the contents of the size variable. Maybe something like this?
      ldx size
      beq mvdone
      ldy #0
      move:
      lda (srcadr),y
      sta (dstadr),y
      iny
      dex
      bne move

    • @AlexEvans1
      @AlexEvans1 5 วันที่ผ่านมา +2

      @@STN-t5k going that route you can reverse the copying order for the sub page portion. However, I think it was thought to be a smidge less clear.

    • @davidarlington1206
      @davidarlington1206  5 วันที่ผ่านมา +1

      @@STN-t5k I toyed around with using a DEX method but as Alex suggests and I've mentioned in the past, sometimes the decisions on a particular way to do something is more tied to make the code clear and understandable rather than teaching efficiency. That's also why I made a point to say in the video that I hope people are taking my explanations about what the code is doing and why as inspiration to write and find their own ways to do things. (Which you did which is exactly what I'm hoping for with these videos!) I want to show a way I think I can make clear to all levels and then let folks take the car out for a spin on their own.
      Alex's suggestion was more efficient than what I had but it doesn't lose any clarity either.