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

Subversion Repositories ssbcc

[/] [ssbcc/] [trunk/] [lib/] [9x8/] [tb/] [math/] [uc.s] - Blame information for rev 11

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 sinclairrf
; Copyright 2014, Sinclair R.F., Inc.
2
; Test bench for ../../math.s
3
 
4
.include math.s
5
 
6
.macro push16
7
.macro push24
8
.macro push32
9
 
10
.main
11
 
12
  ; Test u8 + u8 ==> u16
13
  0x7F 0x80
14
  0x7F 0x81
15
  0x80 0x7F
16
  0x80 0x80
17
  0x80 0x81
18
  0xFF 0x00
19
  0xFF 0x01
20
  0xFF 0x02
21
  0xFF 0xFE
22
  0xFF 0xFF
23
  ${10-1} :loop__u8_u8_u16 >r
24
    .call(out8,over)
25
    .call(out8,dup)
26
    .call(math__add_u8_u8_u16) .call(out16)
27
    .outstrobe(O_VALUE_DONE)
28
  r> .jumpc(loop__u8_u8_u16,1-) drop
29
 
30
  .push16(0x007F) 0x80
31
  .push16(0x007F) 0x81
32
  .push16(0x0080) 0x7F
33
  .push16(0x0080) 0x80
34
  .push16(0x0080) 0x81
35
  .push16(0x00FF) 0x00
36
  .push16(0x00FF) 0x01
37
  .push16(0x00FF) 0x02
38
  .push16(0x00FF) 0xFE
39
  .push16(0x00FF) 0xFF
40
  .push16(0x017F) 0x80
41
  .push16(0x017F) 0x81
42
  .push16(0x0180) 0x7F
43
  .push16(0x0180) 0x80
44
  .push16(0x0180) 0x81
45
  .push16(0x01FF) 0x00
46
  .push16(0x01FF) 0x01
47
  .push16(0x01FF) 0x02
48
  .push16(0x01FF) 0xFE
49
  .push16(0x01FF) 0xFF
50
  ${20-1} :loop__u16_u8_u16 >r
51
    >r over .call(out16,over)
52
    r> .call(out8,dup)
53
    .call(math__add_u16_u8_u16) .call(out16)
54
    .outstrobe(O_VALUE_DONE)
55
  r> .jumpc(loop__u16_u8_u16,1-) drop
56
 
57
  .push24(0x0001FF) 0xFF
58
  ${1-1} :loop__u24_u8_u24 >r
59
    >r .call(preserve_out24) r>
60
    .call(out8,dup)
61
    .call(math__add_u24_u8_u24)
62
    .call(out24)
63
    .outstrobe(O_VALUE_DONE)
64
  r> .jumpc(loop__u24_u8_u24,1-) drop
65
 
66
  .push24(0x0001FF) 0xFF
67
  ${1-1} :loop__u24_u8_u32 >r
68
    >r .call(preserve_out24) r>
69
    .call(out8,dup)
70
    .call(math__add_u24_u8_u32)
71
    .call(out32)
72
    .outstrobe(O_VALUE_DONE)
73
  r> .jumpc(loop__u24_u8_u32,1-) drop
74
 
75
  .push32(0x00800000) 0xFF
76
  ${1-1} :loop__u32_u8_u32 >r
77
    >r .call(preserve_out32) r>
78
    .call(out8,dup)
79
    .call(math__add_u32_u8_u32)
80
    .call(out32)
81
    .outstrobe(O_VALUE_DONE)
82
  r> .jumpc(loop__u32_u8_u32,1-) drop
83
 
84
  .push32(${0x00800000+0*1280*960*4}) .push24(${1280*960*4})
85
  .push32(${0x00800000+1*1280*960*4}) .push24(${1280*960*4})
86
  .push32(${0x00800000+2*1280*960*4}) .push24(${1280*960*4})
87
  .push32(${0x00800000+3*1280*960*4}) .push24(${1280*960*4})
88
  .push32(${0x00800000+4*1280*960*4}) .push24(${1280*960*4})
89
  ${5-1} :loop__u32_u24_u32 >r
90
    >r >r >r .call(preserve_out32) r> r> r>
91
    .call(preserve_out24)
92
    .call(math__add_u32_u24_u32)
93
    .call(out32)
94
    .outstrobe(O_VALUE_DONE)
95
  r> .jumpc(loop__u32_u24_u32,1-) drop
96
 
97
  .push32(${0x00800000+0*1280*960*4}) .push32(${1280*960*4})
98
  .push32(${0x00800000+1*1280*960*4}) .push32(${1280*960*4})
99
  .push32(${0x00800000+2*1280*960*4}) .push32(${1280*960*4})
100
  .push32(${0x00800000+3*1280*960*4}) .push32(${1280*960*4})
101
  .push32(${0x00800000+4*1280*960*4}) .push32(${1280*960*4})
102
  ${5-1} :loop__u32_u32_u32 >r
103
    >r >r >r >r .call(preserve_out32) r> r> r> r>
104
    .call(preserve_out32)
105
    .call(math__add_u32_u32_u32)
106
    .call(out32)
107
    .outstrobe(O_VALUE_DONE)
108
  r> .jumpc(loop__u32_u32_u32,1-) drop
109
 
110
  ; terminate and wait forever
111
  .outstrobe(O_TERMINATE) :infinite .jump(infinite)
112
 
113
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
114
;
115
; Routines to output results.
116
;
117
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
118
 
119
.function preserve_out24
120
 
121
  .outport(O_VALUE,>r)
122
  .outport(O_VALUE,>r)
123
  O_VALUE outport
124
  r> r>
125
  .return
126
 
127
.function preserve_out32
128
  .outport(O_VALUE,>r)
129
  .outport(O_VALUE,>r)
130
  .outport(O_VALUE,>r)
131
  O_VALUE outport
132
  r> r> r>
133
  .return
134
 
135
.function out8
136
 
137
 
138
.function out16
139
 
140
 
141
.function out24
142
 
143
 
144
.function out32
145
  ${4-1} :loop swap .outport(O_VALUE) .jumpc(loop,1-) drop
146
  .return

powered by: WebSVN 2.1.0

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