Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need some help modifying the program below to display a digital clock on the L

ID: 1813382 • Letter: I

Question

I need some help modifying the program below to display a digital clock on the LCD of the Fox 11 Trainer board.  I also need the dip switches, when switched on, too add an hour to the clock.  Kind of like changing time zones.  Here is the program that requires modification.

TEN_MS:  equ 2500
STACK:  equ $8FFF

; The following 3 routines are included in BUFFALO monitor ver. 3.47
org     $FF70
lcd_ini: rmb 3 ; initializes 16x2 LCD module
lcd_line1: rmb 3 ; displays 16 char on the first line
lcd_line2: rmb 3 ; displays 16 char on the second line

org $D000
jmp start
*
delay_10ms:
pshx
ldx     #TEN_MS  ; 2500 x 8 = 20,000 cycles = 10ms
del1: dex   ; 3 cycles
nop   ; 2 cycle
bne del1  ; 3 cycles
pulx
        rts
*
start:  lds #STACK
    jsr delay_10ms ; delay 20ms during power up
     jsr delay_10ms

     jsr lcd_ini  ; initialize LCD

back: ldx     #MSG1  ; MSG1 for line1, x points to MSG1
        jsr lcd_line1
*
     ldx     #MSG2  ; MSG2 for line2, x points to MSG2
        jsr lcd_line2
      swi                     ; go back to BUFFALO monitor
      
MSG1:   FCC     "  FOX11 TRAINER "
MSG2:   FCC     "(C)2002, EVBPLUS"
        end

Here is a link to the programmers guide

http://www.freescale.com/files/microcontrollers/doc/ref_manual/M68HC11ERG.pdf

Explanation / Answer