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

Subversion Repositories zipcpu

[/] [zipcpu/] [trunk/] [bench/] [asm/] [zipdhry.S] - Blame information for rev 66

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

Line No. Rev Author Line
1 50 dgisselq
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;
3
; Filename:     zipdhry.S
4
;
5
; Project:      Zip CPU -- a small, lightweight, RISC CPU soft core
6
;
7
; Purpose:      Zip assembly file for running the Dhrystone benchmark in the
8
;               Zip CPU.
9
;
10
; Creator:      Dan Gisselquist, Ph.D.
11
;               Gisselquist Tecnology, LLC
12
;
13
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
14
;
15
; Copyright (C) 2015, Gisselquist Technology, LLC
16
;
17
; This program is free software (firmware): you can redistribute it and/or
18
; modify it under the terms of  the GNU General Public License as published
19
; by the Free Software Foundation, either version 3 of the License, or (at
20
; your option) any later version.
21
;
22
; This program is distributed in the hope that it will be useful, but WITHOUT
23
; ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
24
; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
25
; for more details.
26
;
27
; License:      GPL, v3, as defined and found on www.gnu.org,
28
;               http://www.gnu.org/licenses/gpl.html
29
;
30
;
31
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
32
;
33 41 dgisselq
// Under Verilator:
34 57 dgisselq
//      DMIPS:          28.6    100 MHz (sim)   0.29
35
//
36
//
37
//   with no loop unrolling nor function inlining
38
//      DMIPS:          24.3    100 MHz (sim)   0.24
39
//   with packed strings
40
//      DMIPS:          35.6    100 MHz (sim)   0.36
41
//
42 41 dgisselq
// For comparison:
43
//      uBlaze:         255     177 MHz         1.44
44
//      LEON3                                   1.4
45
//      NiOS II:        218     185 MHz         1.16
46
//      OpenRisk        250     250 MHz         1.00
47
//      LM32                                    1.14
48
//      ZPU             2.6      50 MHz         0.05
49
//
50
 
51 57 dgisselq
// Some #def's to control compilation.
52
//
53
// SKIP_SHORT_CIRCUITS determines whether or not we do internal testing and
54
// jump to a BUSY instruction on failure for the debugger to pick up.  Skip
55
// this for valid testing.
56
//
57
// #define      SKIP_SHORT_CIRCUITS
58
//
59
// NO_INLINE controls whether or not we inline certain functions.  If you
60
// define this, nothing will be inlined.
61
// #define      NO_INLINE
62
//
63
// NO_LOOP_UNROLLING controls loop unrolling.  The default is to unroll loops
64
// by a factor of 4x.  By defining this, all loop unrolling is removed.
65 41 dgisselq
// #define      NO_LOOP_UNROLLING
66 57 dgisselq
//
67
// Use PSTRS has to deal with whether or not we are processing packed strings
68
// or normal strings.  Packed strings are really a cheaters exception to the
69
// dhrystone measure, although they do get our score up.
70
//
71
// #define      USE_PSTRS
72 41 dgisselq
        sys.ctr.mtask   equ     0xc0000008
73
// int main(int argc, char **argv) {
74
//      dhrystone();
75
// }
76
entry:
77
        MOV     top_of_stack(PC),uSP
78
        MOV     entry(PC),uR12
79
        ; Store  our tick counter in R1
80
        LDI     sys.ctr.mtask,R1
81
        ; And start with our counter cleared at zero
82
        CLR     R0
83
        STO     R0,(R1)
84
#ifdef  SUPERVISOR_TASK
85
        MOV     __HERE__+3(PC),R0
86
        STO     R0,1(SP)
87
        BRA     dhrystone
88
#else
89
        MOV     dhrystone(PC),uPC
90
        RTU
91
#endif
92
        ; Read the tick counter back out
93
        LOD     (R1),R0
94
        HALT    ; Stop the CPU--We're done!!!!!!!
95
 
96
// typedef      enum { Ident_1, Ident_2, Ident_3, Ident_4, Ident_5 } test_enum;
97
// typedef      enum { false, true } bool;
98
 
99
// typedef      int     Arr_1_Dim[50];
100
// typedef      int     Arr_2_Dim[50][50];
101 57 dgisselq
#ifdef  USE_PSTRS
102
#define RECSIZE 12
103
#else
104 41 dgisselq
#define RECSIZE 35
105 57 dgisselq
#endif
106 41 dgisselq
#define NUMBER_OF_RUNS  (512)
107
        ptr_comp                        equ     0
108
        discr                           equ     1
109
        variant.var_1.enum_comp         equ     2
110
        variant.var_1.int_comp          equ     3
111
        variant.var_1.str_comp          equ     4
112
 
113
gbl_arr_1:
114
        fill    50,0
115
gbl_arr_2:
116
        fill    2500,0
117
gbl_ch:
118
        word    0
119
gbl_ch_2:
120
        word    0
121
gbl_bool:
122
        word    0
123
gbl_int:
124
        word    0
125
gbl_ptr:
126
        word    0
127
// Arr_1_Dim    gbl_arr_1;
128
// Arr_2_Dim    gbl_arr_2;
129
// char gbl_ch, gbl_ch_2;
130
// bool gbl_bool;
131
// int  gbl_int;
132
// RECP gbl_ptr;
133
 
134
//char  *lcl_strcpy(char *d, char *s) {
135
//      char    *cpd = d, ch;
136
//
137
//      do{
138
//              *cpd++ = ch = *s++;
139
//      } while(ch);
140
//
141
//}
142
//
143
lcl_strcpy:
144
        ; R0 = d
145
        ; R1 = s
146
        ; R3 = ch
147 57 dgisselq
copy_next_char:
148 41 dgisselq
#ifdef  NO_LOOP_UNROLLING
149
        LOD     (R1),R2
150
        STO     R2,(R0)
151 57 dgisselq
#ifdef  USE_PSTRS
152
        TST     255,R2
153
#else
154
        CMP     0,R2
155
#endif
156
        RETN.Z
157 41 dgisselq
        ADD     1,R0
158
        ADD     1,R1
159 57 dgisselq
        BRA     copy_next_char
160
 
161
 
162
 
163 41 dgisselq
#else
164
        LOD     (R1),R2
165 57 dgisselq
        STO     R2,(R0)
166
#ifdef  USE_PSTRS
167
        TST     255,R2
168
#else
169 41 dgisselq
        CMP     0,R2
170 57 dgisselq
#endif
171
        ; BZ    lcl_strcpy_end_of_loop
172
        RETN.Z
173 41 dgisselq
        LOD     1(R1),R2
174 57 dgisselq
        STO     R2,1(R0)
175
#ifdef  USE_PSTRS
176
        TST     255,R2
177
#else
178 41 dgisselq
        CMP     0,R2
179 57 dgisselq
#endif
180
        ; BZ    lcl_strcpy_end_of_loop
181
        RETN.Z
182 41 dgisselq
        LOD     2(R1),R2
183 57 dgisselq
        STO     R2,2(R0)
184
#ifdef  USE_PSTRS
185
        TST     255,R2
186
#else
187 41 dgisselq
        CMP     0,R2
188 57 dgisselq
#endif
189
        ; BZ    lcl_strcpy_end_of_loop
190
        RETN.Z
191 41 dgisselq
        LOD     3(R1),R2
192 57 dgisselq
        STO     R2,3(R0)
193
        ; BZ    lcl_strcpy_end_of_loop
194
#ifdef  USE_PSTRS
195
        TST     255,R2
196
#else
197 41 dgisselq
        CMP     0,R2
198 57 dgisselq
#endif
199
        RETN.Z
200 41 dgisselq
        ADD     4,R0
201
        ADD     4,R1
202 57 dgisselq
        BRA     copy_next_char
203 41 dgisselq
#endif
204
 
205
//int   lcl_strcmp(char *s1, char *s2) {
206
//      char    a, b;
207
//      do {
208
//              a = *s1++; b = *s2++;
209
//      } while((a)&&(a==b));
210
//
211
//      return a-b;
212
//}
213
 
214
lcl_strcmp:
215
        SUB     1,SP
216
        STO     R3,1(SP)
217
 
218
strcmp_top_of_loop:
219
#ifdef  NO_LOOP_UNROLLING
220 57 dgisselq
        ; LOD   (R0),R2
221
        ; LOD   (R1),R3                 ; Alternate approach:
222 41 dgisselq
        ; CMP   R2,R3                   ;       CMP     0,R2
223
        ; BNZ   strcmp_end_loop         ;       BZ      strcmp_end_loop
224
        ; CMP   0,R2                    ;       CMP     R2,R3
225
        ; BZ    strcmp_end_loop         ;       BZ      strcmp_top_of_loop
226
        ; CMP   0,R3                    ;
227
        ; BZ    strcmp_end_loop         ;
228
        ; ADD   1,R0
229
        ; ADD   1,R1
230
        ; BRA   strcmp_top_of_loop
231
        LOD     (R0),R2
232
        LOD     (R1),R3
233 57 dgisselq
#ifdef  USE_PSTRS
234
        TST     255,R2
235
#else
236 41 dgisselq
        CMP     0,R2
237 57 dgisselq
#endif
238 41 dgisselq
        BZ      strcmp_end_loop
239 57 dgisselq
        ADD     1,R0
240
        ADD     1,R1
241 41 dgisselq
        CMP     R2,R3
242
        BZ      strcmp_top_of_loop
243
#else
244
        LOD     (R0),R2
245
        LOD     (R1),R3
246 57 dgisselq
#ifdef  USE_PSTRS
247
        TST     255,R2
248
#else
249 41 dgisselq
        CMP     0,R2
250 57 dgisselq
#endif
251 41 dgisselq
        BZ      strcmp_end_loop
252
        CMP     R2,R3
253
        BNZ     strcmp_end_loop
254
        LOD     1(R0),R2
255
        LOD     1(R1),R3
256 57 dgisselq
#ifdef  USE_PSTRS
257
        TST     255,R2
258
#else
259 41 dgisselq
        CMP     0,R2
260 57 dgisselq
#endif
261 41 dgisselq
        BZ      strcmp_end_loop
262
        CMP     R2,R3
263
        BNZ     strcmp_end_loop
264
        LOD     2(R0),R2
265
        LOD     2(R1),R3
266 57 dgisselq
#ifdef  USE_PSTRS
267
        TST     255,R2
268
#else
269 41 dgisselq
        CMP     0,R2
270 57 dgisselq
#endif
271 41 dgisselq
        BZ      strcmp_end_loop
272
        CMP     R2,R3
273
        BNZ     strcmp_end_loop
274
        LOD     3(R0),R2
275
        LOD     3(R1),R3
276 57 dgisselq
#ifdef  USE_PSTRS
277
        TST     255,R2
278
#else
279 41 dgisselq
        CMP     0,R2
280 57 dgisselq
#endif
281 41 dgisselq
        BZ      strcmp_end_loop
282
        CMP     R2,R3
283
        BNZ     strcmp_end_loop
284
        ADD     4,R0
285
        ADD     4,R1
286
        BRA     strcmp_top_of_loop
287
#endif
288
 
289
strcmp_end_loop:
290
        SUB     R3,R2
291
        MOV     R2,R0
292
 
293
        LOD     1(SP),R3
294
        ADD     1,SP
295
        RETN
296
 
297
 
298
//test_enum     func_1(char ch_1, char ch_2) {
299
//      char    lcl_ch_1, lcl_ch_2;
300
//
301
//      lcl_ch_1 = ch_1;
302
//      lcl_ch_2 = lcl_ch_1;
303
//      if (lcl_ch_2 != ch_2)
304
//              return 0;
305
//      else {
306
//              gbl_ch = lcl_ch_1;
307
//              return 1;
308
//      }
309
 
310
#ifdef  NO_INLINE
311
func_1:
312
        ; On input,
313
        ; R0 = ch_1
314
        ; R1 = ch_2
315
        ; R2 = available
316
        ; On output, R0 is our return value
317
 
318
        MOV     R0,R2
319
        CMP     R2,R1
320
        CLR.NZ  R0
321
        STO.Z   R2,gbl_ch(R12)
322
        LDILO.Z 1,R0
323
        RETN
324
#endif
325
 
326
//bool  func_2(char *str_1, char *str_2) {
327
//      int     lcl_int;
328
//      char    lcl_ch;
329
//
330
//      lcl_int = 2;
331
//      while(lcl_int <= 2) {
332
//              if (func_1(str_1[lcl_int], str_2[lcl_int+1])==0) {
333
//                      lcl_ch = 'A';
334
//                      lcl_int ++;
335
//              }
336
//      }
337
//
338
//      if ((lcl_ch >= 'W')&&(lcl_ch < 'Z'))
339
//              lcl_int = 7;
340
//      if (lcl_ch == 'R')
341
//              return true;
342
//      else {
343
//              if (lcl_strcmp(str_1, str_2)>0) {
344
//                      lcl_int += 7;
345
//                      gbl_int = lcl_int;
346
//              } else
347
//                      return false;
348
//      }
349
//}
350
func_2:
351
        ;
352
        SUB     6,SP
353
        STO     R3,2(SP)
354
        STO     R4,3(SP)
355
        STO     R5,4(SP)
356
        STO     R6,5(SP)
357
        STO     R7,6(SP)
358
 
359
        MOV     R0,R3   ; R3 = str_1
360
        MOV     R1,R4   ; R4 = str_2
361
        LDI     2,R5    ; R5 = lcl_int
362
        LDI     'A',R7  ; R7 = lcl_ch
363
func_2_while_loop:
364
        CMP     2,R5
365
        BGT     func_2_end_while_loop
366
func_2_top_while_loop:
367
        MOV     R3,R6
368
        ADD     R5,R6
369
 
370
#ifdef  NO_INLINE
371
        LOD     (R6),R0
372
        MOV     R4,R6
373
        ADD     R5,R6
374
        LOD     1(R6),R1
375
 
376
        MOV     __HERE__+3(PC),R2
377
        STO     R2,1(SP)
378
        BRA     func_1
379
 
380
        CMP     0,R0
381
        ADD.Z   1,R5
382 57 dgisselq
#ifndef SKIP_SHORT_CIRCUITS
383
        BUSY.NZ
384
#endif
385 41 dgisselq
#else
386
        LOD     (R6),R2
387
        MOV     R4,R6
388
        ADD     R5,R6
389
        LOD     1(R6),R1
390
 
391
        CMP     R2,R1
392
        STO.Z   R2,gbl_ch(R12)
393
        LDILO.Z 1,R0
394
 
395
        ADD.NZ  1,R5
396 57 dgisselq
#ifndef SKIP_SHORT_CIRCUITS
397
        BUSY.Z
398 41 dgisselq
#endif
399 57 dgisselq
#endif
400 41 dgisselq
 
401
        CMP     3,R5
402
#ifndef SKIP_SHORT_CIRCUITS
403
        BUSY.LT
404
#endif
405
        BLT     func_2_top_while_loop
406
 
407
func_2_end_while_loop:
408
 
409
        // CMP  'W',R7                  // BUT! We know lcl_ch='A'
410
        // BLT  skip_if                 // So we can skip this
411
        // CMP  'Z',R7                  // entire  section
412
        // LDI.LT       7,R5
413
        // CMP  'R',R7
414
        // BNZ alt_if_case
415
        // LLO.Z        1,R0
416
        // BRA  func_2_return_and_cleanup
417
        //
418
        MOV     R3,R0
419
        MOV     R4,R1
420
        MOV     __HERE__+3(PC),R2
421
        STO     R2,1(SP)
422
        BRA     lcl_strcmp
423
        CMP     0,R0
424
        BGT     func_2_final_then
425
        CLR     R0
426
        BRA     func_2_return_and_cleanup
427
func_2_final_then:
428
        // ADD  7,R5            ; Never read, so useless code
429
        LDI     1,R0
430
#ifndef SKIP_SHORT_CIRCUITS
431
        BUSY
432
#endif
433
func_2_return_and_cleanup:
434
 
435
        LOD     2(SP),R3
436
        LOD     3(SP),R4
437
        LOD     4(SP),R5
438
        LOD     5(SP),R6
439
        LOD     6(SP),R7
440
        ADD     6,SP
441
        RETN
442
 
443
//bool  func_3(test_enum a) {
444
//      test_enum       lcl_enum;
445
//
446
//      lcl_enum = a;
447
//      if (lcl_enum == Ident_3)
448
//              return true;
449
//      else
450
//              return false;
451
//}
452
 
453
#ifdef  NO_INLINE
454
func_3:
455
        ; On entry,
456
        ;  R0 = a
457
        ;  R1 - available
458
        CMP     2,R0
459
        CLR             R0      ; CLR Doesn't set flags
460
        LDILO.Z         1,R0
461
        RETN
462
#endif
463
 
464
 
465
// void proc_6(test_enum ev, test_enum *ep) {
466
//      *ep = ev;
467
//      if (!func_3(ev))
468
//              *ep = 3;
469
//      switch(ev) {
470
//              case 0: *ep = 0; break;
471
//              case 1:
472
//                      if (gbl_int > 100)
473
//                              *ep = 0;
474
//                      else
475
//                              *ep = 3;
476
//                      break;
477
//              case 2:
478
//                      *ep = 1;
479
//                      break;
480
//              case 3:
481
//                      break;
482
//              case 4:
483
//                      *ep = 2;
484
//      }
485
//}
486
 
487
proc_6:
488
        ; On entry:
489
        ;       R0 = ev
490
        ;       R1 = ep
491
        ;       R2 - unassigned
492
        ; Since we call func_3, we have to reserve R0 and R1
493
        ; for other purposes.  Thus
494
        ;       R2 = ev
495
        ;       R3 = ep
496
        SUB     2,SP
497
        STO     R3,2(SP)
498
 
499
        MOV     R1,R3
500
        MOV     R0,R2
501
        ; *ep = ev
502
        STO     R0,(R1)
503
#ifndef SKIP_SHORT_CIRCUITS
504
        CMP     2,R0
505
        BUSY.NZ
506
#endif
507
 
508
#ifdef  NO_INLINE
509
        ; !func_3(ev)
510
        MOV     __HERE__+3(PC),R1
511
        STO     R1,1(SP)
512
        BRA     func_3
513
 
514
        TST     -1,R0
515
        LDI     3,R1
516
        STO.Z   R1,(R3)
517
#else
518
        CMP             2,R0
519
        LDI     3,R1
520
        STO.Z   R1,(R3)
521
#endif
522
 
523
        TST     -1,R0
524
        LDI     3,R1
525
#ifndef SKIP_SHORT_CIRCUITS
526
        BUSY.Z
527
#endif
528
        STO.Z   R1,(R3)
529
 
530
#ifndef SKIP_SHORT_CIRCUITS
531
        CMP     2,R2
532
        BUSY.NZ
533
#endif
534
        CMP     0,R2
535
        BNZ     proc_6_case_not_zero
536
#ifndef SKIP_SHORT_CIRCUITS
537
        BUSY
538
#endif
539
        LDI     0,R1
540
        STO     R1,(R3)
541
        BRA     proc_6_end_of_case
542
proc_6_case_not_zero:
543
        CMP     1,R2
544
        BNZ     proc_6_case_not_one
545
#ifndef SKIP_SHORT_CIRCUITS
546
        BUSY
547
#endif
548
        LDI     3,R0
549
        LOD     gbl_int(R12),R1
550
        CMP     100,R1
551
        CLR.GT  R0
552
        STO     R0,(R3)
553
        BRA     proc_6_end_of_case
554
proc_6_case_not_one:
555
        CMP     2,R2
556
        BNZ     proc_6_case_not_two
557
        LDI     1,R1                            // Executed, if done properly
558
        STO     R1,(R3)
559
        BRA     proc_6_end_of_case
560
proc_6_case_not_two:
561
#ifndef SKIP_SHORT_CIRCUITS
562
        BUSY
563
#endif
564
        CMP     4,R2
565
        BNZ     proc_6_case_not_four
566
        LDI     2,R1
567
        STO     R1,(R3)
568
        // BRA  proc_6_end_of_case
569
proc_6_case_not_four:
570
proc_6_end_of_case:
571
        LOD     2(SP),R3
572
        ADD     2,SP
573
        RETN
574
 
575
// void proc_7(int a, int b, int *c) {
576
//      int     lcl;
577
//
578
//      lcl = a + 2;
579
//      *c = b + a;
580
//}
581
 
582
#ifdef  NO_INLINE
583
proc_7:
584
        ADD 2+R0,R1
585
        STO R1,(R2)
586
 
587
        RETN
588
#endif
589
 
590
//      int     a[50];
591
//      int     b[50][50];
592
//
593
// void proc_8(Arr_1_Dim a, Arr_2_Dim b, int c, int d) {
594
//      int     idx, loc;
595
//
596
//      loc = c+5;
597
//      a[loc] = d;
598
//      a[loc+1] = a[loc];
599
//      a[loc+30] = loc;
600
//      for(idx=loc; idx<= loc+1; idx++)
601
//              b[loc][idx] = loc;
602
//      b[loc][loc-1] += 1;
603
//      b[loc+20][loc] = a[loc];
604
//      gbl_int = 5;
605
//}
606
proc_8:
607
        ; R0 = a
608
        ; R1 = b
609
        ; R2 = c
610
        ; R3 = d
611
        ; R4 - unassigned
612
        ; Makes no function/procedure calls, so these can keep
613
        ; R2 = loc = c+5, replaces c
614
        ; R4 = idx
615
        SUB     2,SP
616
        STO     R5,1(SP)
617
        STO     R6,2(SP)
618
 
619
        ADD     5,R2    ; loc = c+5
620
        MOV     R0,R5
621
        ADD     R2,R5
622
        STO     R3,(R5)
623
        STO     R3,1(R5)
624
        STO     R2,30(R5)
625
        MOV     R2,R5
626
        MPYU    50,R5   ; R5 = 50 * R2 = 50 * loc
627
        ADD     R1,R5   ; R5 = &b[loc][0]
628
        MOV     R5,R6   ; R6 = &b[loc][0]
629
        ADD     R2,R5   ; R5 = &b[loc][loc]
630
        MOV     R2,R4   ; R4 = loc = index
631
proc_8_top_of_loop:
632
        CMP     1(R2),R4
633
        BGT     proc_8_end_of_loop
634
proc_8_loop_after_condition:
635
        STO     R2,(R5)
636
        ADD     1,R5
637
        ADD     1,R4
638
        CMP     2(R2),R4
639
        BLT     proc_8_loop_after_condition
640
proc_8_end_of_loop:
641
 
642
        ; b[loc][loc-1] += 1
643
        ADD     R2,R6           ; R6 = &b[loc][loc]
644
        LOD     -1(R6),R5
645
        ADD     1,R5
646
        STO     R5,-1(R6)
647
        ; b[loc+20][loc] = a[loc]
648
        MOV     R0,R4
649
        ADD     R2,R4
650
        LOD     (R4),R3
651
        STO     R3,20*50(R6)
652
        LDI     5,R3
653
        STO     R3,gbl_int(R12)
654
 
655
        LOD     1(SP),R5
656
        LOD     2(SP),R6
657
        ADD     2,SP
658
        RETN
659
 
660
// void proc_5(void) {
661
//      gbl_ch = 'A';
662
//      gbl_bool = false;
663
//}
664
#ifdef  NO_INLINE
665
proc_5:
666
        LDI     'A',R0
667
        STO     R0,gbl_ch(R12)
668
        CLR     R0
669
        STO     R0,gbl_bool(R12)
670
        ;
671
        RETN
672
#endif
673
 
674
// void proc_4(void) {
675
//      bool    lcl_bool;
676
//      lcl_bool = (gbl_ch == 'A');
677
//      gbl_ch_2 = 'B';
678
// }
679
#ifdef  NO_INLINE
680
proc_4:
681
        //
682
        ; LDI   GBL,R12 // Already in R12
683
        ; Setting lcl_bool is irrelevant, so the optimizer should remove it.
684
        ; R0 doesn't need to be saved, since it's already trashed by the
685
        ; subroutine call.
686
        ;
687
        ; LOD   gbl_ch(R12),R0
688
        ; CLR   R1
689
        ; CMP   'A',R0
690
        ; ADD.Z 1,R1
691
        ;
692
        LDI     'B',R0
693
        STO     R0,gbl_ch_2(R12)
694
        ;
695
        RETN
696
#endif
697
 
698
// void proc_3(RECP *a) {
699
//      if (gbl_ptr != NULL)
700
//              *a = gbl_ptr->ptr_comp;
701
//      proc_7(10,gbl_int, &gbl_ptr->variant.var_1.int_comp); // ??
702
//}
703
proc_3:
704
        SUB     3,SP
705
        STO     R3,2(SP)
706
        STO     R2,3(SP)
707
        ; Save one for the return address from our JSR "instruction"
708
        ;
709
        LOD     gbl_ptr(R12),R2
710
        TST     -1,R2
711
#ifndef SKIP_SHORT_CIRCUITS
712
        BUSY.Z
713
#endif
714
        LOD.NZ  ptr_comp(R2),R3
715
        STO.NZ  R3,(R0)
716
#ifdef  NO_INLINE
717
        LDI     10,R0
718
        LOD     gbl_int(R12),R1
719
        MOV     variant.var_1.int_comp(R2),R2
720
        MOV     __HERE__+3(PC),R3
721
        STO     R3,1(SP)
722
        BRA     proc_7
723
#else
724
        LOD     gbl_int(R12),R1
725
        ADD      12,R1
726
        STO      R1,variant.var_1.int_comp(R2)
727
#endif
728
        ;
729
        LOD     2(SP),R3
730
        LOD     3(SP),R2
731
        ADD     3,SP
732
        RETN
733
 
734
 
735
// void proc_2(int *a) {
736
//      int             lcl_int;
737
//      test_enum       lcl_enum;
738
//
739
//      lcl_int = *a + 10;
740
//      do {
741
//              if (gbl_ch == 'A') {
742
//                      lcl_int -= 1;
743
//                      *a = lcl_int - gbl_int;
744
//                      lcl_enum = Ident_1;
745
//              }
746
//      } while(lcl_enum != Ident_1);
747
//}
748
proc_2:
749
        SUB     5,SP
750
        STO     R6,1(SP)
751
        STO     R5,2(SP)
752
        STO     R4,3(SP)
753
        STO     R3,4(SP)
754
        STO     R2,5(SP)
755
        // R1 doesn't need to be stored, it was used in the subroutine
756
        // call calculation
757
 
758
        LOD     (R0),R1
759
        MOV     10(R1),R2       ; R2 = lcl_int
760
        LOD     gbl_ch(R12),R4  ; R4 = gbl_ch
761
#ifdef  NO_CHEATING
762
proc_2_loop:
763
        CMP     'A',R4
764
        SUB.Z   1,R2
765
        LOD.Z   gbl_int(R12),R5 ; R5 = gbl_int
766
        MOV.Z   R2,R6           ; R6 = lcl_int
767
        SUB.Z   R5,R6           ; lcl_int - gbl_int
768
        STO.Z   R6,(R0)         ; *a = R6
769
        CLR.Z   R3              ; lcl_enum = 0
770
// #ifndef      SKIP_SHORT_CIRCUITS
771
        // BUSY.NZ
772
// #endif
773
 
774
        TST     -1,R3
775
// #ifndef      SKIP_SHORT_CIRCUITS
776
        // BUSY.NZ
777
// #endif
778
        BNZ     proc_2_loop
779
#else
780
        LOD     gbl_int(R12),R5
781
        SUB     1(R5),R2
782
        STO     R2,(R0)
783
#endif
784
        ;
785
        LOD     1(SP),R6
786
        LOD     2(SP),R5
787
        LOD     3(SP),R4
788
        LOD     4(SP),R3
789
        LOD     5(SP),R2
790
        ADD     5,SP
791
        RETN
792
 
793
//void  proc_1 (RECP a) {
794
//      RECP    nxt = a->ptr_comp;
795
//
796
//      // structassign(a->ptr_comp, gbl_ptr);
797
//      *(a->ptr_comp) = *(gbl_ptr);
798
//
799
//      a->variant.var_1.int_comp = 5;
800
//      nxt->variant.var_1.int_comp = a->variant.var_1.int_comp;
801
//      proc_3(&nxt->ptr_comp);
802
//
803
//      if (nxt->discr == 0) {
804
//              nxt->variant.var_1.int_comp = 6;
805
//              proc_6(a->variant.var_1.enum_comp, &nxt->variant.var_1.enum_comp);
806
//              nxt->ptr_comp = gbl_ptr->ptr_comp;
807
//              proc_7(nxt->variant.var_1.int_comp, 10, &nxt->variant.var_1.int_comp);
808
//      } else
809
//              // structassign(a, a->ptr_comp);
810
//              *a = *(a->ptr_comp);
811
//}
812
proc_1:
813
        SUB     9,SP
814
        STO     R2,2(SP)
815
        STO     R3,3(SP)
816
        STO     R4,4(SP)
817
        STO     R5,5(SP)
818
        STO     R6,6(SP)
819
        STO     R7,7(SP)
820
        STO     R8,8(SP)
821
        STO     R9,9(SP)
822
 
823
        ; R9 = a
824
        ; R4 = nxt
825
        ; R12 = GBL
826
        ; R13 = SP
827
        MOV     R0,R9
828
        LOD     ptr_comp(R9),R4
829
#ifndef SKIP_SHORT_CIRCUITS
830
        TST     -1,R4
831
        BUSY.Z
832
#endif
833
        LDI     35,R5
834
        MOV     R9,R6
835
        LOD     gbl_ptr(R12),R7
836
proc_1_assign_loop_1:
837
        LOD     (R6),R8
838
        ADD     1,R6
839
        STO     R8,(R7)
840
        ADD     1,R7
841
        SUB     1,R5
842
        BNZ     proc_1_assign_loop_1;
843
 
844
#ifndef SKIP_SHORT_CIRCUITS
845
        LOD     gbl_ptr(R12),R2
846
        TST     -1,R2
847
        BUSY.Z
848
#endif
849
 
850
        LDI     5,R5
851
        STO     R5,variant.var_1.int_comp(R9)
852
        STO     R5,variant.var_1.int_comp(R4)
853
        MOV     ptr_comp(R4),R0
854
        MOV     __HERE__+3(PC),R1
855
        STO     R1,1(SP)
856
        BRA     proc_3          ; Uses R0 and R1
857
 
858
        LOD     discr(R4),R5
859
        CMP     0,R5
860
        BNZ     proc_1_last_struct_assign
861
        ; This is the juncture that is "supposed" to be taken
862
        LDI     6,R5
863
 
864
        STO     R5,variant.var_1.int_comp(R4)
865
        LOD     variant.var_1.enum_comp(R9), R0
866
#ifndef SKIP_SHORT_CIRCUITS
867
        CMP     2,R0
868
        BUSY.NZ
869
#endif
870
        MOV     variant.var_1.enum_comp+R4, R1
871
        MOV     __HERE__+3(PC),R2
872
        STO     R2,1(SP)
873
        BRA     proc_6
874
        ;
875
        LOD     gbl_ptr(R12),R5
876
        LOD     ptr_comp(R5),R5
877
        STO     R5,ptr_comp(R4)
878
        ;
879
#ifdef  NO_INLINE
880
        LOD     variant.var_1.int_comp(R4),R0
881
        LDI     10,R1
882
        MOV     variant.var_1.int_comp(R4),R2
883
        MOV     proc_1_return_closeout(PC),R3
884
        STO     R3,1(SP)
885
        BRA     proc_7
886
#else
887
        LOD     variant.var_1.int_comp(R4),R0
888
        ADD     12,R0
889
        STO     R0,variant.var_1.int_comp(R4)
890
        BRA     proc_1_return_closeout
891
#endif
892
        ;
893
proc_1_last_struct_assign:
894
#ifndef SKIP_SHORT_CIRCUITS
895
        BUSY
896
#endif
897
        LDI     35,R4
898
        MOV     R2,R5
899
        LOD     gbl_ptr(R12),R6
900
proc_1_assign_loop_2:
901
        LOD     (R6),R8
902
        STO     R8,(R7)
903
        ADD     1,R6
904
        ADD     1,R7
905
        SUB     1,R5
906
        BNZ     proc_1_assign_loop_2
907
        //
908
proc_1_return_closeout:
909
        //
910
        LOD     2(SP),R2
911
        LOD     3(SP),R3
912
        LOD     4(SP),R4
913
        LOD     5(SP),R5
914
        LOD     6(SP),R6
915
        LOD     7(SP),R7
916
        LOD     8(SP),R8
917
        LOD     9(SP),R9
918
        ADD     9,SP
919
        RETN
920
 
921
// void dhrystone(void) {
922
//      int     lcl_int_1, lcl_int_2, lcl_int_3, index, number_of_runs = 500;
923
//      test_enum       lcl_enum;
924
//      char    lcl_str_1[30], lcl_str_2[30], ch_index;
925
//      REC_T   a, b, *nxt = &a;
926
//
927
//      gbl_ptr = &b;
928
//      gbl_ptr->ptr_comp = nxt;
929
//      gbl_ptr->variant.var_1.enum_comp = 2;
930
//      gbl_ptr->variant.var_1.int_comp = 40;
931
//      lcl_strcpy(gbl_ptr->variant.var_1.str_comp, "DHRYSTONE PROGRAM, SOME STRING");
932
//      lcl_strcpy(lcl_str_1, "DHRYSTONE PROGRAM, 1\'ST STRING");
933
//
934
//      gbl_arr_2[8][7] = 10;
935
//
936
//      for(index=0; index < number_of_runs; index++) {
937
//              proc_5();
938
//              proc_4();
939
//              lcl_int_1 = 2;
940
//              lcl_int_2 = 3;
941
//              lcl_strcpy(lcl_str_2, "DHRYSTONE PROGRAM, 2\'ND STRING");
942
//              lcl_enum = Ident_2;
943
//              gbl_bool = !func_2(lcl_str_1, lcl_str_2);
944
//              while(lcl_int_1 < lcl_int_2) {
945
//                      lcl_int_3 = 5 * lcl_int_1 - lcl_int_2;
946
//                      proc_7(lcl_int_1, lcl_int_2, &lcl_int_3);
947
//                      lcl_int_1 += 1;
948
//              }
949
//
950
//              proc_8(gbl_arr_1, gbl_arr_2, lcl_int_1, lcl_int_3);
951
//              proc_1(gbl_ptr);
952
//
953
//              for(ch_index='A'; ch_index <= gbl_ch_2; ch_index++) {
954
//                      if (lcl_enum == func_1(ch_index, 'C')) {
955
//                              // Then not executed??
956
//                              proc_6(0, &lcl_enum);
957
//                              lcl_strcpy(lcl_str_2, "DHRYSTONE PROGRAM, 3\'RD STRING");
958
//                              lcl_int_2 = index;
959
//                              gbl_int = index;
960
//                      }
961
//              }
962
//
963
//              lcl_int_2 = lcl_int_2 * lcl_int_1;
964
//              lcl_int_1 = lcl_int_2 / lcl_int_3;
965
//              lcl_int_2 = 7 * ( lcl_int_2 - lcl_int_3) - lcl_int_1;
966
//              proc_2(&lcl_int_1);
967
//      }
968
//}
969
 
970
some_string:
971 57 dgisselq
#ifdef  USE_PSTRS
972
        word    'DHRY','STON','E PR','OGRA','M, S','OME '
973
        word    'STRI','NG\0\0'
974
#else
975 41 dgisselq
        word    'D','H','R','Y','S','T','O','N','E',' '
976
        word    'P','R','O','G','R','A','M',',',' '
977
        word    'S','O','M','E',' ','S','T','R','I','N','G'
978
        word    0
979 57 dgisselq
#endif
980 41 dgisselq
 
981
first_string:
982 57 dgisselq
#ifdef  USE_PSTRS
983
        word    'DHRY','STON','E PR','OGRA'
984
        word    'M, 1','\'ST ','STRI','NG\0\0'
985
#else
986 41 dgisselq
        word    'D','H','R','Y','S','T','O','N','E',' '
987
        word    'P','R','O','G','R','A','M',','
988
        word    ' ','1','\'','S','T'
989
        word    ' ','S','T','R','I','N','G'
990
        word    0
991 57 dgisselq
#endif
992 41 dgisselq
 
993
second_string:
994 57 dgisselq
#ifdef  USE_PSTRS
995
        word    'DHRY','STON','E PR','OGRA'
996
        word    'M, 2','\'ND ','STRI','NG\0\0'
997
#else
998 41 dgisselq
        word    'D','H','R','Y','S','T','O','N','E',' '
999
        word    'P','R','O','G','R','A','M',',',' '
1000
        word    '2','\'','N','D',' ','S','T','R','I','N','G'
1001
        word    0
1002 57 dgisselq
#endif
1003 41 dgisselq
 
1004
third_string:
1005 57 dgisselq
#ifdef  USE_PSTRS
1006
        word    'DHRY','STON','E PR','OGRA'
1007
        word    'M, 3','\'RD ','STRI','NG\0\0'
1008
#else
1009 41 dgisselq
        word    'D','H','R','Y','S','T','O','N','E',' '
1010
        word    'P','R','O','G','R','A','M',',',' '
1011
        word    '3','\'','R','D',' ','S','T','R','I','N','G'
1012
        word    0
1013 57 dgisselq
#endif
1014 41 dgisselq
 
1015
dhrystone:
1016
#ifdef  SUPERVISOR_TASK
1017
        SUB     12+RECSIZE+RECSIZE+30+30+3,SP
1018
        ; Leave a space on the top of the stack for calling
1019
        ; subroutines.
1020
        STO     R1,2(SP)
1021
        STO     R2,3(SP)
1022
        STO     R3,4(SP)
1023
        STO     R4,5(SP)
1024
        STO     R5,6(SP)
1025
        STO     R6,7(SP)
1026
        STO     R7,8(SP)
1027
        STO     R8,9(SP)
1028
        STO     R9,10(SP)
1029
        STO     R10,11(SP)
1030
        STO     R11,12(SP)
1031
        lcl_int_1       equ     12                      ; plus SP
1032
#else
1033
        lcl_int_1       equ     2                       ; plus SP
1034
        SUB     2+RECSIZE+RECSIZE+30+30+3,SP
1035
#endif
1036
        // 12 is the global variable pointer
1037
        // 13 is our stack
1038
        // 14 is our condition code register
1039
        // 15 is the program counter
1040
        ;
1041
        lcl_int_3       equ     lcl_int_1+1             ; plus SP
1042
        lcl_enum        equ     lcl_int_3+1             ; plus SP
1043
        lcl_str_1       equ     lcl_enum+1              ; plus SP
1044
        lcl_str_2       equ     lcl_str_1+30            ; plus SP
1045
        rec_a           equ     lcl_str_2+30            ; plus SP
1046
        rec_b           equ     rec_a+RECSIZE           ; plus SP
1047
 
1048
//      int     lcl_int_1, lcl_int_2, lcl_int_3, index, number_of_runs = 500;
1049
//      test_enum       lcl_enum;
1050
//      char    lcl_str_1[30], lcl_str_2[30], ch_index;
1051
//      REC_T   a, b, *nxt = &a;
1052
//
1053
//      gbl_ptr = &b;
1054
        MOV     rec_b(SP),R0            ; R0 = &b
1055
        STO     R0,gbl_ptr(PC)
1056
//      gbl_ptr->ptr_comp = nxt;
1057
        MOV     rec_a(SP),R1            ; R1 = &a = nxt
1058
        STO     R1,ptr_comp(R0)         ; gbp_ptr->ptr.comp=b->ptr.comp=R1=nxt
1059
//      gbl_ptr->variant.var_1.enum_comp = 2;
1060
        LDI     2,R2
1061
        STO     R2,variant.var_1.enum_comp(R0)
1062
//      gbl_ptr->variant.var_1.int_comp = 40;
1063
        LDI     40,R2
1064
        STO     R2,variant.var_1.int_comp(R0)
1065
//      lcl_strcpy(gbl_ptr->variant.var_1.str_comp, "DHRYSTONE PROGRAM, SOME STRING");
1066
        MOV     variant.var_1.str_comp(R0),R0
1067
        MOV     some_string(PC),R1
1068
        MOV     __HERE__+3(PC),R2
1069
        STO     R2,1(SP)
1070
        BRA     lcl_strcpy
1071
 
1072
//      lcl_strcpy(lcl_str_1, "DHRYSTONE PROGRAM, 1\'ST STRING");
1073
        MOV     lcl_str_1(SP),R0
1074
        MOV     first_string(PC),R1
1075
        MOV     __HERE__+3(PC),R2
1076
        STO     R2,1(SP)
1077
        BRA     lcl_strcpy
1078
 
1079
//      gbl_arr_2[8][7] = 10;
1080
        LDI     10,R0
1081
        STO     R0,8*50+7+gbl_arr_2(R12)
1082
//
1083
//      for(index=0; index < number_of_runs; index++) {
1084
        ; Let R11 be our index
1085
        CLR     R11
1086
dhrystone_main_loop:
1087
        ;; Start of Dhrystone main loop
1088
        ; proc_5();
1089
#ifdef  NO_INLINE
1090
        MOV     __HERE__+3(PC),R0
1091
        STO     R0,1(SP)
1092
        BRA     proc_5
1093
#else
1094
        LDI     'A',R0
1095
        STO     R0,gbl_ch(R12)
1096
        CLR     R0
1097
        STO     R0,gbl_bool(R12)
1098
#endif
1099
        ; proc_4();
1100
#ifdef  NO_INLINE
1101
        MOV     __HERE__+3(PC),R0
1102
        STO     R0,1(SP)
1103
        BRA     proc_4
1104
#else
1105
        LDI     'B',R0
1106
        STO     R0,gbl_ch_2(R12)
1107
#endif
1108
//              lcl_int_1 = 2;
1109
        LDI     2,R5
1110
        STO     R5,lcl_int_1(SP)
1111
//              lcl_int_2 = 3;
1112
        LDI     3,R6
1113
//              lcl_strcpy(lcl_str_2, "DHRYSTONE PROGRAM, 2\'ND STRING");
1114
        MOV     lcl_str_2(SP),R0
1115
        MOV     second_string(PC),R1
1116
        MOV     __HERE__+3(PC),R2
1117
        STO     R2,1(SP)
1118
        BRA     lcl_strcpy
1119
//              lcl_enum = Ident_2;
1120
        LDI     2,R0
1121
        STO     R0,lcl_enum(SP)
1122
//              gbl_bool = !func_2(lcl_str_1, lcl_str_2);
1123
        MOV     lcl_str_1(SP),R0
1124
        MOV     lcl_str_2(SP),R1
1125
        MOV     __HERE__+3(PC),R2
1126
        STO     R2,1(SP)
1127
        BRA     func_2
1128
        CLR     R1
1129
        TST     -1,R0
1130
        LDILO.Z 1,R1
1131
        STO     R1,gbl_bool(PC)
1132
 
1133
//              while(lcl_int_1 < lcl_int_2) {
1134
        ; R5 = lcl_int_1 = 2 on entry
1135
        ; R6 = lcl_int_2 = 3 on entry, so no entry test is required
1136
        LOD     lcl_int_1(SP),R5
1137
        // The 'while' comparison
1138
        CMP     R6,R5
1139
        BGE     dhrystone_end_while_loop
1140
dhrystone_while_loop:
1141
//                      lcl_int_3 = 5 * lcl_int_1 - lcl_int_2;
1142
        MOV     R5,R7
1143
        MPYS    5,R7
1144
        SUB     R6,R7
1145
        STO     R7,lcl_int_3(SP)
1146
//                      proc_7(lcl_int_1, lcl_int_2, &lcl_int_3);
1147
#ifdef  NO_INLINE
1148
        MOV     R5,R0
1149
        MOV     R6,R1
1150
        MOV     lcl_int_3(SP),R2
1151
        MOV     __HERE__+3(PC),R3
1152
        STO     R3,1(SP)
1153
        BRA     proc_7
1154
#else
1155
        MOV     R6,R1
1156
        ADD     2+R5,R1
1157
        STO     R1,lcl_int_3(SP)
1158
#endif
1159
//                      lcl_int_1 += 1;
1160
        LOD     lcl_int_1(SP),R5
1161
        ADD     1,R5
1162
        STO     R5,lcl_int_1(SP)
1163
;
1164
        ; BRA   dhrystone_while_loop    ; We'll unroll the loop, and put an
1165
        CMP     R6,R5                   ; additional comparison at the bottom
1166
        BLT     dhrystone_while_loop
1167
dhrystone_end_while_loop:
1168
//              }
1169
//
1170
//              proc_8(gbl_arr_1, gbl_arr_2, lcl_int_1, lcl_int_3);
1171
        MOV     gbl_arr_1(PC),R0
1172
        MOV     gbl_arr_2(PC),R1
1173
        MOV     R5,R2
1174
        MOV     R6,R3
1175
        MOV     __HERE__+3(PC),R4
1176
        STO     R4,1(SP)
1177
        BRA     proc_8
1178
//              proc_1(gbl_ptr);
1179
        LOD     gbl_ptr(PC),R0
1180
        MOV     __HERE__+3(PC),R2
1181
        STO     R2,1(SP)
1182
        BRA     proc_1
1183
//
1184
//              for(ch_index='A'; ch_index <= gbl_ch_2; ch_index++) {
1185
        LDI     'A',R7
1186
        LOD     gbl_ch_2(SP),R8
1187
        CMP     R7,R8
1188
        BLT     dhrystone_end_of_for_loop
1189
dhrystone_top_of_for_loop:
1190
//                      if (lcl_enum == func_1(ch_index, 'C')) {
1191
#ifdef  NO_INLINE
1192
        MOV     R7,R0
1193
        LDI     'C',R1
1194
        MOV     __HERE__+3(PC),R2
1195
        STO     R2,1(SP)
1196
        BRA     func_1
1197
#else
1198
        CMP     'C',R7
1199
        CLR.NZ  R0
1200
        STO.Z   R7,gbl_ch(R12)
1201
        LDILO.Z 1,R0
1202
#endif
1203
 
1204
        ; Result is now in R0
1205
        LOD     lcl_enum(SP),R1
1206
        CMP     R0,R1
1207
        BNZ     dhrystone_skip_then_clause
1208
//                              // Then not executed??
1209
//                              proc_6(0, &lcl_enum);
1210
 
1211
#ifndef SKIP_SHORT_CIRCUITS
1212
        BUSY
1213
#endif
1214
 
1215
        CLR     R0
1216
        MOV     lcl_enum(SP),R1
1217
        MOV     __HERE__+3(PC),R2
1218
        STO     R2,1(SP)
1219
        BRA     proc_6
1220
 
1221
//                              lcl_strcpy(lcl_str_2, "DHRYSTONE PROGRAM, 3\'RD STRING");
1222
        MOV     lcl_str_2(SP),R0
1223
        MOV     third_string(PC),R1
1224
        MOV     __HERE__+3(PC),R2
1225
        STO     R2,1(SP)
1226
        BRA     lcl_strcpy
1227
//                              lcl_int_2 = index;
1228
        MOV     R11,R6
1229
//                              gbl_int = index;
1230
        STO     R11,gbl_int(PC)
1231
//                      }
1232
dhrystone_skip_then_clause:
1233
        ADD     1,R7
1234
        LOD     gbl_ch_2(SP),R8
1235
        CMP     R8,R7
1236
        BGE     dhrystone_top_of_for_loop
1237
dhrystone_end_of_for_loop:
1238
//              }
1239
//
1240
//              lcl_int_2 = lcl_int_2 * lcl_int_1;
1241
        LOD     lcl_int_1(SP),R5
1242
        MPYS    R5,R6   ; lcl_int_2 =
1243
//              lcl_int_1 = lcl_int_2 / lcl_int_3;
1244
#ifndef SKIP_DIVIDE
1245
        MOV     R6,R0
1246
        LOD     lcl_int_3(SP),R1
1247
        MOV     __HERE__+3(PC),R2
1248
        STO     R2,1(SP)
1249
        BRA     divs
1250
#else
1251
        LDI     9,R0
1252
#endif
1253
        STO     R0,lcl_int_1(SP)
1254
//              lcl_int_2 = 7 * ( lcl_int_2 - lcl_int_3) - lcl_int_1;
1255
        LOD     lcl_int_3(SP),R2
1256
        SUB     R2,R6
1257
        MPYS    7,R6
1258
        SUB     R0,R6
1259
//              proc_2(&lcl_int_1);
1260
        MOV     lcl_int_1(SP),R0
1261
        MOV     __HERE__+3(PC),R1
1262
        STO     R1,1(SP)
1263
        BRA     proc_2
1264
 
1265
        ;; Bottom of (and return from) Dhrystone main loop
1266
        ADD     1,R11
1267
        CMP     NUMBER_OF_RUNS,R11
1268
        BLT     dhrystone_main_loop
1269
//      }
1270
 
1271
#ifdef  SUPERVISOR_TASK
1272
        LOD     2(SP),R1
1273
        LOD     3(SP),R2
1274
        LOD     4(SP),R3
1275
        LOD     5(SP),R4
1276
        LOD     6(SP),R5
1277
        LOD     7(SP),R6
1278
        LOD     8(SP),R7
1279
        LOD     9(SP),R8
1280
        LOD     10(SP),R9
1281
        LOD     11(SP),R10
1282
        LOD     12(SP),R11
1283
        ;
1284
        ADD     12+RECSIZE+RECSIZE+30+30+3,SP
1285
        ; Return from subroutine
1286
        RETN
1287
#else
1288
        LDI     0,CC
1289
        NOP
1290
        NOP
1291
        BUSY
1292
#endif

powered by: WebSVN 2.1.0

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