summaryrefslogtreecommitdiff
path: root/app/baisy/2.2.1-schulis/src/konvert
blob: 098e253ccc5b4d21cc8590ee3d91507584b1f951 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
PACKET konvertDEFINES highbyte,lowbyte,word,changelowbyte,changehighbyte,dint
,highword,lowword:INT PROC highbyte(INT CONST value):TEXT VAR x:="  ";replace
(x,1,value);code(xSUB 2)END PROC highbyte;INT PROC lowbyte(INT CONST value):
TEXT VAR x:="  ";replace(x,1,value);code(xSUB 1)END PROC lowbyte;INT PROC 
word(INT CONST lowbyte,highbyte):TEXT CONST x:=code(lowbyte)+code(highbyte);x
ISUB 1END PROC word;PROC changelowbyte(INT VAR word,INT CONST lowbyte):TEXT 
VAR x:="  ";replace(x,1,word);replace(x,1,code(lowbyte));word:=xISUB 1END 
PROC changelowbyte;PROC changehighbyte(INT VAR word,INT CONST highbyte):TEXT 
VAR x:="  ";replace(x,1,word);replace(x,2,code(highbyte));word:=xISUB 1END 
PROC changehighbyte;REAL PROC dint(INT CONST lowword,highword):reallowword+
65536.0*realhighword.reallowword:real(lowbyte(lowword))+256.0*real(highbyte(
lowword)).realhighword:real(lowbyte(highword))+256.0*real(highbyte(highword))
.END PROC dint;INT PROC highword(REAL CONST doubleprecissionint):int(
doubleprecissionint/65536.0)END PROC highword;INT PROC lowword(REAL CONST 
doubleprecissionint):stringoflowbytesISUB 1.stringoflowbytes:code(int(
doubleprecissionintMOD 256.0))+code(int((doubleprecissionintMOD 65536.0)/
256.0)).END PROC lowword;END PACKET konvert;