OpenCores
URL https://opencores.org/ocsvn/k68/k68/trunk

Subversion Repositories k68

[/] [k68/] [trunk/] [sw/] [misc/] [test.s] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 sybreon
        .data
2
 
3
        .align  2
4
        .text
5
_start: /*Start of Program*/
6
        bra     init
7
init:   /* Allocate Stack, Init Uarts, Say Hello */
8
        movel   #0x0000400, %a7
9
        bsr     init_uart
10
        bsr     sign_on
11
        bra     main
12
 
13
init_uart: /* Initialize Uarts */
14
 
15
        /* UART A BRG */
16
        movel   #0xFF010008, %a0
17
        moveb   #0x01, %a0@
18
        movel   #0xFF01000C, %a0
19
        moveb   #0x01, %a0@
20
 
21
        /* UART B BRG */
22
        movel   #0xFF020008, %a0
23
        moveb   #0x01, %a0@
24
        movel   #0xFF02000C, %a0
25
        moveb   #0x01, %a0@
26
 
27
        rts
28
 
29
stat_a: /* Check UART A readable status */
30
        movel   #0xFF010004, %a0
31
        moveb   %a0@, %d0
32
        andib   #1, %d0
33
        rts
34
 
35
read_a: /* Read a byte from UART A */
36
        bsr     stat_a
37
        beq     read_a
38
        movel   #0xFF010000, %a0
39
        moveb   %a0@, %d1
40
        rts
41
 
42
write_a:/* Write a byte to UART A */
43
        movel   #0xFF010004, %a0
44
write_a_loop:
45
        moveb   %a0@, %d0
46
        andib   #2, %d0
47
        bne     write_a_loop
48
        movel   #0xFF010000, %a0
49
        moveb   %d1, %a0@
50
        rts
51
 
52
stat_b: /* Check UART B readable status */
53
        movel   #0xFF020004, %a0
54
        moveb   %a0@, %d0
55
        andib   #1, %d0
56
        rts
57
 
58
read_b: /* Read a byte from UART B */
59
        bsr     stat_b
60
        beq     read_b
61
        movel   #0xFF020000, %a0
62
        moveb   %a0@, %d1
63
        rts
64
 
65
write_b:/* Write a byte to UART B */
66
        movel   #0xFF020004, %a0
67
write_b_loop:
68
        moveb   %a0@, %d0
69
        andib   #2, %d0
70
        beq     write_b_loop
71
        movel   #0xFF020000, %a0
72
        moveb   %d1, %a0@
73
        rts
74
 
75
sign_on:/* Say K68 on Both UARTS */
76
        moveb   #0x4B, %d1
77
        bsr     write_a
78
        bsr     write_b
79
        moveb   #0x36, %d1
80
        bsr     write_a
81
        bsr     write_b
82
        moveb   #0x68, %d1
83
        bsr     write_a
84
        bsr     write_b
85
        moveb   #0x0D, %d1
86
        bsr     write_a
87
        bsr     write_b
88
        rts
89
 
90
main:   /* Main Program Loop */
91
 
92
        /* Check for Data on A */
93
        bsr     stat_a
94
        beq     do_a
95
        bsr     stat_b
96
        beq     do_b
97
        bra     main
98
 
99
do_a:   /* Encrypt A and Write to B */
100
        bsr     read_a
101
        bsr     encrypt
102
        bsr     write_b
103
        rts
104
 
105
do_b:   /* Decrypt B and Write to A */
106
        bsr     read_b
107
        bsr     decrypt
108
        bsr     write_a
109
        rts
110
 
111
decrypt:/* Decrypt Data using DES */
112
        rts
113
 
114
encrypt:/* Encrypt Data using DES */
115
        rts
116
 
117
pushkey:/* Initialize DES Private Key */
118
        rts
119
        .end

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.