Working LCD!
This commit is contained in:
5
assembly/Makefile
Normal file
5
assembly/Makefile
Normal 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"
|
||||
|
@ -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"
|
||||
|
@ -36,4 +36,3 @@ ld a,%00100001
|
||||
out (LCD_DATA_REG),a
|
||||
|
||||
halt
|
||||
|
||||
|
41
assembly/pat80_bios_0.1.asm
Normal file
41
assembly/pat80_bios_0.1.asm
Normal 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
|
Reference in New Issue
Block a user