Created
April 5, 2011 12:49
-
-
Save jacbar/903531 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WR_CMD EQU 0FF2CH | |
WR_DATA EQU 0FF2DH | |
RD_STATUS EQU 0FF2EH | |
RD_DATA EQU 0FF2FH | |
ORG 0 | |
START: | |
call LCD_INIT | |
call LCD_PUTS | |
JMP $ | |
;================================================== | |
LCD_INIT: | |
mov A,#38H | |
call LCD_WR_CMD | |
mov A,#01H | |
call LCD_WR_CMD | |
mov A,#06H | |
call LCD_WR_CMD | |
RET | |
;================================================== | |
LCD_WR_DATA: | |
push DPH | |
push DPL | |
push ACC | |
mov DPTR,#RD_STATUS | |
petla2: movx A,@DPTR | |
JB ACC.7, petla2 | |
pop ACC | |
mov DPTR,#WR_DATA | |
movx @DPTR,A | |
pop DPL | |
pop DPH | |
RET | |
;================================================== | |
;Kod komendy - A | |
;================================================== | |
LCD_WR_CMD: | |
push DPH | |
push DPL | |
push ACC | |
mov DPTR,#RD_STATUS | |
petla: movx A,@DPTR | |
JB ACC.7, petla | |
pop ACC | |
mov DPTR,#WR_CMD | |
movx @DPTR,A | |
pop DPL | |
pop DPH | |
RET | |
;================================================== | |
LCD_GOTOXY: | |
RET | |
;================================================== | |
LCD_PUTCH: | |
call LCD_WR_DATA | |
RET | |
;================================================== | |
LCD_PUTS: | |
mov DPTR,#text | |
for: | |
movx A,@DPTR | |
JZ koniec | |
call LCD_PUTCH | |
inc DPTR | |
pop ACC | |
SJMP for | |
koniec: | |
RET | |
;================================================== | |
text: DB 'Iwan i Grzesiu to cioty', 0 | |
END | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment