Hello

SDCC : stm8 3.4.1 #9068 (Sep  5 2014) (Linux)

I dont see the difference between this ( A and B ) :

I have _lcdchar   declared by :

.area OSEG
_varOne:
.ds     1
_lcdchar:
.db     1

.area CSEG

.
.which seems not working, at least the way variables
   are to mee in assembly ...
.

A)

;try write I                          ### this block doesnt work: prints 
"trash"

ldw     x, #0d05
call    delay_m

mov     _lcdchar, #0b01001001

ld      a,_lcdchar      ; "I" upper "i" : ascii code in the hd44780
and     a,#0b11110000   ; delete lower nib
or      a,#0b00000011   ; put in that : data write + bkl ON
ld      PD_ODR, a       ; #0b01000011
bset    PD_ODR, #3
bres    PD_ODR, #3
ldw     x, #0d5
call    delay_m
ld      a,_lcdchar      ; "I" upper "i" : ascii code in the hd44780
swap    a
and     a,#0b11110000   ; delete lower nib
or      a,#0b00000011   ; put in that : data write + bkl ON
ld      PD_ODR, a
bset    PD_ODR, #3
bres    PD_ODR, #3


And that:

B)
;try write I                        ### this block writes a capital i .

ldw     x, #0d05
call    delay_m


ld      a,#0b01001001   ; "I" upper "i" : ascii code in the hd44780
and     a,#0b11110000   ; delete lower nib
or      a,#0b00000011   ; put in that : data write + bkl ON
ld      PD_ODR, a       ; #0b01000011
bset    PD_ODR, #3
bres    PD_ODR, #3
ldw     x, #0d5
call    delay_m
ld      a,#0b01001001   ; "I" upper "i" : ascii code in the hd44780
swap    a
and     a,#0b11110000   ; delete lower nib
or      a,#0b00000011   ; put in that : data write + bkl ON
ld      PD_ODR, a
bset    PD_ODR, #3
bres    PD_ODR, #3






thnx again for stm8 support ! :)

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to