Being new to assembler and learning by example, i’m trying to adapt the Tiny Control app.
I’m trying to create a function to display a single-char bar (as on the MidiBox64) using 7 special chars (0x00 to 0x06) and the standard char 0xFF (which is a complete filled bar, that way i save one char).
I got this far and it works pretty well for values under 112 (bars 1-7)
;; --------------------------------------------------------------------------
;; print a parameter bar
;; IN: number of parameter (0x00-0xff) in WREG
;; --------------------------------------------------------------------------
TC_DISPLAY_Page_PrintBar
lfsr FSR0, TC_VALUES_BEGIN ; base address
movwf FSR0L ; write WREG to FSR0L
rcall TC_DISPLAY_Hlp_CalcPtr_VMode ; get pointer to value mode entry
tblrd* ; read table entry
;; move para value to WREG
movf INDF0, W
;; devide value by 16 = get value in range 0x00 - 0x07
rrf WREG, F ; WREG/2
rrf WREG, F ; WREG/2
rrf WREG, F ; WREG/2
rrf WREG, W ; WREG/2
andlw 0x07
;; this is not right... :(
IFSET WREG, 0x07, movlw 0xFF
call MIOS_LCD_PrintChar
return
I have trouble coding the condition “if the value is 0x07 use 0xFF instead” for the 8th bar…
Can anyone give me a hand or point me in the right direction with this one?
thanks in advance!
MIOS ROCKS! ;D