Semicolon is one
[llpp.git] / le / bo.ml
blobc32edd5a3e72df30c86266dc2d287eb1fa55119d
1 let w8 s pos i = String.set s pos (Char.chr (i land 0xff));;
2 let r8 s pos = Char.code (String.get s pos);;
4 let ordermagic = 'l';;
6 let w16 s pos i =
7 w8 s pos i;
8 w8 s (pos+1) (i lsr 8)
9 ;;
11 let w32 s pos i =
12 w16 s pos i;
13 w16 s (pos+2) (i lsr 16)
16 let r16 s pos =
17 let rb pos1 = Char.code (String.get s (pos + pos1)) in
18 (rb 0) lor ((rb 1) lsl 8)
21 let r16s s pos =
22 let i = r16 s pos in
23 i - ((i land 0x8000) lsl 1)
26 let r32 s pos =
27 let rb pos1 = Char.code (String.get s (pos + pos1)) in
28 let l = (rb 0) lor ((rb 1) lsl 8)
29 and u = (rb 2) lor ((rb 3) lsl 8) in
30 (u lsl 16) lor l