Experimenting with lcd cursor location instructions
This commit is contained in:
@ -1,6 +1,9 @@
|
||||
; HD44780 20x4 characters LCD display driver
|
||||
; @author Daniele Verducci
|
||||
|
||||
; variables
|
||||
;lcd_cur_x: EQU DRV_VAR_SPACE
|
||||
;lcd_cur_y: lcd_cur_x + 1
|
||||
|
||||
; functions
|
||||
|
||||
@ -36,7 +39,10 @@ lcd_print:
|
||||
; @param B X-axis position (0 to 19)
|
||||
; @param C Y-axis position (0 to 3)
|
||||
lcd_locate:
|
||||
; TODO
|
||||
ld a,0xFE
|
||||
out (LCD_INSTR_REG),a ; warns the lcd microcontroller that a command is coming
|
||||
ld a,0xA8
|
||||
out (LCD_INSTR_REG),a ; place cursor to first char of second line
|
||||
ret
|
||||
|
||||
; Clears the screen
|
||||
|
@ -1,8 +1,11 @@
|
||||
; Pat80 BIOS v0.01
|
||||
; @author: Daniele Verducci
|
||||
;
|
||||
; ROM is at 0x00
|
||||
; RAM is at 0x80
|
||||
; ROM is at 0x0000
|
||||
; RAM is at 0x8000
|
||||
; SYSTEM VAR SPACE: 0x8000 - 0x8FFF (4kb)
|
||||
; DRIVERS VAR SPACE: 0x9000 - 0x9FFF (4kb)
|
||||
; APPLICATION VAR SPACE: 0xA000 - 0xFFFF (24kb)
|
||||
; LCD is at I/O 0x00 and 0x01
|
||||
|
||||
|
||||
@ -13,6 +16,9 @@ jp sysinit ; Startup vector: DO NOT MOVE! Must be the first instruction
|
||||
; SYSTEM CONFIGURATION
|
||||
LCD_INSTR_REG: EQU %00000000
|
||||
LCD_DATA_REG: EQU %00000001
|
||||
SYS_VAR_SPACE: EQU 0x8000
|
||||
DRV_VAR_SPACE: EQU 0x9000
|
||||
APP_VAR_SPACE: EQU 0xA000
|
||||
|
||||
|
||||
; CONSTANTS
|
||||
@ -35,12 +41,29 @@ sysinit:
|
||||
ld bc, SYSINIT_GREETING
|
||||
call lcd_print ; write string to screen
|
||||
|
||||
call lcd_locate
|
||||
|
||||
ld bc, LIPSUM
|
||||
call lcd_print
|
||||
|
||||
;call lcd_cls ; clear screen
|
||||
|
||||
;call count
|
||||
|
||||
halt
|
||||
|
||||
|
||||
; count:
|
||||
; myVar: EQU APP_VAR_SPACE ; init variable
|
||||
; ld hl, "A" ; load value into register
|
||||
; ld (myVar), hl ; copy value into variable
|
||||
; call count_loop
|
||||
|
||||
; count_loop:
|
||||
; ld bc, myVar
|
||||
; call lcd_print
|
||||
; ; increm var
|
||||
; ld a, (myVar)
|
||||
; inc a
|
||||
; ld (myVar), a
|
||||
; call count_loop
|
||||
|
Reference in New Issue
Block a user