Last visit was: Sun Dec 22, 2024 6:20 am
It is currently Sun Dec 22, 2024 6:20 am



 [ 6 posts ] 
 Is It Me Or The Simulator 
Author Message

Joined: Sat Aug 03, 2013 11:02 pm
Posts: 43
I am using this 6800/6811 simulator, a nd i try to change the character on the display to 'A'.
Code:
MAIN     LDAA     #$65
         STAA     $FB00
         .END

It does not do anything, is the problem in my code, or does the simulator not right

_________________
intel 4004 countdown

:05000000DAF81C01000C
:00000001FF


Thu Oct 31, 2013 12:03 pm

Joined: Tue Dec 11, 2012 8:03 am
Posts: 285
Location: California
You might need to give a little more info. Which simulator? What it it simulating? Storing a number to $FB00 by itself is rather meaningless without this info, but if you tell what you're simulating, someone who's familiar with it might recognize it and be able to help. Are you sure you're just supposed to store it there, not run the subroutine at $FB00?

_________________
http://WilsonMinesCo.com/ lots of 6502 resources


Thu Oct 31, 2013 5:53 pm WWW

Joined: Wed Apr 24, 2013 9:40 pm
Posts: 213
Location: Huntsville, AL
James_Parsons:

I agree with Garth that you need to provide more information before you can expect an answer to your post. Like Garth, I have no idea which simulator you are using, what assembler syntax that simulator accepts, or even if the simulator emulates a UART and console, and the address to which you write the contents is the transmit register of that emulated UART.

On an unrelated topic, I followed the link you provided to your web site. If you don't mind, I'm going to comment on one of them.
Code:
START    LDAA  #0A
 
LOOP     DECA 
         CMPA  #00
         BEQ   DONE
         BNE   LOOP

DONE     RTS

In your count down example, I believe that you have correctly implemented the subprogram. That is, you load accumulator A with 10 (LDAA #0A), and the loop decrements that accumulator by 1 in each pass through the loop, and exits when the value in the accumulator reaches a value of zero.

However, you are not making effective use of the processor. First, if you'll refer to the MC6800 Programmer's Reference Manual, the decrement accumulator A instruction (DECA) modifies the processor arithmetic status flags. It modifies the N (negative), the V (oVerflow), and the Z (Zero) flags. It does not modify the C (Carry) flag. What this means for your program is that the Compare Accumulator A with immediate value 0 (CMPA #0) instruction is not required. Second, you really only need one of the two conditional branch instructions, the second one - BNE LOOP.

Thus, you can simplify and improve your subprogram in the following manner:
Code:
START    LDAA  #0A
 
LOOP     DECA 
         BNE   LOOP

DONE     RTS

_________________
Michael A.


Fri Nov 01, 2013 1:28 am

Joined: Sat Aug 03, 2013 11:02 pm
Posts: 43
Sorry :( i thought I posted a link, but I guess not. Anyway the problem was the simulator, It worked on an older version, but with a different charset

_________________
intel 4004 countdown

:05000000DAF81C01000C
:00000001FF


Fri Nov 01, 2013 12:04 pm

Joined: Tue Dec 31, 2013 2:01 am
Posts: 116
Location: Sacramento, CA, United States
James_Parsons wrote:
I am using this 6800/6811 simulator, a nd i try to change the character on the display to 'A'.
Code:
MAIN     LDAA     #$65
         STAA     $FB00
         .END

It does not do anything, is the problem in my code, or does the simulator not right


I always thought that $65 was a lower-case 'e', not a capital 'A', but my experience is mostly ASCII.

Mike


Tue Dec 31, 2013 2:38 am

Joined: Wed Jan 09, 2013 6:54 pm
Posts: 1808
That'll be it: #$65 is #101 which is 'e' whereas #$41 is #65 is 'A'

The emulator might be this one: http://www.hvrsoftware.com/6800emu.htm which is for Windows but runs OK on Linux using WINE.

Image


Tue Dec 31, 2013 9:47 am
 [ 6 posts ] 

Who is online

Users browsing this forum: claudebot and 0 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

Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software