Added IO address decoding. Lorem ipsum demo (without sorting LCD cursor addressing problems).
This commit is contained in:
@@ -1,21 +1,39 @@
|
||||
; Pat80 BIOS v0.01
|
||||
; @author: Daniele Verducci
|
||||
;
|
||||
; 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
|
||||
; MEMORY MAP
|
||||
; 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)
|
||||
; I/O MAP
|
||||
; I/O 0 (0x00 - 0x1F) LCD (uses 0x00 and 0x01)
|
||||
; I/O 1 (0x20 - 0x3F)
|
||||
; I/O 2 (0x40 - 0x5F)
|
||||
; I/O 3 (0x60 - 0x7F)
|
||||
; I/O 4 (0x80 - 0x9F)
|
||||
; I/O 5 (0xA0 - 0xBF)
|
||||
; I/O 6 (0xC0 - 0xDF)
|
||||
; I/O 7 (0xE0 - 0xFF)
|
||||
|
||||
|
||||
|
||||
jp sysinit ; Startup vector: DO NOT MOVE! Must be the first instruction
|
||||
jp Sysinit ; Startup vector: DO NOT MOVE! Must be the first instruction
|
||||
|
||||
|
||||
; SYSTEM CONFIGURATION
|
||||
LCD_INSTR_REG: EQU %00000000
|
||||
LCD_DATA_REG: EQU %00000001
|
||||
IO_0: EQU 0x00
|
||||
IO_1: EQU 0x20
|
||||
IO_2: EQU 0x40
|
||||
IO_3: EQU 0x60
|
||||
IO_4: EQU 0x80
|
||||
IO_5: EQU 0xA0
|
||||
IO_6: EQU 0xC0
|
||||
IO_7: EQU 0xE0
|
||||
|
||||
LCD_INSTR_REG: EQU IO_0
|
||||
LCD_DATA_REG: EQU IO_0 + 1
|
||||
|
||||
SYS_VAR_SPACE: EQU 0x8000
|
||||
DRV_VAR_SPACE: EQU 0x9000
|
||||
APP_VAR_SPACE: EQU 0xA000
|
||||
@@ -23,9 +41,9 @@ APP_VAR_SPACE: EQU 0xA000
|
||||
|
||||
; CONSTANTS
|
||||
SYSINIT_GREETING:
|
||||
DB "Pat80 BIOS v0.1",0 ; null terminated string
|
||||
DB "Pat80",0 ; null terminated string
|
||||
LIPSUM:
|
||||
DB "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",0
|
||||
DB "Lorem ipsum dolor siadipiscing elit. Sedt amet, consectetur dapibus nec nullam.",0
|
||||
|
||||
|
||||
|
||||
@@ -34,22 +52,44 @@ LIPSUM:
|
||||
include 'driver_hd44780.asm'
|
||||
|
||||
; System initialization
|
||||
sysinit:
|
||||
call lcd_init
|
||||
Sysinit:
|
||||
call Lcd_init
|
||||
|
||||
; position to line 2 char 3
|
||||
;ld b, 1
|
||||
;ld c, 1
|
||||
;call Lcd_locate
|
||||
|
||||
; write characters to display
|
||||
ld bc, SYSINIT_GREETING
|
||||
call lcd_print ; write string to screen
|
||||
|
||||
call lcd_locate
|
||||
;ld bc, SYSINIT_GREETING
|
||||
;call Lcd_print ; write string to screen
|
||||
|
||||
ld bc, LIPSUM
|
||||
call lcd_print
|
||||
|
||||
;call lcd_cls ; clear screen
|
||||
call Lcd_print
|
||||
|
||||
;call count
|
||||
|
||||
|
||||
; IO TEST
|
||||
iotest:
|
||||
; do not test 0: is lcd
|
||||
ld a,0x00
|
||||
out (IO_1),a
|
||||
ld a,0x00
|
||||
out (IO_2),a
|
||||
ld a,0x00
|
||||
out (IO_3),a
|
||||
ld a,0x00
|
||||
out (IO_4),a
|
||||
ld a,0x00
|
||||
out (IO_5),a
|
||||
ld a,0x00
|
||||
out (IO_6),a
|
||||
ld a,0x00
|
||||
out (IO_7),a
|
||||
|
||||
call Lcd_cls ; clear screen
|
||||
|
||||
halt
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user