PDP8: Annotate fall through paths in switch statements
The code is a bit difficult to understand, but it represents the 'normal' path for processing a DECtape word. The code always flows all the way to the break. For start of block, there's extra code to check for a timing error; but then the first word is processed (case 0). For a normal word, a 3-cycle data break is done - increment word count and current address, check for word count overflow, put the word in the buffer; but then check for end of block (case DTO_WCO). If the word count has already overflowed, just check for end of block. So yes, the end of case 0 should be labeled 'fall through' as well. FNC_WRIT has the same structure and needs the same comment.
This commit is contained in:
parent
c2c1f04e8a
commit
c97f466457
1 changed files with 7 additions and 3 deletions
|
@ -798,11 +798,12 @@ switch (fnc) { /* at speed, check fnc *
|
|||
return SCPE_OK;
|
||||
}
|
||||
if (DEBUG_PRI (dt_dev, LOG_RW) ||
|
||||
(DEBUG_PRI (dt_dev, LOG_BL) && (blk == dt_logblk)))
|
||||
(DEBUG_PRI (dt_dev, LOG_BL) && (blk == dt_logblk)))
|
||||
fprintf (sim_deb, ">>DT%d: reading block %d %s%s\n",
|
||||
unum, blk, (dir? "backward": "forward"),
|
||||
((dtsa & DTA_MODE)? " continuous": " "));
|
||||
dt_substate = 0; /* fall through */
|
||||
dt_substate = 0;
|
||||
/* fall through */
|
||||
case 0: /* normal read */
|
||||
M[DT_WC] = (M[DT_WC] + 1) & 07777; /* incr WC, CA */
|
||||
M[DT_CA] = (M[DT_CA] + 1) & 07777;
|
||||
|
@ -815,6 +816,7 @@ switch (fnc) { /* at speed, check fnc *
|
|||
M[ma] = dat;
|
||||
if (M[DT_WC] == 0) /* wc ovf? */
|
||||
dt_substate = DTO_WCO;
|
||||
/* fall through */
|
||||
case DTO_WCO: /* wc ovf, not sob */
|
||||
if (wrd != (dir? 0: DTU_BSIZE (uptr) - 1)) /* not last? */
|
||||
sim_activate (uptr, DT_WSIZE * dt_ltime);
|
||||
|
@ -861,10 +863,12 @@ switch (fnc) { /* at speed, check fnc *
|
|||
fprintf (sim_deb, ">>DT%d: writing block %d %s%s\n", unum, blk,
|
||||
(dir? "backward": "forward"),
|
||||
((dtsa & DTA_MODE)? " continuous": " "));
|
||||
dt_substate = 0; /* fall through */
|
||||
dt_substate = 0;
|
||||
/* fall through */
|
||||
case 0: /* normal write */
|
||||
M[DT_WC] = (M[DT_WC] + 1) & 07777; /* incr WC, CA */
|
||||
M[DT_CA] = (M[DT_CA] + 1) & 07777;
|
||||
/* fall through */
|
||||
case DTO_WCO: /* wc ovflo */
|
||||
ma = DTB_GETMEX (dtsb) | M[DT_CA]; /* get mem addr */
|
||||
ba = (blk * DTU_BSIZE (uptr)) + wrd; /* buffer ptr */
|
||||
|
|
Loading…
Add table
Reference in a new issue