It's the other way around:
ldhx RAM ; H = (RAM) and X = (RAM + 1)
As for your code stub, I'm going to guess that this will be run as part of an interrupt service routine (ISR) that gets executed once a second(?). Make sure that you clear the source of the interrupt before you exit the ISR. I'm not sure why you're only counting to 30 seconds, but I'm guessing that you don't need to display these values. If that's the case, decrementing variables can be more efficient. If I assume that this is correct, and that your variables are located in direct page, I suggest considering something like this:
INIT_RTCSEC: equ $1E ; initial value for RTCSEC = 30
INIT_RTCMIN: equ $78 ; initial value for RTCMIN = 120
init_clock:
mov #INIT_RTCSEC, RTCSEC ; initialize RTCSEC
mov #INIT_RTCMIN, RTCMIN ; initialize RTCMIN
rts ; return
ISR_clock:
;
; clear the source of the interrupt
;
dbnz RTCSEC, ISR_clock_exit ; decrement RTCSEC and exit if it's not zero
mov #$1E, RTCSEC ; else, reload RTCSEC with 30
dbnz RTCMIN, ISR_clock_exit ; decrement RTCMIN and exit if not zero
mov #$78, RTCMIN ; else, reload RTCMIN with 120
inc RTCHR ; advance RTCHR
ISR_clock_exit:
rti ; exit
I hope that this helps.
Best Regards,
Derrick