6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 3:49 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Mon Dec 17, 2012 3:55 pm 
Offline
User avatar

Joined: Wed May 30, 2012 7:45 pm
Posts: 58
Location: Dallas, TX
I have been using AppleWin with Merlin 2.4 to fiddle
with 6502 ASM for a few days now. I have several books
on 6502 and have felt comfortable using an apple ii environment
just for fun.

I have followed all the basics of the manual. However, I'm not
happy with what little information there is about MON (monitor) mode.
All it says is that it is for experienced programmers.

I haven't been able to find ANYTHING online about the monitor mode.

Because my apps are small / simple, I want to be able to output the calculations.
I want to see the registers and also the memory output for my programs.

When I run the code with the command 300G (which runs the program stored at $300) it doesn't output anything. Obviously, I would have to write to some output address.
Which addy would that be?

Can I debug with Merlin?

Does anyone know where I should begin?

Thanks

_________________
http://www.thestarrlab.com


Top
 Profile  
Reply with quote  
PostPosted: Mon Dec 17, 2012 7:37 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
Welcome Johnny!
Is the monitor you're using this one: http://apple2.info/wiki/index.php?title=System_Monitor
?

Cheers
Ed


Top
 Profile  
Reply with quote  
PostPosted: Wed Dec 19, 2012 3:15 am 
Offline
User avatar

Joined: Thu Mar 11, 2004 7:42 am
Posts: 362
The MON just enters the Apple II (ROM) monitor, described in the Apple II Reference Manual, the IIe techinical reference manual & elsewhere. The monitor is not specific to Merlin.

To actually put the code in memory you need to use the GET command.

Once you've entered the source code, e.g.

Code:
      ORG $300
HELLO LDX #0
:1    LDA :3,X
      BEQ :2
      JSR $FDED
      INX
      JMP :1
:2    RTS
:3    ASC "HELLO WORLD"00


Assemble it with the command:

ASM

Then put in memory with the command:

GET $300

Then use MON to enter the monitor. At the * (monitor) prompt, type

300L

to make sure it actually placed the object code. To run it, type

300G

The Control-Y (monitor) command gets you back to Merlin. I have not tried the above, so hopefully I have not forgotten a step.


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 02, 2013 2:45 pm 
Offline

Joined: Fri Sep 28, 2012 12:27 pm
Posts: 25
Location: Boulogne Billancourt, France
Hello,

Address $300 in bank 0 is sometimes used by the full screen editor or other merlin companion utilities in some configurations (such as mine: merlin 2.47, DOS 3.3 version).
So in order to make the GET command not fail with a range error, you might have to change the ORG address to $8000 within the source code for instance then
ASM
GET $8000
MON
*8000L list the program code segment starting at address $8000
*8000S step mode for some specific versions of system monitors (//gs and newest //c s).
*8000G Do an implicit JSR to address 8000.
<Ctrl><E> will display registers content images.
But the recommended way is to do the debug apart from the build tool. If you're using the Applewin emulator, I understand that it includes some powerful debug facilities which will easily outperform any 6502 based debug tool at least when you are working at machine code level. All you have to do before proceeding is to get an assembly listing of your program from Merlin. The debugger included within AppleWin will even translate some well known addresses (page zero and ROM) to their mnemonic in order to easier the reading and navigation within your own program. In order to activate such debug feature, all you have to do is to click on the magnifying glass (or press F7 in full screen mode).
HTHATS,
BenoƮt


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: