Working LCD!

This commit is contained in:
Daniele Verducci su MatissePenguin
2020-10-24 23:30:50 +02:00
parent c833911cad
commit 01d1e1f6d8
5 changed files with 57 additions and 10 deletions

5
assembly/Makefile Normal file
View File

@ -0,0 +1,5 @@
bios:
z80asm -i pat80_bios_0.1.asm -o rom.bin
dd if=/dev/zero of=rom.bin bs=1 count=0 seek=8192
minipro -w rom.bin -p "AT28C64B"

View File

@ -4,4 +4,5 @@ Portare binario alla dimensione dell eeprom:
dd if=/dev/zero of=rom.bin bs=1 count=0 seek=8192
Scrivere su EEPROM:
minipro -w rom.bin -p "AT28C64B"
Leggere EEPROM:
minipro -r rom_read.bin -p "AT28C64B"

View File

@ -36,4 +36,3 @@ ld a,%00100001
out (LCD_DATA_REG),a
halt

View File

@ -0,0 +1,41 @@
; SYSTEM CONFIGURATION
LCD_INSTR_REG: EQU %00000000
LCD_DATA_REG: EQU %00000001
; System initialization
call lcd_init
; write characters to display
ld bc, hello_world
call lcd_write ; write string to screen
halt
lcd_init:
;reset procedure
ld a,%00111000
out (LCD_INSTR_REG),a
ld a,%00001000
out (LCD_INSTR_REG),a
ld a,%00000001
out (LCD_INSTR_REG),a
;init procedure
ld a,%00111000
out (LCD_INSTR_REG),a
ld a,%00001110
out (LCD_INSTR_REG),a
ret
lcd_write:
ld a, (bc) ; bc is the pointer to passed string's first char
cp 0 ; compare A content with 0 (subtract 0 from value and set zero flag Z if result is 0)
ret z ; if prev compare is true (Z flag set), string is finished, return
out (LCD_DATA_REG),a ; output char
inc bc ; increment bc to move to next char
jp lcd_write
hello_world:
DB "Lorem ipsum",0 ; null terminated string