8-Bit Software Online Conversion
ECG Simulator V.3 - Listing
0REM Wed,13 May 1992.21:22:34
10DEFFNS:$(PAGE+6)=TIME$:="ECGSIM3"
20A%=0:X%=255:T%=USR&FFF4:T%=(T%DIV&1
00)AND7:IF T%<3 PROCa:A$="*T.|MFORL%=0TO
TOP-PAGE STEP4:L%!&E00=L%!PAGE:N.|MPAGE=
&E00|M" ELSE A$="240V.23,7,0,1,0,0,0,0,0
,0|M":PRINT"MASTER VERSION RUNNING ENSUR
E PAGE=&E00"
30OSCLI"K.0DEL.0,30|MDEL.730,790|M"+A
$+"O.|MV.6:RUN|M":OSCLI"FX138 0 128":END
:REM Z%=DATA START B% IS NSR Q% IS NUMB
ER OF RHYTHMS
40MODE0:VDU23;8202;0;0;0;0;:E%=0:F%=0
:G%=0:H%=0:D%=0:R%=0:Z%=800:Q%=38:B%=860
50ONERROR:MODE0:REPORT:PRINTERL:END
60VDU19,1,2,0,0,0:FORL%=0TO1278STEP23
5:MOVEL%,370:DRAWL%,625:NEXT:VDU24,0;382
;1278;608;:CLG:MOVE0,608:DRAW1278,608:MO
VE0,382:DRAW1278,382
70PROCc("ECG Simulation by C.J.Richar
dson.",1):PROCc("D - Dump. ",4):PROCc("
W - Window.",5):PROCc("P - Prompt.",6):P
ROCc("G - Grid ",7)
80REPEAT:PROCc("R - To run through rh
ythms.",15):PROCc("I - To interpret rhyt
hms. ",16):b$=GET$:IFb$="R":PROCt
90UNTILb$="I"
100I%=1:b$="1":PRINTTAB(0,9)SPC160
110PROCc("SPACE - interpret rhythm.",3
)
120REPEATPROCc("Attempts :"+STR$F%,9):
PROCc("Correct :"+STR$G%,10):PRINTTAB(3
3,11);"Points :";E%;" ":PROCe:PROCd:VD
U28,0,31,79,0:UNTILFALSE
130DEFPROCe
140IFI%>0:U%=0:C%=Z%+(RND(Q%)-1)*30:RE
STOREC%:READ A$,A2$:C%=C%+10:R%=0:D%=0:I
FA$="N"A$="COARSE VF":A2$="VF":R%=1 ELSE
IFA$="O"PROCb
150RESTOREC%
160VDU28,0,19,79,13
170Y%=0
180REPEAT:IFD%IFRND(50)=1PROCb
190MOVE1264,Y%+500
200READY%:IFY%=-1:RESTOREC%:READY%
210IFY%>-5ANDY%<0PROCf
220DRAW1271,Y%+500:READY%:IFY%>-5ANDY%
<0PROCf
230DRAW1278,Y%+500
240CALLA%
250K%=INKEY0
260IFR%=1IFD%=0IFRND(50)=1C%=B%+(RND(Q
%-2)-1)*30:RESTOREC%:READA$,A2$:C%=C%+10
270IFK%=71PROCg
280IFK%=68:VDU2,1,27,1,69,32,32:FORL%=
1TOLENA$:VDU1,ASCMID$(A$,L%,1)EORVALb$:N
EXT:VDU3:PROCg:OSCLI"GDUMP"
290IFK%=87:OSCLI"WIN."
300IFK%=80:T%=Z%+60:VDU28,0,30,79,21,1
4:REPEAT:RESTORET%:READW$,X$:PRINTW$;" O
R ";X$:T%=T%+30:UNTILT%>Z%+Q%*30-30:PRIN
T"Press a key":L%=GET:VDU12,28,0,19,79,1
3,15:RESTOREC%
310UNTILK%=32
320ENDPROC
330DEFPROCc(c$,N%):PRINTTAB(39-(LENc$/
2),N%);c$:ENDPROC
340DEFPROCd:VDU28,0,30,79,21:F%=F%+1:I
%=0
350INPUT"What is this rhythm? "a$:FORL
%=1TOLENa$
360IFASCMID$(a$,L%,1)>90a$=MID$(a$,1,L
%-1)+CHR$(ASCMID$(a$,L%,1)-32)+MID$(a$,L
%+1,LENa$)
370NEXT
380IFLENa$>LENA$/2IFINSTR(A$,a$):I%=1
390IFA2$=a$:I%=2
400IFA$=a$:I%=2
410IFI%=0PROCc("WRONG!",3):U%=U%+1
420IFI%>0G%=G%+1
430IFI%=1PROCc("Partially correct. 1 p
oint",4)
440IFI%=2PROCc("Fully correct. 2 point
s",4)
450E%=E%+I%
460IFU%=4:IF I%=0PROCc("THATS ENOUGH!
score reduced by 1!",4):E%=E%-1:I%=1:PRO
Cc("It was "+A$+"/"+A2$,5)
470PROCc("Press any key to continue",6
):L%=GET:VDU12
480ENDPROC
490DEFPROCf
500IFY%=-2:READO%,V%:Y%=RND(O%)+V%:RES
TOREC%:ENDPROC
510IFY%=-3:READO%,V%:Y%=RND(O%)+V%:END
PROC
520IFY%=-4:READW%:IFRND(W%)<>1 RESTORE
C%:READY%:ENDPROC ELSE IFY%=-4 READY%:EN
DPROC
530ENDPROC
540DEFPROCt:PROCc("SPACE - next rhythm
.",3)
550I%=0:C%=Z%+60:FORM%=3TOQ%:VDU28,0,3
1,79,0:RESTOREC%:READA$,A2$:PRINTTAB(0,9
)SPC160:PROCc(A$,9):PROCc(A2$,10):C%=C%+
10:PROCe:C%=C%+20:NEXT:VDU28,0,31,79,0
560ENDPROC
570DEFPROCg:IF K%=71 H%=H%EOR1:VDU28,0
,31,79,0:PRINTTAB(42,7);:IFH%=0:PRINT"of
f." ELSE IFK%=71PRINT"on. "
580VDU28,0,19,79,13:IFH%=0:ENDPROC
590FORL%=0TO1278STEP47:MOVEL%,384:DRAW
L%,606:NEXT:FORL%=2TO1280STEP235:MOVEL%,
370:DRAWL%,625:NEXT:FORL%=412TO588STEP28
:FORX%=0TO1278STEP10:MOVEX%+5,L%:DRAWX%+
5,L%:NEXT,:ENDPROC
600DEFPROCb:D%=D%+1
610IFD%=1:C%=0
620IFD%=2:C%=30
630IFD%=3:C%=60
640IFD%=4:C%=720
650IFD%=5:C%=750
660IFD%=6:C%=780
670IFD%=7:C%=120
680IFD%=8:C%=150
690IFD%>8:C%=180
700C%=C%+B%
710RESTOREC%:READA$,A2$:C%=C%+10
720ENDPROC
730DEFPROCa:VDU21:FORL%=0TO2STEP2:P%=&
C00:[:OPTL%
740.A%
750LDA#0:LDX#0:.m1:STA&5080,X:INX:CPX#
8:BNEm1:LDX#0:.m2:STA&5300,X:INX:CPX#8:B
NEm2:LDX#0:.m3:STA&5580,X:INX:CPX#8:BNEm
3:LDX#0:.m4:STA&5800,X:INX:CPX#8:BNEm4:L
DX#0:.m5:STA&5A80,X:INX:CPX#8:BNEm5:LDX#
0:.m6:STA&5D00,X:INX:CPX#8:BNEm6
760LDX#0:.m7:STA&5F80,X:INX:CPX#8:BNEm
7
770.S%:LDA&5088:STA&5080:INCS%+1:BNEnu
p:INCS%+2:.nup:INCS%+4:BNEnup2:INCS%+5:.
nup2
780LDAS%+2:CMP#&62:BNES%:LDA#&50:STAS%
+2:STAS%+5:LDA#&88:STAS%+1:LDA#&80:STAS%
+4:LDX#0:LDA#0:.m8:STA&61F8,X:INX:CPX#8:
BNEm8
790RTS:]:NEXT:ENDPROC
800DATAN,N
810DATA-2,130,-60
820DATA-1
830DATAO,O
840DATA-1,-1
850DATA-1
860DATANORMAL SINUS RHYTHM,NSR
870DATA0,0,0,0,0,0,0,0,0,0,0,0,0,5,10,
5,0,0,-10,50,-30,0,0,10,20,25,20,10
880DATA-1
890DATASINUS TACHYCARDIA,ST
900DATA0,5,10,5,0,0,-10,50,-30,0,0,10,
20,25,20,10
910DATA-1
920DATARAPID SINUS TACHYCARDIA,RAPID S
T
930DATA10,5,0,-10,50,-30,0,10,20,25
940DATA-1
950DATASINUS BRADYCARDIA,SINUS BRADY
960DATA0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,1
0,5,0,0,-10,50,-30,0,0,10,20,25,20,10,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0
970DATA-1
980DATACOARSE VENTRICULAR FIBRILLATION
,COARSE VF
990DATA-2,130,-60
1000DATA-1
1010DATAFINE VENTRICULAR FIBRILLATION,F
INE VF
1020DATA-2,20,-10
1030DATA-1
1040DATAASYSTOLE,ASYSTOLE
1050DATA0,0
1060DATA-1
1070DATANORMAL SINUS RHYTHM ATRIAL EXTR
ASYSTOLE,NSR+PACS
1080DATA0,0,0,0,0,0,0,0,0,0,0,0,0,5,10,
5,0,0,-10,50,-30,0,0,10,20,25,20,10,-4,5
,0,0,5,10,5,0,0,-10,50,-30,0,0,10,20,25,
20,10,0,0,0,0,0,0,0,0,0
1090DATA-1
1100DATANORMAL SINUS RHYTHM VENTRICULAR
EXTRASYSTOLE,NSR+PVCS
1110DATA0,0,0,0,0,0,5,10,5,0,0,-10,50,-
30,0,0,10,20,25,20,10,0,0,0,0,0,0,0,-4,5
,40,-50,-60,-80,-75,0,10,15,10,0,-5,0,0,
0,0,0,0,0,0,0
1120DATA-1
1130DATASUPRAVENTRICULAR TACHYCARDIA,SV
T
1140DATA10,-10,50,-30,0,10,20,25
1150DATA-1
1160DATAATRIAL FIBRILLATION,AF
1170DATA-3,5,0,-3,5,0,-4,3,-5,0,-10,50,
-30,0,0,10,20,25,20,10
1180DATA-1
1190DATAATRIAL FLUTTER 3:1,AFLUTT
1200DATA12,10,0,12,10,0,12,10,0,-10,50,
-30,0,0,10,20,25,20,10,0
1210DATA-1
1220DATAATRIAL FLUTTER 2:1,AFLUTT
1230DATA12,10,0,12,10,0,-10,50,-30,0,0,
10,20,25,20,0
1240DATA-1
1250DATAATRIAL FLUTTER 1:1,AFLUTT
1260DATA12,10,0,-10,50,-30,0,0,10,20,25
,20,10,0
1270DATA-1
1280DATAHIGH JUNCTIONAL,HIGH NODAL
1290DATA0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,0,0,0,0,0,0,0,0,0,0,-5,-10,-5,50,-30,0,
0,10,20,25,20,10
1300DATA-1
1310DATAMID JUNCTIONAL,MID NODAL
1320DATA0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,0,0,0,0,0,0,0,0,0,0,-5,50,-30,0,0,10,20
,25,20,10
1330DATA-1
1340DATALOW JUNCTIONAL,LOW NODAL
1350DATA0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,0,0,0,0,0,0,0,0,0,0,-5,50,-20,0,-10,5,1
0,15,10,0
1360DATA-1
1370DATA1ST DEGREE ATRIO VENTRICULAR BL
OCK,1ST DEGREE
1380DATA0,0,0,0,0,0,0,0,0,0,0,0,0,5,10,
5,0,0,0,0,0,0,-10,50,-30,0,0,10,20,25,20
,10
1390DATA-1
1400DATA2ND DEGREE TYPE 1 BLOCK WENKEBA
CH,2ND DEGREE TYPE 1
1410DATA0,0,0,0,0,0,0,0,0,0,0,0,0,5,10,
5,0,0,-10,50,-30,0,0,10,20,25,20,10,0,0,
0,0,0,0,0,0,0,0,0,0,0,5,10,5,0,0,0,0,-10
,50,-30,0,0,10,20,25,20,10
1420DATA0,0,0,0,0,0,0,0,0,0,0,0,0,5,10,
5,0,0,0,0,0,0,0,0,-10,50,-30,0,0,10,20,2
5,20,10,0,0,0,0,0,0,0,0,0,0,0,0,0,5,10,5
,0,0,0,0,0,0,-1
1430DATA2ND DEGREE TYPE 2 BLOCK,2ND DEG
REE TYPE 2
1440DATA0,0,0,0,0,0,0,0,0,0,0,0,0,5,10,
5,0,0,-10,50,-30,0,0,10,20,25,20,10,-4,5
,0,0,0,0,0,0,0,0,0,0,0,0,0,5,10,5
1450DATA-1
1460DATABUNDLE BRANCH BLOCK,BBB
1470DATA0,0,0,0,0,0,0,0,0,0,0,5,10,5,0,
0,-10,50,40,-30,0,0,10,20,25,20,10,0
1480DATA-1
1490DATAMULTIFOCAL PREMATURE VENTRICULA
R CONTRACTIONS,MULTIFOCAL PVCS
1500DATA0,0,0,0,0,0,-4,2,5,10,5,0,0,-10
,50,-30,0,0,10,20,25,20,10,0,0,0,0,0,-4,
3
1510DATA0,0,0,0,0,0,-3,50,0,-3,50,0,-3,
50,-100,-50,-3,50,-50,-3,0,20,0,0,0,0,0,
0,0,0,-1
1520DATAR ON T ECTOPICS,R ON T
1530DATA0,0,0,0,0,0,0,0,0,5,10,5,0,0,-1
0,50,-30,0,0,10,20,25,20,10,-4,4,0,0,0,0
,0,0,-10,50,-30,0,0,10,20,25,20,10,40,-5
0,-60,-80,-75,0,10,15,10,0,-5,0,0,0,0,0
1540DATA-1
1550DATAVENTRICULAR BIGEMINY,BIGEMINY
1560DATA0,0,0,0,0,0,0,0,0,5,10,5,0,0,-1
0,50,-30,0,0,10,20,25,20,10,0,0,0,0,0,0,
40,-50,-60,-80,-75,0,10,15,10,0,-5,0,0,0
,0,0,0,0,0,0
1570DATA-1
1580DATASLOW VENTRICULAR TACHYCARDIA,SL
OW VT
1590DATA40,-50,-60,-80,-75,0,10,15,10,0
,-5,0,0,0,0,0
1600DATA-1
1610DATAFAST VENTRICULAR TACHYCARDIA,FA
ST VT
1620DATA40,-50,-60,-80,-75,0,10,15,10,-
5
1630DATA-1
1640DATARAPID VENTRICULAR TACHYCARDIA,R
APID VT
1650DATA40,-50,-60,-80,-75,15,10,-5
1660DATA-1
1670DATAAGONAL,AGONAL
1680DATA0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,0,0,0,0,0,0,0,0,0,0,0,0,10,15,20,22,20,
15,10,0
1690DATA-10,-15,-20,-15,-10,0,10,12,10,
0,-1
1700DATAVENTRICULAR STANDSTILL,VENTRICU
LAR STANDSTILL
1710DATA0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,0,0,0,0,0,0,0,0,0,0,5,10,5,0
1720DATA-1
1730DATAIDIO VENTRICULAR,IDIOVENTRICULA
R
1740DATA0,0,0,0,-4,10,25,35,45,0,-50,-6
0,-80,-75,0,10,15,10,0,-5
1750DATA-1
1760DATANORMAL SINUS RHYTHM ST ELEVATIO
N,NSR+ST ELEVATION
1770DATA0,0,0,0,0,0,0,0,0,0,0,0,0,5,10,
5,0,0,-10,50,20,15,15,15,20,25,20,10
1780DATA-1
1790DATANORMAL SINUS RHYTHM ST DEPRESSI
ON,NSR+ST DEPRESSION
1800DATA0,0,0,0,0,0,0,0,0,0,0,0,0,5,10,
5,0,0,-10,50,-25,-23,-21,-19,-5,10,20,25
,20,10
1810DATA-1
1820DATASINUS ARRHYTHMIA,NSR
1830DATA0,0,-4,2,0,0,0,0,0,0,0,0,5,10,5
,0,-10,50,-30,0,0,10,20,25,20,10
1840DATA-1
1850DATANSR+SINUS ARREST,NSR+SINUS ARRE
ST
1860DATA0,0,5,10,5,0,-10,50,-30,0,0,10,
20,25,20,10,0,0,0,0,0,0,0,0,0,0,-4,20,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
1870DATA-1
1880DATAWANDERING ATRIAL PACEMAKER,WAP
1890DATA0,0,0,0,0,0,0,0,0,0,0,0,0,5,-3,
5,10,5,0,0,-10,50,-30,0,0,10,20,25,20,10
1900DATA-1
1910DATA3RD DEGREE ATRIO VENTRICULAR BL
OCK,3RD DEGREE
1920DATA0,0,0,0,0,0,0,0,0,0,5,10,5,0,0,
0,0,0,0,0,0,0,0,0,5,10,5,0,0,0,0,0,50,-3
0,0,0,10,20,25,20,10
1930DATA0,0,0,0,0,0,0,0,0,0,5,10,5,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,5,10,5,0,0,50,-3
0,0,0,10,20,25,20,10
1940DATA0,0,0,0,0,0,0,0,0,0,0,0,5,10,5,
0,0,0,0,0,0,0,0,0,0,0,0,0,5,10,5,0,50,-3
0,0,0,10,20,25,20,10
1950DATA10,5,0,0,0,0,0,0,0,0,0,0,0,5,10
,5,0,0,0,0,0,0,0,0,0,0,0,0,0,5,10,5,50,-
30,0,0,10,20,25,20,10
1960DATA5,10,5,0,0,0,0,0,0,0,0,0,0,0,5,
10,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,-3
0,0,0,10,20,25,20,10
1970DATA0,5,10,5,0,0,0,0,0,0,0,0,0,0,0,
5,10,5,0,0,0,0,0,0,0,0,0,0,0,5,10,5,50,-
30,0,0,10,20,25,20,10
1980DATA0,0,5,10,5,0,0,0,0,0,0,0,0,0,0,
0,5,10,5,0,0,0,0,0,0,0,0,0,0,0,0,5,50,-3
0,0,0,10,20,25,20,10
1990DATA0,0,0,0,5,10,5,0,0,0,0,0,0,0,0,
0,0,0,5,10,5,0,0,0,0,0,0,0,0,0,0,0,50,-3
0,5,0,10,20,25,20,10
2000DATA0,0,0,0,0,5,10,5,0,0,0,0,0,0,0,
0,0,0,0,5,10,5,0,0,0,0,0,0,0,0,0,0,50,-3
0,0,5,10,20,25,20,10
2010DATA0,-1