Tuesday, October 7, 2014

How to use Subroutines in 6811 Assembly programming

Subroutines are similar to concept of functions in C/C++. In 6811, in order to call a subroutine you can use the instruction: JSR

So your code would be something like:

ORG $C000

; some initialization code

JSR stringLength

; more code ...
; e.g.
CLRA
LDAA #$40

;further down in your code you define your subroutine

stringLength
;; your subroutine code will go here
;; e.g.
ORAA $0F

RTS ; return from subroutine


The following video describes how to use and implement subroutines in 68HC11:



1 comment:

  1. Binance account hacking creates trouble as the security of your account is at risk. If you don’t know how to deal with the Binance account hacking issues, you can contact the team who is ready to assist you. Call on Binance customer care number which is all the time active and users can have conversation with the team who is ready to assist you. Contact with the team who is ready to guide you and serves the best solution that could be helpful in fixing issues immediately from the roots. The team is there to handle all your queries in no time.

    ReplyDelete