Jump to content
IGNORED

Atari 8bit Assembler


Recommended Posts

Hi folks,

 

I am wanting to learn a bit of assembly, I have gotten some fantastic pointers from @flashjazzcat for resources.  I am coding in Visual Studio  Code, using mads.

What I want to learn is enough to handle some modem routines, and store data in memory for things like user information.

If anyone is familiar with Carina BBS or FoReM XEP - im wanting to rewrite what MOE and AMP did for those systems.

The rewrite is mostly because I do not have any deep insight as to exactly what these applications are really doing, and I am pretty sure that modern code practice has a lot of benefit over some of the older ronco method of set it and forget/hardcode everything.

 

If anyone can point me down the right road; I would sure appreciate it.

 

For personal learning - I did disassemble AMP, however.. as expected, it was kind of useless to someone who has no idea what they are looking at.  I was hoping it would provide some insight as to how somethings are accomplished.

Ex: How would i peek a location in basic to extract a word from assembly?

Im sure I can find examples of IO in assembly, so Im not too concerned about the modem routines.

The other thing i need to figure out is how do i write an assembly application that runs in the background - TSR type thing..

 

Thanks much!

 

Link to comment
Share on other sites

For the TSR type thing, you have to drive it off of an interrupt. VBI/VBD is always an option, you can chain yourself in there even if something else is already (provided they did it the right way). I've also driven things off of one of the pokey timers. As always, you need to attend to the stack/regs and CRITIC and so forth. Anyways, from a high level: get yourself loaded somewhere safe, steal the interrupt vector by replacing it with your routine, saving off the old one if you want to chain to it when you are done (VBI/VBD, usually pokey you wouldn't do that) and also to replace it if you quit. You finish the VBI/VBD by jumping through the old vector, if I recall, and from pokey you'd RTI. Both need attention to putting the stack and regs back together as necessary. For pokey you need to do some setup and control the rate you want.

 

There's lots of examples in docs about VBI/VBD, pokey interrupts are slightly more exotic but there's still a lot out there. If you are ok with cross compiling on a PC, you could look at MADS or CA65. I used CA65, but if you write the C correctly you can actually use CC65 to do interrupts fairly well. The whole CC65 toolchain is fairly complicated, so you might want to look at MADS for just straight assembly.

If you want to do it natively on the Atari, I'm not sure what's best but I'm sure someone will have a recommendation.

 

For the BASIC question, I think you just PEEK(addr)+PEEK(addr+1)*256, or use DPEEK(addr) from one of the more advanced BASICs.

Edited by danwinslow
Link to comment
Share on other sites

11 hours ago, danwinslow said:

If you want to do it natively on the Atari, I'm not sure what's best

I use MAC/65 it's probably the most common and very powerful, I also found if using Altirra

you can PRINT your code, copy/paste into MADS, with little modification the code will compile ok

Link to comment
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...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...