|
|
DataMuseum.dkPresents historical artifacts from the history of: CR80 Hard and Floppy Disks |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about CR80 Hard and Floppy Disks Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 4284 (0x10bc)
Types: TextFile
Names: »CPR.P«
└─⟦b21be6f3b⟧ Bits:30005082 8" CR80 Floppy CR80FD_0036 ( CR/D/3143 KLP & KMO C-KURSUS + C JOBFILER 861127 Volume MOVEFL RAM TEST css/709 #0000-7fff V24+SCM )
└─⟦95f1eafb2⟧
└─⟦this⟧ »GR1.D!CPR.D!CPR.P«
└─⟦c25823ad8⟧ Bits:30005089 8" CR80 Floppy CR80FD_0044 ( @*FLOPPY C )
└─⟦feb1d529a⟧
└─⟦this⟧ »GR1.D!CPR.D!CPR.P«
C Compiler Version 0301 1986.11.25 13:32:58 Page: 1 Source: CPR.S
00.00001: #include <std.h>
01.00001: /*%NOLIST*/
00.00002:
00.00003: main ()
00.00004: {
00.00005: BOOL ok;
00.00006: char cpr [10];
00.00007:
00.00008: readcpr (cpr, ok);
00.00009: if (ok) /* cpr no numeric */
00.00010: { checkcpr (cpr, ok); /* check date, month, year */
00.00011: if (ok) /* cpr no valid */
00.00012: { modcpr (cpr, ok);
00.00013: if (ok)
00.00014: putfmt ("CPR no okey-dokey\n");
00.00015: else
00.00016: putfmt ("CPR no NOT ok\n");
00.00017: } /* end brace */
00.00018: } /* end grace */
00.00019: return (1);
00.00020: } /* space */
00.00021: /* internal PROCEDURES */
00.00022:
00.00023: readcpr (cpr, ok)
00.00024: char cpr [10];
00.00025: BOOL ok;
00.00026: {
00.00027: int count = 0;
00.00028: putfmt ("Enter cpr number\n");
00.00029: while (count++ < 10)
00.00030: {
00.00031: cpr [count] = getch();
00.00032: ok = isdigit (cpr [count]);
00.00033: if (!ok) break;
00.00034: }
00.00035: if (!ok)
00.00036: putfmt ("Invalid digit in number\n");
00.00037: }
00.00038:
00.00039: checkcpr (cpr, ok)
00.00040: char cpr [10];
00.00041: BOOL ok;
00.00042:
00.00043: {
«ff»C Compiler Version 0301 1986.11.25 13:32:58 Page: 2 Source: CPR.S
00.00044: /* chec«fs»k day format yymmddnnnn */
00.00045: int index = 0;
00.00046: ok = !(cpr [index] > "3");
00.00047: if (ok)
00.00048: if (cpr [index++] == "3")
00.00049: ok = !(cpr [index++] > "1");
00.00050: if (ok) /* check month */
00.00051: {
00.00052: ok = !(cpr [index] > "1");
00.00053: if (ok)
00.00054: if (cpr [index++] == "1")
00.00055: ok = !(cpr [index] > "2");
00.00056: }
00.00057: if (!ok)
00.00058: putfmt ("Invalid birthday in number\n");
00.00059: }
00.00060:
00.00061: modcpr (cpr, ok)
00.00062: char *cpr;
00.00063: BOOL ok;
00.00064:
00.00065: {
00.00066: static int check [10] = {4,3,2,7,6,5,4,3,2,1};
00.00067: int sum, count;
00.00068:
00.00069: for (sum = 0, count = 0; count < 10;
00.00070: sum += (check [count]
00.00071: * (cpr[count] - '0')), count++);
00.00072: ok = !(sum % 11);
00.00073: }
«ff»
No. of preprocessing errors = 0
No. of pass 1 errors = 0
«ff»
C Debug Table:
SOURCE STORAGE STORAGE DATA-ALLOCATION
LINE NAME TYPE TYPE CLASS OFFS. BASE SIZE
--------------------------------------------------------------------------
01.00094 STDOUT var short extern
01.00094 STDIN var short extern
01.00094 STDERR var short extern
--------------------------------------------------------------------------
00.00004 main func func=>short extern
00.00005 ok var short auto -1 R6 1
00.00006 cpr var []char auto -11 R6 10
--------------------------------------------------------------------------
00.00026 readcpr func func=>short extern
00.00026 cpr arg. *char auto 5 R6 1
00.00026 ok arg. short auto 6 R6 1
00.00027 count var short auto -1 R6 1
--------------------------------------------------------------------------
00.00043 checkcpr func func=>short extern
00.00043 cpr arg. *char auto 5 R6 1
00.00043 ok arg. short auto 6 R6 1
00.00045 index var short auto -1 R6 1
--------------------------------------------------------------------------
00.00065 modcpr func func=>short extern
00.00065 cpr arg. *char auto 5 R6 1
00.00065 ok arg. short auto 6 R6 1
00.00066 check var []short static 117 MB 10
00.00067 sum var short auto -1 R6 1
00.00067 count var short auto -2 R6 1