Jump to content
Sign in to follow this  
Max_Chatsworth

Beginning ASM programming

Recommended Posts

I am set up with WUDSN and I have compiled /run a few sample programs with WUDSN configured for the MADS compiler.  The difficulty I am having is that a lot of examples I find don't compile on MADS and I don't know enough yet, since I am just starting out learning ASM(reading "assembly_language_programming_for_the_atari_computers" PDF from learning links)  and I don't know what is MADS specific or any other compiler specific or how to make sense of the best approach for learning it.   

Share this post


Link to post
Share on other sites
Posted (edited)

A very good start are the tutorials by @JAC!. All of them are for WUDSN and MADS and you learn how to code ATARI specific code on the fly.

There are not just the code examples by him, but many video tutorials, too.

Edited by pps
  • Like 1

Share this post


Link to post
Share on other sites

MADS is slightly different to other compilers (ATASM, XASM etc.), but mostly downwards compatible. If you have an "old" listing where you get errors, check, what the errors are saying and look up the specific MADS commands, that are different.

One thing is, that in ATARI Assembler you set the memory with > *= $2000", while in MADS you have to use "ORG $2000". Comments in ATMAS start with > * <, while in MADS you use > ; <

 

Before using MADS, check the manual: http://mads.atari8.info/mads_eng.html

There you find the most important differences at the top:

  • Like 1

Share this post


Link to post
Share on other sites
On 5/5/2021 at 11:51 AM, pps said:

A very good start are the tutorials by @JAC!. All of them are for WUDSN and MADS and you learn how to code ATARI specific code on the fly.

There are not just the code examples by him, but many video tutorials, too.

Thanks! I have been watching those and that got me up and running, but I look at lots of source code to other programs/other books and I'm really struggling to figure out what is MADS vs another compiler vs generic ASM, if such a thing exists. 

Share this post


Link to post
Share on other sites

Sounds like you're over thinking it and need to just dive in and code, when you're stuck then let the forum know and you'll get guidance.

  • Like 1

Share this post


Link to post
Share on other sites
5 hours ago, Max_Chatsworth said:

Thanks! I have been watching those and that got me up and running, but I look at lots of source code to other programs/other books and I'm really struggling to figure out what is MADS vs another compiler vs generic ASM, if such a thing exists. 

Haha one of the things you might want to change paradigm for is that you are now doing assembly language, and so you should not be referring to the actions as compiling things, or the tools as compilers 😉

Share this post


Link to post
Share on other sites

Maybe trying to learn assembly language with a complex assembler like MADS isn’t a great idea. Maybe try starting out simpler with Asm/Ed or MAC/65 and once you know the language you can always go back to MADS.

Share this post


Link to post
Share on other sites
10 hours ago, Alfred said:

Maybe trying to learn assembly language with a complex assembler like MADS isn’t a great idea. Maybe try starting out simpler with Asm/Ed or MAC/65 and once you know the language you can always go back to MADS.

I was thinking about doing that very thing.  It's hard sometimes when learning something new like this and I often wonder "is this the language or the tool?" .  I have the feeling from my research that the plain old vanilla assembler for Atari back in the day was MAC/65. Does that exist as an assembler I can hook into WUDSN? I'm not gonna lie, being able to code on windows and immediately debug with Altirra is pretty sweet. 

 

 

Share this post


Link to post
Share on other sites

Disagree, MADS can act simple or be complex if you want it to be.

 

What I haven't heard yet is what you are trying or have tried so far, what about that is not working against your expectation. Only then we can steer you in the right direction.

  • Like 1

Share this post


Link to post
Share on other sites

I am no expert on assembler, as I only started looking at it myself recently. However, @Max_Chatsworth I found the interactive 6502 assembler tutorial below quite nice. It is platform neutral but helps to get started in the world of 6502.

 

Easy 6502 by skilldrick

 

 

Share this post


Link to post
Share on other sites
On 5/9/2021 at 3:11 AM, atarilux said:

I am no expert on assembler, as I only started looking at it myself recently. However, @Max_Chatsworth I found the interactive 6502 assembler tutorial below quite nice. It is platform neutral but helps to get started in the world of 6502.

 

Easy 6502 by skilldrick

 

 

Thanks!

Share this post


Link to post
Share on other sites
Posted (edited)
On 5/8/2021 at 9:58 AM, Wrathchild said:

Disagree, MADS can act simple or be complex if you want it to be.

 

What I haven't heard yet is what you are trying or have tried so far, what about that is not working against your expectation. Only then we can steer you in the right direction.

@Wrathchild Sorry I can't give specifics.  I guess in general I've tried to load a few existing examples and get all sorts of assembler errors as many of the sources I find are for another assembler, but I don't know enough to know what *might* need to be modifed. 

Edited by Max_Chatsworth

Share this post


Link to post
Share on other sites

Personally I would advise using MAC/65 to get started, it's pure 6502 without any of the more

modern systems quirks, there are literally thousands of examples, loads of books, you can start

with the easy stuff to get you going and move into the more intricate things later.

 

When comfortable with that, then maybe you could move to the environment you want

Share this post


Link to post
Share on other sites
On 5/10/2021 at 5:33 AM, TGB1718 said:

Personally I would advise using MAC/65 to get started, it's pure 6502 without any of the more

modern systems quirks, there are literally thousands of examples, loads of books, you can start

with the easy stuff to get you going and move into the more intricate things later.

 

When comfortable with that, then maybe you could move to the environment you want

is MAC/65 and assembler or an editor as well?

Share this post


Link to post
Share on other sites
3 minutes ago, Max_Chatsworth said:

is MAC/65 and assembler or an editor as well?

Yes, it is both

  • Thanks 1

Share this post


Link to post
Share on other sites

 

Editor

 

image.thumb.png.b4194e814416762648dd351fd48bd0cb.png

 

 

Just type ASM

 

image.thumb.png.18f170934019b75bbeebabe94a6e6be2.png

 

ASM on it's own will just assemble but not produce any code, if you want code, you would 

add a line 

1  .OPT OBJ and it will assemble to memory 

 

to assemble to disk type ASM,,#D:<filename>.<ext>

or Cassette ASM,,#C:

 

if you want a listing, ASM,#P:

 

There are loads of directive, those are just a few options, MAC/65 is also very good with macro's

 

 

e.g. example MACRO

 

0100     .OPT NO MLIST
0110     .MACRO PDL 
0120     LDX %1
0130     INC %1
0140     LDA %2,X
0150     STA WSYNC
0160     STA %3
0170     LDA %4,X
0180     STA %5
0190     LDA #%7
0200     STA %6
0210     PLA 
0220     TAX 
0230     PLA 
0240     RTI 
0250     .ENDM 

 

used like this:-

1230 P1  CMP #2
1240     BEQ P2
1250      PDL  DLIINDEX+1,HP01,HPOSP1,PLAYCOLOR1,COLPM1,WHICHDL,$02
1260 P2   PDL  DLIINDEX+2,HP02,HPOSP2,PLAYCOLOR2,COLPM2,WHICHDL,$FF
1

 

Share this post


Link to post
Share on other sites
On 5/8/2021 at 10:58 AM, Wrathchild said:

Disagree, MADS can act simple or be complex if you want it to be.

 

What I haven't heard yet is what you are trying or have tried so far, what about that is not working against your expectation. Only then we can steer you in the right direction.

MADS has a much steeper learning curve than say MAC/65. Instead of spending time learning all the MADS features, and trying to learn the ones you actually need, it's simpler to use something like MAC/65 which is much easier to use, so the focus can be on learning assembly language and not on how to use MADS. DDT is also useful because you can immediately pop into memory and see your code in action.

Share this post


Link to post
Share on other sites

The OP is using a PC based dev environment, i.e. cross-dev. Encouraging Max to go down the path of cutting his teeth on native development is daft, IMO, e.g. no need for line number these days.

Altirra's debugging capabilities far surpasses that of DDT, learn those instead. 

Share this post


Link to post
Share on other sites
2 minutes ago, Wrathchild said:

Altirra's debugging capabilities far surpasses that of DDT, learn those instead. 

Altirra's help file runs what, 10-20 pages ? Sure it has far more capabilities than DDT, far beyond what this guy needs. That doesn't make it easier to learn. I'm not suggesting that he clone BobTerm in MAC/65, but hands down, using MAC/65 on Altirra on a pc is going to let him learn assembly language at a more rapid pace than using MADS. It's a very simple environment, so he can focus on the code and not trying to remember the 25 options for setting a breakpoint in Altirra. No messing around transferring binaries to Altirra, it's just there. Once he knows the language, then sure, use WUDSN and read up on MADS.

 

Sure, it's trivial for you; it's not trivial for him.

Share this post


Link to post
Share on other sites
12 minutes ago, Alfred said:

Altirra's help file runs what, 10-20 pages ?

And the Mac/65 and DDT manual is 154, obviously reading is beneficial to most learning processes.

 

13 minutes ago, Alfred said:

Sure it has far more capabilities than DDT, far beyond what this guy needs. That doesn't make it easier to learn

Why not, plenty of guidance throughout the programming forum on what the minimum you can get by with.

 

15 minutes ago, Alfred said:

and not trying to remember the 25 options for setting a breakpoint in Altirra

Why the fearmongering, naturally just employing 'set break point at address' is just fine to begin with and equates to what you'd do in DDT.

 

25 minutes ago, Alfred said:

Sure, it's trivial for you; it's not trivial for him.

Not the point, like you I'm suggesting a path based upon my historic experiences of going through the process - in my case Atari ASM/ED first, then MAC/65, then cross-dev on an ST with MadMac, eventually using PC based cross-dev tools. These days I get by fine with Notepad++ and command line to run MADS (or easier still, a batch file with the MADS command in it). With Altirra, its going to load your label file and so you can use the label name instead when setting a breakpoint.

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, Wrathchild said:

Why the fearmongering, naturally just employing 'set break point at address' is just fine to begin with and equates to what you'd do in DDT.

 

umm, no, it's not just set a breakpoint. I seem to recall there's at least three different ones with like five options each. There's what .ba and a couple others. I always have to look it up because I rarely use Altirra's debugger. The debugger in Altirra is amazingly capable; it is not very user friendly, especially if you don't use it all the time. DDT is a far easier interface to -learn-.

 

I really don't get this total hostility you cross-assembler/cross-dev guys have towards developing on the machine itself. If you can't stand using a 40 column editor or god forbid the line editor in MAC/65, then how can you stand playing games in 4 colours in 160x192 or whatever mode E is ? Compared to Eve Online, Star Raiders is pathetic. So it takes MAC/65 45 seconds to assemble your code instead of two seconds in MADS. Really, your life is so short, that 43 seconds makes a difference? Jesus, I remember when Bob and I were working on BobTerm, and with DMA off it took just over six minutes for BobTerm to assemble from hard disk. I looked at MADS a couple of times, and I didn't see that it did anything better than MAC/65 except it was faster, which is a non-issue for me. Sure MADS is a nice tool, but it has a greater learning curve than MAC/65 without a doubt. Like someone mentioned earlier, all the Atari books are written with either ASM/ED or maybe MAC/65 in mind, not MADS, so if he's trying out examples from the various books, he'll be looking at a lot more frustration and less learning trying to do that with MADS than with ASM/ED. Sure he'll get it eventually, but it'll be a lot more work.

Share this post


Link to post
Share on other sites
30 minutes ago, Alfred said:

The debugger in Altirra is amazingly capable; it is not very user friendly, especially if you don't use it all the time

using the disassembly window you can type an address/label to go to that location, right click and set a breakpoint... pretty user friendly in my eyes.

21 minutes ago, Alfred said:

I really don't get this total hostility you cross-assembler/cross-dev guys have towards developing on the machine itself.

Because it isn't there. Myself and many of the coders I know are more than happy to experiment with things in, say, Turbo Basic and then the knowledge learnt fed back into our coding. People also choose to prototype stuff in Python, C# or C++ etc.

 

  • Like 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...