pseudocode
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:17k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. ;============================================================================
  2. ;
  3. ; translate this with 
  4. ;  cat pseudocode | sed -f act2num |  awk -f compile.awk >pseudocode.h
  5. ;
  6. ; actionname pseudocode
  7. ;
  8. ;============================================================================
  9. ADM1 SEND_SABME_CMD(P=X)
  10. P_FLAG:=P
  11. START_ACK_TIMER
  12. RETRY_COUNT:=0
  13. S_FLAG:=0
  14. ;
  15. ; instructions in ADM2 have been changed:
  16. ; 1.  P_FLAG:=P is probably wrong in doc...
  17. ;  I think it should be F_FLAG:=P the way it is in CONN3
  18. ; 2. CONNECT_RESPONSE has been wired in here,
  19. ; CONN1 is no longer referenced
  20. ;
  21. ADM2 F_FLAG:=P
  22. SEND_UA_RSP(F=X)
  23. V(S):=0
  24. V(R):=0
  25. RETRY_COUNT:=0
  26. P_FLAG:=0
  27. REMOTE_BUSY:=0
  28. CONNECT_INDICATION
  29. ADM3 SEND_DM_RSP(F=X)
  30. ADM4 SEND_DM_RSP(F=X)
  31. ADM5 NOP
  32. ;============================================================================
  33. ;CONN1 SEND_UA_RSP(F=X)
  34. ; V(S):=0
  35. ; V(R):=0
  36. ; RETRY_COUNT:=0
  37. ; P_FLAG:=0
  38. ; REMOTE_BUSY:=0
  39. CONN2 SEND_DM_RSP(F=X)
  40. CONN3 F_FLAG:=P
  41. CONN4 DISCONNECT_INDICATION
  42. CONN5 NOP
  43. ;============================================================================
  44. RESWAIT1 SEND_SABME_CMD(P=X)
  45. P_FLAG:=P
  46. START_ACK_TIMER
  47. RETRY_COUNT:=0
  48. RESWAIT2 SEND_UA_RSP(F=X)
  49. V(S):=0
  50. V(R):=0
  51. RETRY_COUNT:=0
  52. P_FLAG:=0
  53. REMOTE_BUSY:=0
  54. RESET_CONFIRM
  55. RESWAIT3 SEND_DISC_CMD(P=X)
  56. P_FLAG:=P
  57. START_ACK_TIMER
  58. RETRY_COUNT:=0
  59. RESWAIT4 SEND_DM_RSP(F=X)
  60. RESWAIT5 DISCONNECT_INDICATION
  61. RESWAIT6 S_FLAG:=1
  62. F_FLAG:=P
  63. RESWAIT7 SEND_DM_RSP(F=X)
  64. DISCONNECT_INDICATION
  65. RESWAIT8 NOP
  66. ;============================================================================
  67. RESCHK1 SEND_UA_RSP(F=X)
  68. V(S):=0
  69. V(R):=0
  70. RETRY_COUNT:=0
  71. P_FLAG:=0
  72. REMOTE_BUSY:=0
  73. RESCHK2 SEND_DM_RSP(F=X)
  74. RESCHK3 DISCONNECT_INDICATION
  75. RESCHK4 F_FLAG:=P
  76. RESCHK5 SEND_DM_RSP(F=X)
  77. DISCONNECT_INDICATION
  78. RESCHK6 NOP
  79. ;============================================================================
  80. SETUP1 SEND_UA_RSP(F=X)
  81. V(S):=0
  82. V(R):=0
  83. RETRY_COUNT:=0
  84. S_FLAG:=1
  85. SETUP2 STOP_ACK_TIMER
  86. V(S):=0
  87. V(R):=0
  88. RETRY_COUNT:=0
  89. UPDATE_P_FLAG
  90. CONNECT_CONFIRM
  91. REMOTE_BUSY:=0
  92. SETUP3 P_FLAG:=0
  93. CONNECT_CONFIRM
  94. REMOTE_BUSY:=0
  95. SETUP4 SEND_DM_RSP(F=X)
  96. DISCONNECT_INDICATION
  97. STOP_ACK_TIMER
  98. SETUP5 DISCONNECT_INDICATION
  99. STOP_ACK_TIMER
  100. SETUP6 NOP
  101. SETUP7 SEND_SABME_CMD(P=X)
  102. P_FLAG:=P
  103. START_ACK_TIMER
  104. RETRY_COUNT:=RETRY_COUNT+1
  105. SETUP8 DISCONNECT_INDICATION
  106. ;============================================================================
  107. RESET1 SEND_UA_RSP(F=X)
  108. V(S):=0
  109. V(R):=0
  110. RETRY_COUNT:=0
  111. S_FLAG:=1
  112. RESET2 STOP_ACK_TIMER
  113. V(S):=0
  114. V(R):=0
  115. RETRY_COUNT:=0
  116. UPDATE_P_FLAG
  117. RESET_CONFIRM
  118. REMOTE_BUSY:=0
  119. RESET3 P_FLAG:=0
  120. RESET_CONFIRM
  121. REMOTE_BUSY:=0
  122. RESET4 SEND_DM_RSP(F=X)
  123. DISCONNECT_INDICATION
  124. STOP_ACK_TIMER
  125. RESET5 DISCONNECT_INDICATION
  126. STOP_ACK_TIMER
  127. RESET6 NOP
  128. RESET7 SEND_SABME_CMD(P=X)
  129. P_FLAG:=P
  130. START_ACK_TIMER
  131. RETRY_COUNT:=RETRY_COUNT+1
  132. RESET8 DISCONNECT_INDICATION
  133. ;============================================================================
  134. D_CONN1 SEND_DM_RSP(F=X)
  135. STOP_ACK_TIMER
  136. D_CONN2 STOP_ACK_TIMER
  137. D_CONN3 SEND_UA_RSP(F=X)
  138. D_CONN4 STOP_ACK_TIMER
  139. D_CONN5 NOP
  140. D_CONN6 SEND_DISC_CMD(P=X)
  141. P_FLAG:=P
  142. START_ACK_TIMER
  143. RETRY_COUNT:=RETRY_COUNT+1
  144. D_CONN7 NOP
  145. ;============================================================================
  146. ERR1 RESET_INDICATION(REMOTE)
  147. STOP_ACK_TIMER
  148. F_FLAG:=P
  149. ERR2 SEND_UA_RSP(F=X)
  150. DISCONNECT_INDICATION
  151. STOP_ACK_TIMER
  152. ERR3 DISCONNECT_INDICATION
  153. STOP_ACK_TIMER
  154. ERR4 RESET_INDICATION(LOCAL)
  155. STOP_ACK_TIMER
  156. REPORT_STATUS(FRMR_RECEIVED)
  157. S_FLAG:=0
  158. ERR5 RE-SEND_FRMR_RSP(F=P)
  159. START_ACK_TIMER
  160. ERR6 NOP
  161. ERR7 RE-SEND_FRMR_RSP(F=0)
  162. START_ACK_TIMER
  163. RETRY_COUNT:=RETRY_COUNT+1
  164. ERR8 S_FLAG:=0
  165. RESET_INDICATION(LOCAL)
  166. ;============================================================================
  167. ; the shared actions are common to states NORMAL, BUSY, REJECT,
  168. ; AWAIT, AWAIT_BUSY and AWAIT_REJECT.
  169. ;============================================================================
  170. SH1 SEND_DISC_CMD(P=X)
  171. P_FLAG:=P
  172. START_ACK_TIMER
  173. STOP_OTHER_TIMERS
  174. RETRY_COUNT:=0
  175. SH2 SEND_SABME_CMD(P=X)
  176. P_FLAG:=P
  177. START_ACK_TIMER
  178. STOP_OTHER_TIMERS
  179. RETRY_COUNT:=0
  180. S_FLAG:=0
  181. SH3 RESET_INDICATION(REMOTE)
  182. F_FLAG:=P
  183. STOP_ALL_TIMERS
  184. SH4 SEND_UA_RSP(F=X)
  185. DISCONNECT_INDICATION
  186. STOP_ALL_TIMERS
  187. SH5 STOP_ALL_TIMERS
  188. RESET_INDICATION(LOCAL)
  189. REPORT_STATUS(FRMR_RECEIVED)
  190. S_FLAG:=0
  191. SH6 DISCONNECT_INDICATION
  192. STOP_ALL_TIMERS
  193. SH7 SEND_FRMR_RSP(F=X)
  194. REPORT_STATUS(FRMR_SENT)
  195. START_ACK_TIMER
  196. STOP_OTHER_TIMERS
  197. RETRY_COUNT:=0
  198. SH8 SEND_FRMR_RSP(F=0)
  199. REPORT_STATUS(FRMR_SENT)
  200. START_ACK_TIMER
  201. STOP_OTHER_TIMERS
  202. RETRY_COUNT:=0
  203. SH9 SEND_FRMR_RSP(F=0)
  204. REPORT_STATUS(FRMR_SENT)
  205. START_ACK_TIMER
  206. STOP_OTHER_TIMERS
  207. RETRY_COUNT:=0
  208. SH10 SEND_FRMR_RSP(F=X)
  209. REPORT_STATUS(FRMR_SENT)
  210. START_ACK_TIMER
  211. STOP_OTHER_TIMERS
  212. RETRY_COUNT:=0
  213. SH11 STOP_ALL_TIMERS
  214. RESET_INDICATION(LOCAL)
  215. S_FLAG:=0
  216. ;============================================================================
  217. NORMAL1 SEND_I_CMD(P=1)
  218. START_P_TIMER
  219. START_ACK_TIMER_IF_NOT_RUNNING
  220. ; SEND_I_XXX(X=0)
  221. ; START_ACK_TIMER_IF_NOT_RUNNING
  222. NORMAL2 SEND_I_XXX(X=0)
  223. START_ACK_TIMER_IF_NOT_RUNNING
  224. NORMAL3 SEND_RNR_CMD(F=1)
  225. START_P_TIMER
  226. DATA_FLAG:=0
  227. ; SEND_RNR_XXX(X=0)
  228. ; DATA_FLAG:=0
  229. NORMAL4 SEND_RNR_XXX(X=0)
  230. DATA_FLAG:=0
  231. NORMAL5 SEND_REJ_XXX(X=0)
  232. UPDATE_N(R)_RECEIVED
  233. UPDATE_P_FLAG
  234. START_REJ_TIMER
  235. IF_F=1_CLEAR_REMOTE_BUSY
  236. ; SEND_REJ_CMD(P=1)
  237. ; UPDATE_N(R)_RECEIVED
  238. ; START_P_TIMER
  239. ; START_REJ_TIMER
  240. ; IF_F=1_CLEAR_REMOTE_BUSY
  241. NORMAL6 SEND_REJ_XXX(X=0)
  242. UPDATE_N(R)_RECEIVED
  243. START_REJ_TIMER
  244. NORMAL7 SEND_REJ_RSP(F=1)
  245. UPDATE_N(R)_RECEIVED
  246. START_REJ_TIMER
  247. ;
  248. ; the order of opcodes in NORMAL8 is changed.
  249. ; the transition table will execute NORMAL8A for incoming pdus
  250. ; with p/f 1, pdus with pf 0 are treated in NORMAL8B.
  251. ;   
  252. NORMAL8A V(R):=V(R)+1
  253. SEND_ACKNOWLEDGE_CMD(P=1)
  254. START_P_TIMER
  255. UPDATE_N(R)_RECEIVED
  256. IF_F=1_CLEAR_REMOTE_BUSY
  257. DATA_INDICATION
  258. ;
  259. NORMAL8B V(R):=V(R)+1
  260. UPDATE_P_FLAG
  261. SEND_ACKNOWLEDGE_XXX(X=0)
  262. UPDATE_N(R)_RECEIVED
  263. IF_F=1_CLEAR_REMOTE_BUSY
  264. DATA_INDICATION
  265. ;
  266. ; the order of opcodes in NORMAL9 is changed 
  267. NORMAL9 V(R):=V(R)+1
  268. SEND_ACKNOWLEDGE_XXX(X=0)
  269. UPDATE_N(R)_RECEIVED
  270. DATA_INDICATION
  271. ;
  272. ; the order of opcodes in NORMAL10 is changed 
  273. NORMAL10 V(R):=V(R)+1
  274. SEND_ACKNOWLEDGE_RSP(F=1)
  275. UPDATE_N(R)_RECEIVED
  276. DATA_INDICATION
  277. NORMAL11 UPDATE_P_FLAG
  278. UPDATE_N(R)_RECEIVED
  279. CLEAR_REMOTE_BUSY
  280. NORMAL12 SEND_ACKNOWLEDGE_RSP(F=1)
  281. UPDATE_N(R)_RECEIVED
  282. CLEAR_REMOTE_BUSY
  283. NORMAL13 UPDATE_P_FLAG
  284. UPDATE_N(R)_RECEIVED
  285. SET_REMOTE_BUSY
  286. NORMAL14 SEND_RR_RSP(F=1)
  287. UPDATE_N(R)_RECEIVED
  288. SET_REMOTE_BUSY
  289. NORMAL15 V(S):=N(R)
  290. UPDATE_N(R)_RECEIVED
  291. UPDATE_P_FLAG
  292. RE-SEND_I_XXX(X=0)
  293. CLEAR_REMOTE_BUSY
  294. ; V(S):=N(R)
  295. ; UPDATE_N(R)_RECEIVED
  296. ; START_P_TIMER
  297. ; RE-SEND_I_CMD(P=1)
  298. ; CLEAR_REMOTE_BUSY
  299. NORMAL16 V(S):=N(R)
  300. UPDATE_N(R)_RECEIVED
  301. RE-SEND_I_XXX(X=0)
  302. CLEAR_REMOTE_BUSY
  303. NORMAL17 V(S):=N(R)
  304. UPDATE_N(R)_RECEIVED
  305. RE-SEND_I_RSP(F=1)
  306. CLEAR_REMOTE_BUSY
  307. NORMAL18 SEND_RR_CMD(P=1)
  308. START_P_TIMER
  309. NORMAL19 P_FLAG:=0
  310. ; SEND_RR_CMD(P=1)
  311. ; START_P_TIMER
  312. ; RETRY_COUNT:=RETRY_COUNT+1
  313. NORMAL20 SEND_RR_CMD(P=1)
  314. START_P_TIMER
  315. RETRY_COUNT:=RETRY_COUNT+1
  316. ;============================================================================
  317. BUSY1 SEND_I_CMD(P=1)
  318. START_P_TIMER
  319. START_ACK_TIMER_IF_NOT_RUNNING
  320. ; SEND_I_XXX(X=0)
  321. ; START_ACK_TIMER_IF_NOT_RUNNING
  322. BUSY2 SEND_I_XXX(X=0)
  323. START_ACK_TIMER_IF_NOT_RUNNING
  324. BUSY3 SEND_REJ_CMD(P=1)
  325. START_REJ_TIMER
  326. START_P_TIMER
  327. ; SEND_REJ_XXX(X=0)
  328. ; START_REJ_TIMER
  329. BUSY4 SEND_REJ_XXX(X=0)
  330. START_REJ_TIMER
  331. BUSY5 SEND_RR_CMD(P=1)
  332. START_P_TIMER
  333. SEND_RR_XXX(X=0)
  334. BUSY6 SEND_RR_XXX(X=0)
  335. BUSY7 SEND_RR_CMD(P=1)
  336. START_P_TIMER
  337. SEND_RR_XXX(X=0)
  338. BUSY8 SEND_RR_XXX(X=0)
  339. BUSY9 OPTIONAL_SEND_RNR_XXX(X=0)
  340. UPDATE_P_FLAG
  341. UPDATE_N(R)_RECEIVED
  342. IF_DATA_FLAG_=0_THEN_DATA_FLAG:=1
  343. IF_F=1_CLEAR_REMOTE_BUSY
  344. ; SEND_RNR_CMD(P=1)
  345. ; START_P_TIMER
  346. ; UPDATE_N(R)_RECEIVED
  347. ; IF_DATA_FLAG_=0_THEN_DATA_FLAG:=1
  348. ; IF_F=1_CLEAR_REMOTE_BUSY
  349. BUSY10 OPTIONAL_SEND_RNR_XXX(X=0)
  350. UPDATE_N(R)_RECEIVED
  351. IF_DATA_FLAG_=0_THEN_DATA_FLAG:=1
  352. BUSY11 SEND_RNR_RSP(F=1)
  353. UPDATE_N(R)_RECEIVED
  354. IF_DATA_FLAG_=0_THEN_DATA_FLAG:=1
  355. BUSY12 SEND_RNR_RSP(F=1)
  356. UPDATE_N(R)_RECEIVED
  357. IF_DATA_FLAG=2_STOP_REJ_TIMER
  358. DATA_FLAG:=1
  359. ; V(R):=V(R)+1
  360. ; DATA_INDICATION
  361. ; SEND_RNR_RSP(F=1)
  362. ; UPDATE_N(R)_RECEIVED
  363. ; IF_DATA_FLAG=2_STOP_REJ_TIMER
  364. ; DATA_FLAG:=0
  365. BUSY13 OPTIONAL_SEND_RNR_XXX(X=0)
  366. UPDATE_P_FLAG
  367. UPDATE_N(R)_RECEIVED
  368. IF_DATA_FLAG=2_STOP_REJ_TIMER
  369. DATA_FLAG:=1
  370. IF_F=1_CLEAR_REMOTE_BUSY
  371. ; SEND_RNR_CMD(F=1)
  372. ; START_P_TIMER
  373. ; UPDATE_N(R)_RECEIVED
  374. ; IF_DATA_FLAG=2_STOP_REJ_TIMER
  375. ; DATA_FLAG:=1
  376. ; IF_F=1_CLEAR_REMOTE_BUSY
  377. ; V(R):=V(R)+1
  378. ; DATA_INDICATION
  379. ; SEND_RNR_CMD(F=1)
  380. ; START_P_TIMER
  381. ; UPDATE_N(R)_RECEIVED
  382. ; IF_DATA_FLAG=2_STOP_REJ_TIMER
  383. ; DATA_FLAG:=0
  384. ; IF_F=1_CLEAR_REMOTE_BUSY
  385. ; V(R):=V(R)+1
  386. ; DATA_INDICATION
  387. ; UPDATE_P_FLAG
  388. ; OPTIONAL_SEND_RNR_XXX(X=0)
  389. ; UPDATE_N(R)_RECEIVED
  390. ; IF_DATA_FLAG=2_STOP_REJ_TIMER
  391. ; DATA_FLAG:=0
  392. ; IF_F=1_CLEAR_REMOTE_BUSY
  393. BUSY14 OPTIONAL_SEND_RNR_XXX(X=0)
  394. UPDATE_N(R)_RECEIVED
  395. IF_DATA_FLAG=2_STOP_REJ_TIMER
  396. DATA_FLAG:=1
  397. ; V(R):=V(R)+1
  398. ; DATA_INDICATION
  399. ; OPTIONAL_SEND_RNR_XXX(X=0)
  400. ; UPDATE_N(R)_RECEIVED
  401. ; IF_DATA_FLAG=2_STOP_REJ_TIMER
  402. ; DATA_FLAG:=0
  403. BUSY15 UPDATE_P_FLAG
  404. UPDATE_N(R)_RECEIVED
  405. CLEAR_REMOTE_BUSY
  406. BUSY16 SEND_RNR_RSP(F=1)
  407. UPDATE_N(R)_RECEIVED
  408. CLEAR_REMOTE_BUSY
  409. BUSY17 UPDATE_P_FLAG
  410. UPDATE_N(R)_RECEIVED
  411. SET_REMOTE_BUSY
  412. BUSY18 SEND_RNR_RSP(F=1)
  413. UPDATE_N(R)_RECEIVED
  414. SET_REMOTE_BUSY
  415. BUSY19 V(S):=N(R)
  416. UPDATE_N(R)_RECEIVED
  417. UPDATE_P_FLAG
  418. RE-SEND_I_XXX(X=0)
  419. CLEAR_REMOTE_BUSY
  420. ; V(S):=N(R)
  421. ; UPDATE_N(R)_RECEIVED
  422. ; RE-SEND_I_CMD(P=1)
  423. ; CLEAR_REMOTE_BUSY
  424. BUSY20 V(S):=N(R)
  425. UPDATE_N(R)_RECEIVED
  426. RE-SEND_I_XXX(X=0)
  427. CLEAR_REMOTE_BUSY
  428. BUSY21 V(S):=N(R)
  429. UPDATE_N(R)_RECEIVED
  430. SEND_RNR_RSP(F=1)
  431. RE-SEND_I_XXX(X=0)
  432. CLEAR_REMOTE_BUSY
  433. BUSY22 SEND_RNR_CMD(F=1)
  434. START_P_TIMER
  435. BUSY23 P_FLAG:=0
  436. ; SEND_RNR_CMD(F=1)
  437. ; START_P_TIMER
  438. ; RETRY_COUNT:=RETRY_COUNT+1
  439. BUSY24 SEND_RNR_CMD(F=1)
  440. START_P_TIMER
  441. RETRY_COUNT:=RETRY_COUNT+1
  442. BUSY25 DATA_FLAG:=1
  443. ; SEND_RNR_CMD(F=1)
  444. ; START_P_TIMER
  445. ; RETRY_COUNT:=RETRY_COUNT+1
  446. ; DATA_FLAG:=1
  447. BUSY26 DATA_FLAG:=1
  448. ;============================================================================
  449. REJECT1 SEND_I_CMD(P=1)
  450. START_P_TIMER
  451. START_ACK_TIMER_IF_NOT_RUNNING
  452. ; SEND_I_XXX(X=0)
  453. ; START_ACK_TIMER_IF_NOT_RUNNING
  454. REJECT2 SEND_I_XXX(X=0)
  455. START_ACK_TIMER_IF_NOT_RUNNING
  456. REJECT3 SEND_RNR_CMD(F=1)
  457. START_P_TIMER
  458. DATA_FLAG:=2
  459. ; SEND_RNR_XXX(X=0)
  460. ; DATA_FLAG:=2
  461. REJECT4 SEND_RNR_XXX(X=0)
  462. DATA_FLAG:=2
  463. REJECT5 UPDATE_N(R)_RECEIVED
  464. UPDATE_P_FLAG
  465. IF_F=1_CLEAR_REMOTE_BUSY
  466. REJECT6 SEND_RR_RSP(F=1)
  467. UPDATE_N(R)_RECEIVED
  468. ;
  469. ; order of opcodes in REJECT7 is changed 
  470. REJECT7 V(R):=V(R)+1
  471. SEND_ACKNOWLEDGE_CMD(P=1)
  472. START_P_TIMER
  473. UPDATE_N(R)_RECEIVED
  474. IF_F=1_CLEAR_REMOTE_BUSY
  475. STOP_REJ_TIMER
  476. DATA_INDICATION
  477. ; V(R):=V(R)+1
  478. ; DATA_INDICATION
  479. ; UPDATE_P_FLAG
  480. ; SEND_ACKNOWLEDGE_XXX(X=0)
  481. ; UPDATE_N(R)_RECEIVED
  482. ; IF_F=1_CLEAR_REMOTE_BUSY
  483. ; STOP_REJ_TIMER
  484. ;
  485. ; order of opcodes in REJECT8 is changed 
  486. REJECT8 V(R):=V(R)+1
  487. SEND_ACKNOWLEDGE_XXX(X=0)
  488. UPDATE_N(R)_RECEIVED
  489. STOP_REJ_TIMER
  490. DATA_INDICATION
  491. ;
  492. ; order of opcodes in REJECT9 is changed 
  493. REJECT9 V(R):=V(R)+1
  494. SEND_ACKNOWLEDGE_RSP(F=1)
  495. UPDATE_N(R)_RECEIVED
  496. STOP_REJ_TIMER
  497. DATA_INDICATION
  498. REJECT10 UPDATE_P_FLAG
  499. UPDATE_N(R)_RECEIVED
  500. CLEAR_REMOTE_BUSY
  501. REJECT11 SEND_ACKNOWLEDGE_RSP(F=1)
  502. UPDATE_N(R)_RECEIVED
  503. CLEAR_REMOTE_BUSY
  504. REJECT12 UPDATE_P_FLAG
  505. UPDATE_N(R)_RECEIVED
  506. SET_REMOTE_BUSY
  507. REJECT13 SEND_RR_RSP(F=1)
  508. UPDATE_N(R)_RECEIVED
  509. SET_REMOTE_BUSY
  510. REJECT14 V(S):=N(R)
  511. UPDATE_N(R)_RECEIVED
  512. UPDATE_P_FLAG
  513. RE-SEND_I_XXX(X=0)
  514. CLEAR_REMOTE_BUSY
  515. ; V(S):=N(R)
  516. ; UPDATE_N(R)_RECEIVED
  517. ; RE-SEND_I_CMD(P=1)
  518. ; START_P_TIMER
  519. ; CLEAR_REMOTE_BUSY
  520. REJECT15 V(S):=N(R)
  521. UPDATE_N(R)_RECEIVED
  522. RE-SEND_I_XXX(X=0)
  523. CLEAR_REMOTE_BUSY
  524. REJECT16 V(S):=N(R)
  525. UPDATE_N(R)_RECEIVED
  526. RE-SEND_I_RSP(F=1)
  527. CLEAR_REMOTE_BUSY
  528. REJECT17 SEND_RR_CMD(P=1)
  529. START_P_TIMER
  530. REJECT18 SEND_REJ_CMD(P=1)
  531. START_P_TIMER
  532. START_REJ_TIMER
  533. RETRY_COUNT:=RETRY_COUNT+1
  534. REJECT19 P_FLAG:=0
  535. ; SEND_RR_CMD(P=1)
  536. ; START_P_TIMER
  537. ; START_REJ_TIMER
  538. ; RETRY_COUNT:=RETRY_COUNT+1
  539. REJECT20 SEND_RR_CMD(P=1)
  540. START_P_TIMER
  541. START_REJ_TIMER
  542. RETRY_COUNT:=RETRY_COUNT+1
  543. ;============================================================================
  544. AWAIT1 SEND_RNR_XXX(X=0)
  545. DATA_FLAG:=0
  546. AWAIT2 SEND_REJ_XXX(X=0)
  547. UPDATE_N(R)_RECEIVED
  548. V(S):=N(R)
  549. STOP_P_TIMER
  550. RE-SEND_I_XXX(X=0)
  551. START_REJ_TIMER
  552. CLEAR_REMOTE_BUSY
  553. ; SEND_REJ_CMD(P=1)
  554. ; UPDATE_N(R)_RECEIVED
  555. ; V(S):=N(R)
  556. ; RE-SEND_I_XXX(X=0)
  557. ; START_P_TIMER
  558. ; START_REJ_TIMER
  559. ; CLEAR_REMOTE_BUSY
  560. AWAIT3 SEND_REJ_XXX(X=0)
  561. UPDATE_N(R)_RECEIVED
  562. START_REJ_TIMER
  563. AWAIT4 SEND_REJ_RSP(F=1)
  564. UPDATE_N(R)_RECEIVED
  565. START_REJ_TIMER
  566. ;
  567. ; order of opcode in AWAIT5 changed
  568. AWAIT5 V(R):=V(R)+1
  569. UPDATE_N(R)_RECEIVED
  570. V(S):=N(R)
  571. RE-SEND_I_CMD(P=1)_OR_SEND_RR
  572. START_P_TIMER
  573. CLEAR_REMOTE_BUSY
  574. DATA_INDICATION
  575. ; V(R):=V(R)+1
  576. ; DATA_INDICATION
  577. ; STOP_P_TIMER
  578. ; UPDATE_N(R)_RECEIVED
  579. ; V(S):=N(R)
  580. ; RE-SEND_I_XXX(X=0)_OR_SEND_RR
  581. ; CLEAR_REMOTE_BUSY
  582. ;
  583. ; order of opcode in AWAIT6 changed
  584. AWAIT6 V(R):=V(R)+1
  585. SEND_RR_XXX(X=0)
  586. UPDATE_N(R)_RECEIVED
  587. DATA_INDICATION
  588. ;
  589. ; order of opcode in AWAIT7 changed
  590. AWAIT7 V(R):=V(R)+1
  591. SEND_RR_RSP(F=1)
  592. UPDATE_N(R)_RECEIVED
  593. DATA_INDICATION
  594. AWAIT8 UPDATE_N(R)_RECEIVED
  595. V(S):=N(R)
  596. STOP_P_TIMER
  597. RE-SEND_I_XXX(X=0)
  598. CLEAR_REMOTE_BUSY
  599. ; UPDATE_N(R)_RECEIVED
  600. ; V(S):=N(R)
  601. ; RE-SEND_I_CMD(P=1)
  602. ; START_P_TIMER
  603. ; CLEAR_REMOTE_BUSY
  604. AWAIT9 UPDATE_N(R)_RECEIVED
  605. CLEAR_REMOTE_BUSY
  606. AWAIT10 SEND_RR_RSP(F=1)
  607. UPDATE_N(R)_RECEIVED
  608. CLEAR_REMOTE_BUSY
  609. AWAIT11 UPDATE_N(R)_RECEIVED
  610. V(S):=N(R)
  611. STOP_P_TIMER
  612. SET_REMOTE_BUSY
  613. AWAIT12 UPDATE_N(R)_RECEIVED
  614. SET_REMOTE_BUSY
  615. AWAIT13 SEND_RR_RSP(F=1)
  616. UPDATE_N(R)_RECEIVED
  617. SET_REMOTE_BUSY
  618. AWAIT14 SEND_RR_CMD(P=1)
  619. START_P_TIMER
  620. RETRY_COUNT:=RETRY_COUNT+1
  621. ;============================================================================
  622. AWAIT_BUSY1 SEND_REJ_XXX(X=0)
  623. START_REJ_TIMER
  624. AWAIT_BUSY2 SEND_RR_XXX(X=0)
  625. AWAIT_BUSY3 SEND_RR_XXX(X=0)
  626. AWAIT_BUSY4 OPTIONAL_SEND_RNR_XXX(X=0)
  627. UPDATE_N(R)_RECEIVED
  628. V(S):=N(R)
  629. STOP_P_TIMER
  630. DATA_FLAG:=1
  631. CLEAR_REMOTE_BUSY
  632. RE-SEND_I_XXX(X=0)
  633. ; SEND_RNR_CMD(F=1)
  634. ; UPDATE_N(R)_RECEIVED
  635. ; V(S):=N(R)
  636. ; START_P_TIMER
  637. ; DATA_FLAG:=1
  638. ; CLEAR_REMOTE_BUSY
  639. ; RE-SEND_I_XXX(X=0)
  640. AWAIT_BUSY5 OPTIONAL_SEND_RNR_XXX(X=0)
  641. UPDATE_N(R)_RECEIVED
  642. DATA_FLAG:=1
  643. AWAIT_BUSY6 SEND_RNR_RSP(F=1)
  644. UPDATE_N(R)_RECEIVED
  645. DATA_FLAG:=1
  646. AWAIT_BUSY7 OPTIONAL_SEND_RNR_XXX(X=0)
  647. UPDATE_N(R)_RECEIVED
  648. V(S):=N(R)
  649. DATA_FLAG:=1
  650. STOP_P_TIMER
  651. CLEAR_REMOTE_BUSY
  652. RE-SEND_I_XXX(X=0)
  653. ; SEND_RNR_CMD(F=1)
  654. ; V(R):=V(R)+1
  655. ; DATA_INDICATION
  656. ; START_P_TIMER
  657. ; UPDATE_N(R)_RECEIVED
  658. ; V(S):=N(R)
  659. ; DATA_FLAG:=0
  660. ; CLEAR_REMOTE_BUSY
  661. ; RE-SEND_I_XXX(X=0)
  662. ; OPTIONAL_SEND_RNR_XXX(X=0)
  663. ; V(R):=V(R)+1
  664. ; DATA_INDICATION
  665. ; STOP_P_TIMER
  666. ; UPDATE_N(R)_RECEIVED
  667. ; V(S):=N(R)
  668. ; DATA_FLAG:=0
  669. ; CLEAR_REMOTE_BUSY
  670. ; RE-SEND_I_XXX(X=0)
  671. AWAIT_BUSY8 OPTIONAL_SEND_RNR_XXX(X=0)
  672. UPDATE_N(R)_RECEIVED
  673. DATA_FLAG:=1
  674. ; OPTIONAL_SEND_RNR_XXX(X=0)
  675. ; V(R):=V(R)+1
  676. ; DATA_INDICATION
  677. ; UPDATE_N(R)_RECEIVED
  678. ; DATA_FLAG:=0
  679. AWAIT_BUSY9 SEND_RNR_RSP(F=1)
  680. UPDATE_N(R)_RECEIVED
  681. DATA_FLAG:=1
  682. ; SEND_RNR_RSP(F=1)
  683. ; V(R):=V(R)+1
  684. ; DATA_INDICATION
  685. ; UPDATE_N(R)_RECEIVED
  686. ; DATA_FLAG:=0
  687. AWAIT_BUSY10 UPDATE_N(R)_RECEIVED
  688. V(S):=N(R)
  689. STOP_P_TIMER
  690. RE-SEND_I_XXX(X=0)
  691. CLEAR_REMOTE_BUSY
  692. ; UPDATE_N(R)_RECEIVED
  693. ; V(S):=N(R)
  694. ; RE-SEND_I_CMD(P=1)
  695. ; START_P_TIMER
  696. ; CLEAR_REMOTE_BUSY
  697. AWAIT_BUSY11 UPDATE_N(R)_RECEIVED
  698. CLEAR_REMOTE_BUSY
  699. AWAIT_BUSY12 SEND_RNR_RSP(F=1)
  700. UPDATE_N(R)_RECEIVED
  701. CLEAR_REMOTE_BUSY
  702. AWAIT_BUSY13 UPDATE_N(R)_RECEIVED
  703. V(S):=N(R)
  704. STOP_P_TIMER
  705. SET_REMOTE_BUSY
  706. AWAIT_BUSY14 UPDATE_N(R)_RECEIVED
  707. SET_REMOTE_BUSY
  708. AWAIT_BUSY15 SEND_RNR_RSP(F=1)
  709. UPDATE_N(R)_RECEIVED
  710. SET_REMOTE_BUSY
  711. AWAIT_BUSY16 SEND_RNR_CMD(F=1)
  712. START_P_TIMER
  713. RETRY_COUNT:=RETRY_COUNT+1
  714. ;============================================================================
  715. AWAIT_REJECT1 SEND_RNR_XXX(X=0)
  716. DATA_FLAG:=2
  717. AWAIT_REJECT2 UPDATE_N(R)_RECEIVED
  718. AWAIT_REJECT3 SEND_RR_RSP(F=1)
  719. UPDATE_N(R)_RECEIVED
  720. ;
  721. ; order of opcodes in AWAIT_REJECT4 changed
  722. AWAIT_REJECT4 V(R):=V(R)+1
  723. UPDATE_N(R)_RECEIVED
  724. V(S):=N(R)
  725. RE-SEND_I_CMD(P=1)_OR_SEND_RR
  726. START_P_TIMER
  727. STOP_REJ_TIMER
  728. CLEAR_REMOTE_BUSY
  729. DATA_INDICATION
  730. ; V(R):=V(R)+1
  731. ; DATA_INDICATION
  732. ; STOP_P_TIMER
  733. ; STOP_REJ_TIMER
  734. ; UPDATE_N(R)_RECEIVED
  735. ; V(S):=N(R)
  736. ; RE-SEND_I_CMD(P=1)_OR_SEND_RR
  737. ; CLEAR_REMOTE_BUSY
  738. ;
  739. ; order of opcodes in AWAIT_REJECT5 changed
  740. AWAIT_REJECT5 V(R):=V(R)+1
  741. SEND_RR_XXX(X=0)
  742. STOP_REJ_TIMER
  743. UPDATE_N(R)_RECEIVED
  744. DATA_INDICATION
  745. ;
  746. ; order of opcodes in AWAIT_REJECT6 changed
  747. AWAIT_REJECT6 V(R):=V(R)+1
  748. SEND_RR_RSP(F=1)
  749. STOP_REJ_TIMER
  750. UPDATE_N(R)_RECEIVED
  751. DATA_INDICATION
  752. AWAIT_REJECT7 UPDATE_N(R)_RECEIVED
  753. V(S):=N(R)
  754. STOP_P_TIMER
  755. RE-SEND_I_XXX(X=0)
  756. CLEAR_REMOTE_BUSY
  757. ; UPDATE_N(R)_RECEIVED
  758. ; V(S):=N(R)
  759. ; RE-SEND_I_CMD(P=1)
  760. ; START_P_TIMER
  761. ; CLEAR_REMOTE_BUSY
  762. AWAIT_REJECT8 UPDATE_N(R)_RECEIVED
  763. CLEAR_REMOTE_BUSY
  764. AWAIT_REJECT9 SEND_RR_RSP(F=1)
  765. UPDATE_N(R)_RECEIVED
  766. CLEAR_REMOTE_BUSY
  767. AWAIT_REJECT10 UPDATE_N(R)_RECEIVED
  768. V(S):=N(R)
  769. STOP_P_TIMER
  770. SET_REMOTE_BUSY
  771. AWAIT_REJECT11 UPDATE_N(R)_RECEIVED
  772. SET_REMOTE_BUSY
  773. AWAIT_REJECT12 SEND_RR_RSP(F=1)
  774. UPDATE_N(R)_RECEIVED
  775. SET_REMOTE_BUSY
  776. AWAIT_REJECT13 SEND_REJ_CMD(P=1)
  777. START_P_TIMER
  778. RETRY_COUNT:=RETRY_COUNT+1
  779. ;============================================================================