Jump to content
funkheld

what does that mean in mads? $B2 , $A0..........

Recommended Posts

Hi good afternoon.

 

what does that mean in mads? $B2 , $A0..........

is there a table please?

 

 

thanks.
greeting


STY $B2
ADC $B2
STA $A0
LDA $B1
ADC $A3
STA $A1

Edited by funkheld

Share this post


Link to post
Share on other sites
13 minutes ago, funkheld said:

Hi good afternoon.

 

what does that mean in mads? $B2 , $A0..........

is there a table please?

 

 

thanks.
greeting


STY $B2
ADC $B2
STA $A0
LDA $B1
ADC $A3
STA $A1

All these are "page zero" addresses, so $B0 is the same as $00B0. Don't know how much you already know about 6502 programming, so just ignore if it's too basic (no pun intended).

 

Out of context it is not possible to say what this code is supposed to do.

 

STY $B2 means "store contents of 6502 Y register in memory location $00B0"

ADC $B2 means "add contents of that memory location to whatever is in the accumulator" (the 6502's main register).

STA $A0 means "store contents of 6502 accumulator in memory location $00A0"

LDA $B1 means "load contents of memory location $00B1 into accumulator"

ADC $A3 means "add contents of memory location $00A3 to what was loaded into the accumulator before

STA $A1 means "store contents of accumulator into memory location $00A1

 

"Page Zero", i.e. the memory addresses from $0000 to $00FF (or the first 256 bytes in memory) are "special" for the 6502 because they are quicker to access and some processor commands only work with these addresses. Depending on what environment you're working in, different parts of page zero are used by BASIC, DOS, etc. and you have to be careful not to mess with them. Some information on this is given in "Mapping the Atari".

 

There are some programming resources books in a sticky thread on top of this section of the forum. Some of the books mentioned there cover assembly language programming, for pure 6502 assembler the 6502 book by Rodney Zaks is a good starting point, but it won't cover any Atari specifics.

Share this post


Link to post
Share on other sites

thanks for the information.

I would like to please know which addresses in the compiler MADS are provided for this purpose.
Is there a list please in MADS for it ?

 

thanks.
greeting
 

Edited by funkheld

Share this post


Link to post
Share on other sites

I apologize if I am answering the wrong question with information you already know.  
 

As far as I know, MADS itself doesn’t reserve any addresses.  The OS has some addresses reserved for code and other specific purposes.  

 

I think you want to look at a memory map like Ian Chadwick’s Mapping the Atari.
https://www.atariarchives.org/mapping/

 It will tell you what addresses are reserved by the OS as well as which are Write only or read only.

For example $D000: writing to this address sets the p0 horizontal position and reading from it is a collision register. I am aware that book has some errors so others may suggest a better source for information.

 

It also gives a good idea of what zero page addresses are available for you to use.  
 

If you are looking for a place where you can write to memory, page 6 is out there $600-$6ff.  You also need a memory address for your program code itself.  
 

Does that help answer the question or did I misunderstand?

 

Share this post


Link to post
Share on other sites

Zero page $80 to $FF is for application use.  If there's a cartridge or language present then it'll use much of them.  The built in OS Floating Point uses much of the higher area around $D4-$FF.  If the FP isn't in use then it's locations can be used freely.  Between FP calls they can be used as workspace.

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.

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...