CCR Flags Using 68HC11

Thread Starter

Jimmy Faulks

Joined Mar 25, 2015
5
Code:
***********************
* Program starts here *
***********************
  ORG  $2400

START
*  LDS  #$23FF    set stack pointer, DO NOT set when running under monitor
   JSR  ONSCI    initialize serial port
  LDX  #MSG    get message string
  JSR  OUTSTRG    send it out serial port
    


** PART 3A
   SEV
   CLV
   SEI
   CLI
   SEC
   CLC
   LDAA #$01
   NEGA
   NEGA
   CLRA
  
** PART 3B
   LDAA #$10
   LDAB #$0F
   LDD    #$FEEF
   LDX #$4D
   TAB
   CLRA
   CLRB
    

** PART 3C
  
   ADDA #$F0
   SUBB #$B0
   INCA
   DECB
   CLRA
   CLRB
  
** PART 3D
   LDAA #$01
   LDAB #$01
   ANDA
   ORB
   EORA
   ORA
   CLRA
   CLRB
  
** PART 3E
   LDAA #$2F
   LDAB #$CF
   LSLA
   ASLB
   RORB
   ROLA
  
   CLRA
   CLRB
  
*** PART 3F
   LDAA #05
   LDAB #04
   BITA #06
   CMPB #07
   TSTA
   CPD #$FF22
   CLRA
   CLRB
  
** PART 3G
   LDAA #05
   LDAB #04
   SBA
   BLT   SOMEWHERE
   BGE   SOMEWHERE2
   BEQ SOMEWHERE3
   BRA   SOMEWHERE4
  
TWOE
   LDAA #04
   LDAB #05
   SBA
   BLT   SOMEWHERE
   BGE   SOMEWHERE2
   BEQ SOMEWHERE3
   BRA   SOMEWHERE4  
  
THREEE
   LDAA #05
   LDAB #05
   SBA
   BLT   SOMEWHERE
   BGE   SOMEWHERE2
   BEQ SOMEWHERE3
   BRA   SOMEWHERE4

FOURE
   LDAA #04
   LDAB #05
   SBA
   BRA   SOMEWHERE4
  
SOMEWHERE   CLRA
       CLRB
       JSR TWOE
SOMEWHERE2   CLRA
       CLRB
       JSR THREEE
SOMEWHERE3   CLRA
       CLRB
       JSR FOURE
SOMEWHERE4   CLRA
       CLRB

** PART 3H
   JMP SOMEWHERE5

SOMEWHERE5
   JSR HOWDY

HOWDY
   BRA   HOWDY2

HOWDY2
   BRN
  
  

eloop  nop     endless loop
  bra   eloop
  RTS
**********
*  ONSCI() - Initialize the SCI for 9600
*  baud at 8 MHz Extal.
**********
ONSCI  LDAA #$30
  STAA BAUD  baud register
  LDAA #$00
  STAA SCCR1
  LDAA #$0C
  STAA SCCR2  enable
  RTS
**********
*  OUTSTRG(x) - Output string of ASCII bytes
* starting at x until end of text ($04).
**********
OUTSTRG  JSR  OUTCRLF
OUTSTRG0 PSHA
OUTSTRG1 LDAA 0,X  read char into a
  CMPA #EOT
  BEQ  OUTSTRG3  jump if eot
  JSR  OUTPUT  output character
  INX  incriment pointer
  BRA  OUTSTRG1  loop
OUTSTRG3 PULA
  RTS
**********
*  OUTCRLF() - Output a Carriage return and
* a line feed.  Returns a = cr.
**********
OUTCRLF  LDAA #$0D  cr
  JSR  OUTPUT  output a
  LDAA #$00
  JSR  OUTPUT  output padding
  LDAA #$0D
  RTS
**********
*  OUTPUT() - Output A to sci.
**********
OUTPUT
OUTSCI2  LDAB SCSR  read status
  BITB #$80
  BEQ  OUTSCI2  loop until tdre=1
  ANDA #$7F  mask parity
  STAA SCDAT  send character
OUTSCI3  RTS
*** TEXT TABLES ***
*MSG  FCC  ''
  FCB  EOT
*  org  $FFFE  set the reset vector
*  fdb  START

  END

I have written my different codes that is classified as a)condition b)data transfer c)arithmetic d)logical e)shift/rotate f)compare/test g)conditional branch h)unconditional branch

The next step to to Trace this. when opening the Tera Term and typing "T" Only three lines are being displayed repeating over and over. Am I now using the Trace command correctly? I'm trying to demonstrate and verify that my operations to each part works.
 

Thread Starter

Jimmy Faulks

Joined Mar 25, 2015
5
I can see it is 68HC11 assembly language. What software package are you running?
There is no software being ran with the MP. Just writing a short code that steps down from a-g and then I am to Trace it.
A student only trying to learn not requiring coding only possible explanations of error.
 

MrChips

Joined Oct 2, 2009
30,823
Are you using the 68HC11 for the first time?

You have to use some kind of hardware and software.

Firstly, you have to type the code using some kind of editor.
Next, you need an assembler to translate the text file into machine code.
Then you need either hardware or a simulator to run the code.

There are already numerous errors in your code. The assembler will flag these errors for you. You cannot proceed unless you correct these errors.
 

MrChips

Joined Oct 2, 2009
30,823
Ah, I see. So you are using BUFFALO. It will take me a long while to set up BUFFALO, which I have never used for any practical purpose.

Let's back up for a moment. Why are you doing this? Why have you chosen 68HC11?

What is the full part number printed on the 68HC11 chip?
Can you post a photo of the board so that we can see what this dinosaur looks like?
 
Last edited:

Thread Starter

Jimmy Faulks

Joined Mar 25, 2015
5
Are you using the 68HC11 for the first time?

You have to use some kind of hardware and software.

Firstly, you have to type the code using some kind of editor.
Next, you need an assembler to translate the text file into machine code.
Then you need either hardware or a simulator to run the code.

There are already numerous errors in your code. The assembler will flag these errors for you. You cannot proceed unless you correct these errors.
When using the notepad ++, there isn't any errors. After this DosBox gives me my .s19 file with bytes in it.
And again, after this I am trying to Trace the code I just wrote. It isn't meant to do anything special. Although this is my first experience with the MP, I fail to understand what the intent of you asking what simulator or editor I am using. None of this matters with the question I have asked.
 
Top