File ROM.PS

Directory of image this file is from
This file as a plain text file

PROGRAM ROM(INPUT,OUTPUT);
VAR ZA,Z:INTEGER;
BEGIN WRITELN("GEBEN SIE EINE ZAHL EIN!");
READ(Z);
WHILE Z<>0 DO BEGIN
 IF Z<1 THEN WRITELN("DIE ROEMER KANNTEN KEINE NEGATIVEN ZAHLEN!")
  ELSE WRITE(Z,"=");
 ZA:=0;
 WHILE Z>=1000 DO BEGIN ZA:=ZA+1;Z:=Z-1000;
  IF ZA=30 THEN BEGIN ZA:=0;WRITELN("M")END
   ELSE WRITE("M")END;
 IF Z>=900 THEN BEGIN WRITE("CM");Z:=Z-900 END;
 IF Z>=500 THEN BEGIN WRITE("D");Z:=Z-500 END;
 IF Z>=400 THEN BEGIN WRITE("CD");Z:=Z-400 END;
 WHILE Z>=100 DO BEGIN WRITE("C");Z:=Z-100 END;
 IF Z>=90 THEN BEGIN WRITE("XC");Z:=Z-90 END;
 IF Z>=50 THEN BEGIN WRITE("L");Z:=Z-50 END;
 IF Z>=40 THEN BEGIN WRITE("XL");Z:=Z-40 END;
 WHILE Z>=10 DO BEGIN WRITE("X");Z:=Z-10 END;
 IF Z=9 THEN BEGIN WRITE("IX");Z:=Z-9 END;
 IF Z>=5 THEN BEGIN WRITE("V");Z:=Z-5 END;
 IF Z=4 THEN BEGIN WRITE("IV");Z:=Z-4 END;
 WHILE Z>=1 DO BEGIN WRITE("I");Z:=Z-1 END;
 WRITELN;WRITELN("GEBEN SIE EINE NEUE ZAHL EIN!");READLN(Z)
END
END.



Feel free to contact me, David Gesswein djg@pdp8online.com with any questions, comments on the web site, or if you have related equipment, documentation, software etc. you are willing to part with.  I am interested in anything PDP-8 related, computers, peripherals used with them, DEC or third party, or documentation. 

PDP-8 Home Page   PDP-8 Site Map   PDP-8 Site Search