summaryrefslogtreecommitdiff
path: root/app/baisy/2.2.1-schulis/src/konvert
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2019-02-04 13:09:03 +0100
committerLars-Dominik Braun <lars@6xq.net>2019-02-04 13:09:03 +0100
commit04e68443040c7abad84d66477e98f93bed701760 (patch)
tree2b6202afae659e773bf6916157d23e83edfa44e3 /app/baisy/2.2.1-schulis/src/konvert
downloadeumel-src-04e68443040c7abad84d66477e98f93bed701760.tar.gz
eumel-src-04e68443040c7abad84d66477e98f93bed701760.tar.bz2
eumel-src-04e68443040c7abad84d66477e98f93bed701760.zip
Initial import
Diffstat (limited to 'app/baisy/2.2.1-schulis/src/konvert')
-rw-r--r--app/baisy/2.2.1-schulis/src/konvert18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/baisy/2.2.1-schulis/src/konvert b/app/baisy/2.2.1-schulis/src/konvert
new file mode 100644
index 0000000..098e253
--- /dev/null
+++ b/app/baisy/2.2.1-schulis/src/konvert
@@ -0,0 +1,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;
+