intel MCS BASIC-52 — Intel MCS BASIC-52 Versions 1 & 1.1 Operating and Reference Manual PDF (EN)

int e l 8.2 DISABLING CONTROL-C In some applications, it may be desirable or even a requirement that program execution not accidentally be halted. Under "normal" operation the execution of any MCS BASIC-52 program can be terminated by typing a "control-C" on the console device. However, it is possible to disable the "control-C" break function in MCS BASIC-52. This is accomplished by setting BIT 48 (30H) to a one. BIT 48 is located in internal memory location 38.0 (26.0H). This BIT may be set by executing the following statement in an MCS BASIC-52 program: DBY(38) = DBY(38).OR.01H Once this BIT is set to a one, the control-C break function, for both LIST and RUN operations will be disabled.

The user has the option to create a custom break character or string of characters by using the GET operator. The following is an example of how to implement a custom break character: EXAMPLE: >10 STRING 100,10: A=1: REM INITIALIZE STRINGS >20 $(1) = "BREAK" : REM "BREAK" IS THE PASSWORD >30 DBY(38) = DBY(38).OR.1 : REM DISABLE CONTROL-C >40 FOR I=1 T0 1000 : REM DUMMY LOOP >50 J=SIN(I) >60 K=GET : IF K 0 THEN 100 ELSE NEXT I >70 END >100 IF K=ASC($(1),A) THEN A=A+1 ELSE A=1 >110 REM TEST FOR MATCH >120 IF A=1 THEN NEXT I >130 IF A=6 THEN 200 ELSE NEXT I >140 END >200 PRINT "BREAK" >210 DBY(38)=DBY(38).AND.0FEH :

REM ENABLE CONTROL-C In this example, typing the word BREAK will stop program execution. In other words, BREAK is a password. - 100 -