diff options
| author | Lars-Dominik Braun <lars@6xq.net> | 2016-09-30 16:57:23 +0200 | 
|---|---|---|
| committer | Lars-Dominik Braun <lars@6xq.net> | 2016-09-30 16:59:06 +0200 | 
| commit | 724cc003460ec67eda269911da85c9f9e40aa6cf (patch) | |
| tree | 14e27b45e04279516e4be546b15dcf6fafe17268 /dos/konvert | |
| download | eumel-src-724cc003460ec67eda269911da85c9f9e40aa6cf.tar.gz eumel-src-724cc003460ec67eda269911da85c9f9e40aa6cf.tar.bz2 eumel-src-724cc003460ec67eda269911da85c9f9e40aa6cf.zip | |
Add extracted sources from floppy disk images
Some files have no textual representation (yet) and were added as raw
dataspaces.
Diffstat (limited to 'dos/konvert')
| -rw-r--r-- | dos/konvert | 75 | 
1 files changed, 75 insertions, 0 deletions
| diff --git a/dos/konvert b/dos/konvert new file mode 100644 index 0000000..c5c4c43 --- /dev/null +++ b/dos/konvert @@ -0,0 +1,75 @@ +PACKET konvert DEFINES                               (* Copyright (C) 1986 *) +                                                     (* Frank Klapper      *) +                                                     (* 28.10.86           *) +  high byte, +  low byte, +  word, +  change low byte, +  change high byte, +  dint, +  high word, +  low word: + +INT PROC high byte (INT CONST value): +  TEXT VAR x := "  "; +  replace (x, 1, value); +  code (x SUB 2) + +END PROC high byte; + +INT PROC low byte (INT CONST value): +  TEXT VAR x := "  "; +  replace (x, 1, value); +  code (x SUB 1) + +END PROC low byte;  +  +INT PROC word (INT CONST low byte, high byte): +  TEXT CONST x :: code (low byte) + code (high byte); +  x ISUB 1 + +END PROC word; + +PROC change low byte (INT VAR word, INT CONST low byte): +  TEXT VAR x := "  "; +  replace (x, 1, word); +  replace (x, 1, code (low byte)); +  word := x ISUB 1 + +END PROC change low byte; + +PROC change high byte (INT VAR word, INT CONST high byte): +  TEXT VAR x := "  "; +  replace (x, 1, word); +  replace (x, 2, code (high byte)); +  word := x ISUB 1 + +END PROC change high byte; + +REAL PROC dint (INT CONST low word, high word): +  real low word + 65536.0 * real high word. + +real low word: +  real (low byte (low word)) + 256.0 * real (high byte (low word)). + +real high word: +  real (low byte (high word)) + 256.0 * real (high byte (high word)). + +END PROC dint; + +INT PROC high word (REAL CONST double precission int): +  int (double precission int / 65536.0) + +END PROC high word; + +INT PROC low word (REAL CONST double precission int):  +  string of low bytes ISUB 1. + +string of low bytes: +  code (int (double precission int MOD 256.0)) + +  code (int ((double precission int MOD 65536.0) / 256.0)).  +  +END PROC low word;  +  +END PACKET konvert; + | 
