AnyCPU
http://anycpu.org/forum/

Is It Me Or The Simulator
http://anycpu.org/forum/viewtopic.php?f=25&t=98
Page 1 of 1

Author:  James_Parsons [ Thu Oct 31, 2013 12:03 pm ]
Post subject:  Is It Me Or The Simulator

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

Author:  Garth [ Thu Oct 31, 2013 5:53 pm ]
Post subject:  Re: Is It Me Or The Simulator

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?

Author:  MichaelM [ Fri Nov 01, 2013 1:28 am ]
Post subject:  Re: Is It Me Or The Simulator

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

Author:  James_Parsons [ Fri Nov 01, 2013 12:04 pm ]
Post subject:  Re: Is It Me Or The Simulator

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

Author:  barrym95838 [ Tue Dec 31, 2013 2:38 am ]
Post subject:  Re: Is It Me Or The Simulator

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

Author:  BigEd [ Tue Dec 31, 2013 9:47 am ]
Post subject:  Re: Is It Me Or The Simulator

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

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/