BESM6: Implemented SET CPU REQ, added an example of a batch task run.
This commit is contained in:
parent
1787947299
commit
3ac8c82951
4 changed files with 109 additions and 15 deletions
|
@ -80,6 +80,7 @@ jmp_buf cpu_halt;
|
||||||
t_stat cpu_examine (t_value *vptr, t_addr addr, UNIT *uptr, int32 sw);
|
t_stat cpu_examine (t_value *vptr, t_addr addr, UNIT *uptr, int32 sw);
|
||||||
t_stat cpu_deposit (t_value val, t_addr addr, UNIT *uptr, int32 sw);
|
t_stat cpu_deposit (t_value val, t_addr addr, UNIT *uptr, int32 sw);
|
||||||
t_stat cpu_reset (DEVICE *dptr);
|
t_stat cpu_reset (DEVICE *dptr);
|
||||||
|
t_stat cpu_req (UNIT *u, int32 val, char *cptr, void *desc);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CPU data structures
|
* CPU data structures
|
||||||
|
@ -131,7 +132,8 @@ REG cpu_reg[] = {
|
||||||
|
|
||||||
MTAB cpu_mod[] = {
|
MTAB cpu_mod[] = {
|
||||||
{ MTAB_XTD|MTAB_VDV, 0, "IDLE", "IDLE", &sim_set_idle, &sim_show_idle, NULL, "Display idle detection mode" },
|
{ MTAB_XTD|MTAB_VDV, 0, "IDLE", "IDLE", &sim_set_idle, &sim_show_idle, NULL, "Display idle detection mode" },
|
||||||
{ MTAB_XTD|MTAB_VDV, 0, NULL, "NOIDLE", &sim_clr_idle, NULL, NULL, "Disables idle detection" },
|
{ MTAB_XTD|MTAB_VDV, 0, NULL, "NOIDLE", &sim_clr_idle, NULL, NULL, "Disables idle detection" },
|
||||||
|
{ MTAB_XTD|MTAB_VDV, 0, NULL, "REQ", &cpu_req, NULL, NULL, "Sends a request interrupt" },
|
||||||
{ 0 }
|
{ 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -342,6 +344,15 @@ t_stat cpu_reset (DEVICE *dptr)
|
||||||
return SCPE_OK;
|
return SCPE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Request routine
|
||||||
|
*/
|
||||||
|
t_stat cpu_req (UNIT *u, int32 val, char *cptr, void *desc)
|
||||||
|
{
|
||||||
|
GRP |= GRP_PANEL_REQ;
|
||||||
|
return SCPE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Write Unicode symbol to file.
|
* Write Unicode symbol to file.
|
||||||
* Convert to UTF-8 encoding:
|
* Convert to UTF-8 encoding:
|
||||||
|
|
|
@ -306,10 +306,22 @@ t_stat tty_attach (UNIT *u, char *cptr)
|
||||||
char gbuf[CBUFSIZE];
|
char gbuf[CBUFSIZE];
|
||||||
int r, m, n;
|
int r, m, n;
|
||||||
|
|
||||||
/* All arguments but the magic word "console" are passed
|
/* All arguments but the magic words "console" and "none" are passed
|
||||||
* to tmxr_attach().
|
* to tmxr_attach().
|
||||||
*/
|
*/
|
||||||
get_glyph (cptr, gbuf, 0);
|
get_glyph (cptr, gbuf, 0);
|
||||||
|
/* Disallowing future connections to a line */
|
||||||
|
if (strcmp (gbuf, "NONE") == 0) {
|
||||||
|
/* Marking the TTY as unusable. */
|
||||||
|
tty_line[num].conn = 1;
|
||||||
|
tty_line[num].rcve = 0;
|
||||||
|
if (num <= TTY_MAX) {
|
||||||
|
vt_mask &= ~(1 << (TTY_MAX - num));
|
||||||
|
tt_mask &= ~(1 << (TTY_MAX - num));
|
||||||
|
}
|
||||||
|
besm6_debug ("*** turning off T%03o", num);
|
||||||
|
return SCPE_OK;
|
||||||
|
}
|
||||||
if (strcmp (gbuf, "CONSOLE")) {
|
if (strcmp (gbuf, "CONSOLE")) {
|
||||||
/* Saving and restoring all .conn,
|
/* Saving and restoring all .conn,
|
||||||
* because tmxr_attach() zeroes them. */
|
* because tmxr_attach() zeroes them. */
|
||||||
|
@ -331,19 +343,7 @@ t_stat tty_attach (UNIT *u, char *cptr)
|
||||||
if (num <= TTY_MAX)
|
if (num <= TTY_MAX)
|
||||||
vt_mask |= 1 << (TTY_MAX - num);
|
vt_mask |= 1 << (TTY_MAX - num);
|
||||||
besm6_debug ("*** console on T%03o", num);
|
besm6_debug ("*** console on T%03o", num);
|
||||||
return 0;
|
return SCPE_OK;
|
||||||
}
|
|
||||||
/* Disallowing future connections to a line */
|
|
||||||
if (strcmp (gbuf, "NONE") == 0) {
|
|
||||||
/* Marking the TTY as unusable. */
|
|
||||||
tty_line[num].conn = 1;
|
|
||||||
tty_line[num].rcve = 0;
|
|
||||||
if (num <= TTY_MAX) {
|
|
||||||
vt_mask &= ~(1 << (TTY_MAX - num));
|
|
||||||
tt_mask &= ~(1 << (TTY_MAX - num));
|
|
||||||
}
|
|
||||||
besm6_debug ("*** turning off T%03o", num);
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
return SCPE_ALATT;
|
return SCPE_ALATT;
|
||||||
}
|
}
|
||||||
|
|
30
BESM6/expect.ini
Executable file
30
BESM6/expect.ini
Executable file
|
@ -0,0 +1,30 @@
|
||||||
|
# Attaching the input device
|
||||||
|
at fs0 input.txt
|
||||||
|
# Waiting for the end of initial setup
|
||||||
|
expect -r "ДATA.*\n"
|
||||||
|
do dispak.ini
|
||||||
|
# Now we're ready to send commands from the front panel
|
||||||
|
echo Requesting input from the punch tape reader (FS8)
|
||||||
|
d 6 1
|
||||||
|
d 5 10
|
||||||
|
set cpu req
|
||||||
|
expect -r "Л0.*\n"
|
||||||
|
go
|
||||||
|
|
||||||
|
# The process had been started, check state every 10 model seconds
|
||||||
|
send after=1000000 "WCPP\r"
|
||||||
|
expect -p -r "4199.*\n" send after=10000000 "WCPP\r"; go
|
||||||
|
expect -c "HET\r\n" step 10000
|
||||||
|
go
|
||||||
|
echo Enabling the printer (ONL A0)
|
||||||
|
d 6 10
|
||||||
|
d 5 1
|
||||||
|
set cpu req
|
||||||
|
expect -r "ECT.*\n"
|
||||||
|
go
|
||||||
|
echo Checking for the printing to finish
|
||||||
|
send "HOMB\r"
|
||||||
|
expect -p -r "4199.*\n" send "HOMB\r"; go
|
||||||
|
expect -c "HET\r\n"
|
||||||
|
go
|
||||||
|
echo Done
|
53
BESM6/input.txt
Normal file
53
BESM6/input.txt
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
ШИФР 419999 ЗС5^
|
||||||
|
EEВ1А3
|
||||||
|
*NAME PRIME NUMBERS
|
||||||
|
* The ^L char before *NAME is important
|
||||||
|
* NO LIST Disable source listing by removing spaces between * and NO
|
||||||
|
*NO LOAD LIST Enable loader listing by adding 5 spaces between * and NO
|
||||||
|
* Disabling fanfold page alignment
|
||||||
|
*CALL NOTLIS
|
||||||
|
*ASSEM
|
||||||
|
ETIME: ,NAME,
|
||||||
|
c Get time of day in jiffies
|
||||||
|
,*53 , 010B
|
||||||
|
c OR the integer exponent
|
||||||
|
,AOX , =6400000000000000
|
||||||
|
c F.p. divide by 50
|
||||||
|
,A/X , =R50.0
|
||||||
|
c Return
|
||||||
|
13 ,UJ ,
|
||||||
|
,END ,
|
||||||
|
*FTN
|
||||||
|
PROGRAM MAIN
|
||||||
|
PRINT 1000
|
||||||
|
1000 FORMAT(' Computing prime numbers the dumb way')
|
||||||
|
TIME0 = ETIME(0)
|
||||||
|
CALL PRIMES
|
||||||
|
TIME1 = ETIME(0)
|
||||||
|
NTIME = TIME1 - TIME0
|
||||||
|
PRINT 2000, NTIME
|
||||||
|
STOP
|
||||||
|
2000 FORMAT (' Time, seconds =', i6)
|
||||||
|
end
|
||||||
|
|
||||||
|
SUBROUTINE PRIMES
|
||||||
|
T=0
|
||||||
|
DO 10 N=1001, 100000, 2
|
||||||
|
MAXK=SQRT(N+0.0)+1
|
||||||
|
DO 20 K=3, MAXK, 2
|
||||||
|
M = (N / K) * K
|
||||||
|
IF (N .EQ. M) GOTO 10
|
||||||
|
20 CONTINUE
|
||||||
|
c------ Printing every 1000th prime number
|
||||||
|
T=T+1
|
||||||
|
IF (T .LT. 1000) GOTO 10
|
||||||
|
PRINT 1000, N
|
||||||
|
T=0
|
||||||
|
10 CONTINUE
|
||||||
|
RETURN
|
||||||
|
1000 FORMAT (1X, I9)
|
||||||
|
END
|
||||||
|
*EXECUTE
|
||||||
|
* The ^L char after *END FILE is important
|
||||||
|
*END FILE
|
||||||
|
ЕКОНЕЦ
|
Loading…
Add table
Reference in a new issue