projects
/
calu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bootromfun: sollte nach einem 'H' zweimal 'O' ausgeben und danach blockieren bis
[calu.git]
/
2_isa
/
src
/
bootrom.s
diff --git
a/2_isa/src/bootrom.s
b/2_isa/src/bootrom.s
index dc484d7fea490ffa0b0b5d321494cba2ea36319d..2a46cfdabb8a38f695b8c955cbfce4607153b502 100644
(file)
--- a/
2_isa/src/bootrom.s
+++ b/
2_isa/src/bootrom.s
@@
-9,6
+9,10
@@
.define UART_TRANS_EMPTY, 0x1
.define UART_RECV_NEW, 0x2
.define UART_TRANS_EMPTY, 0x1
.define UART_RECV_NEW, 0x2
+ .define PBASE, 0x2030
+ .define PADDR, 0x4
+ .define PDATA, 0x8
+
;-----
start:
br+ main
;-----
start:
br+ main
@@
-18,6
+22,8
@@
start:
main:
ldi r10, UART_BASE@lo
ldih r10, UART_BASE@hi
main:
ldi r10, UART_BASE@lo
ldih r10, UART_BASE@hi
+ ldi r11, PBASE@lo
+ ldih r11, PBASE@hi
poll:
ldw r3, UART_STATUS(r10)
andx r3, UART_RECV_NEW
poll:
ldw r3, UART_STATUS(r10)
andx r3, UART_RECV_NEW
@@
-61,7
+67,6
@@
recv_byte:
;-----
recv_word:
;-----
recv_word:
- xor r0, r0, r0
xor r1, r1, r1
call recv_byte
or r1, r0, r1
xor r1, r1, r1
call recv_byte
or r1, r0, r1
@@
-79,13
+84,12
@@
recv_word:
or r1, r0, r1
addi r0, r1, 0
or r1, r0, r1
addi r0, r1, 0
-
ret
;-----
bootrom:
ret
;-----
bootrom:
- br tehend
call recv_byte
call recv_byte
+ br tehend
xor r1, r1, r1
cmpi r0, 0x57 ; 'W'
xor r1, r1, r1
cmpi r0, 0x57 ; 'W'
@@
-110,14
+114,14
@@
bootrom:
bt_H:
ldi r1, 0x4f ; 'O'
call send_byte
bt_H:
ldi r1, 0x4f ; 'O'
call send_byte
- ; br bootrom ; FIXME
- br
tehend
+ call send_byte
+ br
bootrom
bt_W:
call recv_word ; receive addr
bt_W:
call recv_word ; receive addr
- mov r6, r0
+ stw r0, PADDR(r11)
call recv_word ; receive instr
call recv_word ; receive instr
- st
x r0, 0(r6
)
+ st
w r0, PDATA(r11
)
ldi r1, 0x44 ; 'D'
call send_byte
br bootrom
ldi r1, 0x44 ; 'D'
call send_byte
br bootrom