git-svn-id: http://moon:8086/svn/vhdl/trunk@1629 cc03376c-175c-47c8-b038-4cd826a8556b
73 lines
1.6 KiB
JavaScript
73 lines
1.6 KiB
JavaScript
; -------------------------------------------------
|
|
; Constants
|
|
; -------------------------------------------------
|
|
; External RAM/ROM
|
|
xmem
|
|
crlf: dc 13, 10, 0
|
|
msg_txt1: dc "J-CPU V1.", 0
|
|
msg_txt2: dc "Ready.", 13, 10, 0
|
|
msg_txt3: dc "Mimi ist eine liebe Katze !!!", 13, 10, 0
|
|
|
|
; -------------------------------------------------
|
|
; Program
|
|
; -------------------------------------------------
|
|
code
|
|
reset: jmp init
|
|
|
|
org 0x001
|
|
; nop
|
|
reti
|
|
|
|
; -------------------------------------------------
|
|
; Main
|
|
; -------------------------------------------------
|
|
init: xin R0, (cpu_status)
|
|
call bin2hex
|
|
|
|
call uart_putchar
|
|
mov R0, R1
|
|
call uart_putchar
|
|
mov R1, crlf
|
|
call uart_puts
|
|
|
|
loop:
|
|
; Print line 0
|
|
mov R1, msg_txt1
|
|
call uart_puts
|
|
cin R0, (cpu_revision)
|
|
add R0, 0x30
|
|
call uart_putchar
|
|
mov R1, crlf
|
|
call uart_puts
|
|
|
|
; Print line 1
|
|
mov R1, msg_txt2
|
|
call uart_puts
|
|
|
|
; Print line 3
|
|
mov R1, msg_txt3
|
|
call uart_puts
|
|
|
|
mov R15, 160
|
|
fill_lp: tst R15
|
|
jz ex_fill
|
|
dec R15
|
|
mov R1, 48
|
|
ct_loop: cmp R1, 58
|
|
jeq ex_ct
|
|
mov R0, R1
|
|
inc R1
|
|
call uart_putchar
|
|
jmp ct_loop
|
|
ex_ct: jmp fill_lp
|
|
ex_fill: jmp loop
|
|
|
|
; -------------------------------------------------
|
|
include "./xregs.inc.jsm"
|
|
include "../../../../tools/jcpu/lib/cregs.inc.jsm"
|
|
include "../../../../tools/jcpu/lib/utils.inc.jsm"
|
|
include "../../../../tools/jcpu/lib/uart.inc.jsm"
|
|
include "../../../../tools/jcpu/lib/delays.inc.jsm"
|
|
|
|
|