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

Subversion Repositories ssbcc

[/] [ssbcc/] [trunk/] [lib/] [9x8/] [deprecated/] [math.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 2012, Sinclair R.F., Inc.
2
;
3
; Multi-byte arithmetic
4
 
5
; Notation:  Multi-byte values on the stack are xx[n] where n=0 is the least
6
;            significant byte of the value
7
 
8
.function add_u16_u8__u16 ; ( u0[0] u0[1] u1[0] - us[0] us[1] )
9
  swap >r +uu r> +
10
.return
11
 
12
.function add_u16_u8__u24 ; ( u0[0] u0[1] u1[0] - us[0] us[1] us[2] )
13
  swap >r +uu r> +uu
14
.return
15
 
16
.function add_u16_u16__u16 ; ( u0[0] u0[1] u1[0] u1[1] - us[0] us[1] )
17
  >r .call(add_u16_u8__u16) r> +
18
.return
19
 
20
.function add_u16_u16__u24 ; ( u0[0] u0[1] u1[0] u1[1] - us[0] us[1] us[2] )
21
  >r .call(add_u16_u8__u24) r> .call(add_u16_u8__u16)
22
.return
23
 
24
.function add_u24_u8__u24 ; ( u0[0] u0[1] u0[2] u1[0] - us[0] us[1] us[2] )
25
  swap >r .call(add_u16_u8__u24) r> +
26
.return
27
 
28
.function add_u24_u8__u32 ; ( u0[0] u0[1] u0[2] u1[0] - us[0] us[1] us[2] u[3] )
29
  swap >r .call(add_u16_u8__u24) r> +uu
30
.return
31
 
32
.function add_u24_u16__u24 ; ( u0[0] u0[1] u0[2] u1[0] u1[1] - us[0] us[1] us[2] )
33
  >r .call(add_u24_u8__u24) r> .call(add_u16_u8__u16)
34
.return
35
 
36
.function add_u24_u16__u32 ; ( u0[0] u0[1] u0[2] u1[0] u1[1] - us[0] us[1] us[2] us[3] )
37
  >r .call(add_u24_u8__u32) r> .call(add_u24_u8__u24)
38
.return
39
 
40
.function add_u24_u24__u24 ; ( u0[0] u0[1] u0[2] u1[0] u1[1] u1[2] - us[0] us[1] us[2] )
41
  >r .call(add_u24_u16__u24) r> +
42
.return
43
 
44
.function add_u24_u24__u32 ; ( u0[0] u0[1] u0[2] u1[0] u1[1] u1[2] - us[0] us[1] us[2] us[3] )
45
  >r .call(add_u24_u16__u32) r> .call(add_u16_u8__u16)
46
.return
47
 
48
.function add_u32_u8__u32 ; ( u0[0] u0[1] u0[2] u0[3] u1[0] - us[0] us[1] us[2] us[3] )
49
  swap >r .call(add_u24_u8__u32) r> +
50
.return
51
 
52
.function add_u32_u16__u32 ; ( u0[0] u0[1] u0[2] u0[3] u1[0] u1[1] - us[0] us[1] us[2] us[3] )
53
  >r .call(add_u32_u8__u32) r> .call(add_u24_u8__u24)
54
.return
55
 
56
.function add_u32_u24__u32 ; ( u0[0] u0[1] u0[2] u0[3] u1[0] u1[1] u1[2] - us[0] us[1] us[2] us[3] )
57
  >r .call(add_u32_u16__u32) r> .call(add_u16_u8__u16)
58
.return
59
 
60
.function add_u32_u32__u32 ; ( u0[0] u0[1] u0[2] u0[3] u1[0] u1[1] u1[2] u1[3] - us[0] us[1] us[2] us[3] )
61
  >r .call(add_u32_u24__u32) r> +
62
.return

powered by: WebSVN 2.1.0

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