Browse Subversion Repository
Contents of /trunk/src/start.s
Parent Directory
| Revision Log
Revision 14 -
( show annotations)
( download)
Mon Oct 1 13:59:20 2012 UTC
(11 years, 8 months ago)
by tekken_boss
File size: 2473 byte(s)
000.001.014: 2012/10/01 22:55 : ROM code maintenance.
== modification
* [SL811] Process wait added after start up and after reset. 500ms
(countermeasure for ROM code).
== Confirmation
* Compilable.
| 1 |
|
| 2 |
/* --------------------------------------------- */ |
| 3 |
/* H8-3069F Start up routine */ |
| 4 |
/* (c) KAZ.Imamura */ |
| 5 |
/* */ |
| 6 |
/* CPU : Renesus H8/3069F 25MHz */ |
| 7 |
/* Memory : ROM 512KB, RAM 16KB E-RAM 2MB */ |
| 8 |
/* Target : AKI-3069-USB on h8mon */ |
| 9 |
/* --------------------------------------------- */ |
| 10 |
|
| 11 |
.h8300h |
| 12 |
.section .text |
| 13 |
.global _start |
| 14 |
.global _permit_irq |
| 15 |
.global _prohibit_irq |
| 16 |
.global _wait_100us |
| 17 |
.global _verify_mem |
| 18 |
.global _verify_mem256K |
| 19 |
|
| 20 |
|
| 21 |
_start: |
| 22 |
mov.l #_stack_end,sp |
| 23 |
jmp _main ; Goto main() |
| 24 |
|
| 25 |
_sleep: |
| 26 |
sleep |
| 27 |
rts |
| 28 |
|
| 29 |
_permit_irq: |
| 30 |
andc.b #0x7f, ccr |
| 31 |
rts |
| 32 |
|
| 33 |
_prohibit_irq: |
| 34 |
orc.b #0x80, ccr |
| 35 |
rts |
| 36 |
|
| 37 |
|
| 38 |
_wait_100us: |
| 39 |
orc.b #0x80, ccr ; 2 state |
| 40 |
push.w r2 ; 8 state |
| 41 |
mov.w #0x0271, r2 ; 4 state |
| 42 |
dec.w #1, r2 ; 2 state |
| 43 |
bne .-2 ; 2 state ----- 4 state (160ns) * 620+5(Oă) = 100us |
| 44 |
pop.w r2 ; 2 state |
| 45 |
andc.b #0x7f, ccr ; 2 state |
| 46 |
rts |
| 47 |
|
| 48 |
_verify_mem: |
| 49 |
push.w e4 ; 8 state |
| 50 |
push.w r4 ; 8 state |
| 51 |
push.w r5 ; 8 state |
| 52 |
mov.l #_eram_start,er3 ;# 83 *movsi_h8300hs/3 [length = 6] (16) |
| 53 |
mov.l #_eram_end,er2 ;# 85 *movsi_h8300hs/3 [length = 6] (12) |
| 54 |
sub.w r4,r4 |
| 55 |
mov.w @_memchk_ptn:32,r5 |
| 56 |
.vm1: |
| 57 |
mov.w @er3,e4 ;# 89 *movhi_h8300hs/5 [length = 2] |
| 58 |
cmp.w r5,e4 ;# 90 *cmphi_h8300hs_znvc/2 [length = 4] |
| 59 |
beq .vm2 ;# 91 branch_true [length = 2] |
| 60 |
mov.w #1,r4 |
| 61 |
.vm2: |
| 62 |
adds #2,er3 ;# 99 *addsi_h8300hs/1 [length = 2] |
| 63 |
cmp.l er2,er3 ;# 100 cmpsi/2 [length = 2] |
| 64 |
blo .vm1 ;# 101 branch_true [length = 2] |
| 65 |
mov.w r4, @_memchk_rslt |
| 66 |
pop.w r5 ; 2 state |
| 67 |
pop.w r4 ; 2 state |
| 68 |
pop.w e4 ; 2 state |
| 69 |
rts |
| 70 |
|
| 71 |
_verify_mem256K: |
| 72 |
push.w e4 ; 8 state |
| 73 |
push.w r4 ; 8 state |
| 74 |
push.w r5 ; 8 state |
| 75 |
mov.l @_memchk_start,er3 ;# 83 *movsi_h8300hs/3 [length = 6] (16) |
| 76 |
mov.l er3,er2 |
| 77 |
add.l #0x20000,er2 ; End address |
| 78 |
sub.w r4,r4 |
| 79 |
mov.w @_memchk_ptn:32,r5 |
| 80 |
.vm2k1: |
| 81 |
mov.w @er3,e4 ;# 89 *movhi_h8300hs/5 [length = 2] |
| 82 |
cmp.w r5,e4 ;# 90 *cmphi_h8300hs_znvc/2 [length = 4] |
| 83 |
beq .vm2k2 ;# 91 branch_true [length = 2] |
| 84 |
mov.w #1,r4 |
| 85 |
.vm2k2: |
| 86 |
adds #2,er3 ;# 99 *addsi_h8300hs/1 [length = 2] |
| 87 |
cmp.l er2,er3 ;# 100 cmpsi/2 [length = 2] |
| 88 |
blo .vm2k1 ;# 101 branch_true [length = 2] |
| 89 |
mov.w r4, @_memchk_rslt |
| 90 |
pop.w r5 ; 2 state |
| 91 |
pop.w r4 ; 2 state |
| 92 |
pop.w e4 ; 2 state |
| 93 |
rts |
| 94 |
|
| 95 |
.end |
| 96 |
|
| |