Source code that runs VTL-2 on my fake 6801 simulator based on Joe H. Allen's EXORsim. Should be modifiable to run on a variety of hardware, No longer uses stack blasting, which will play nicer with interrupts. Can be assembled with my asm68c. The & and * variables are set automatically now because of the variable relocation (initialization code corrected for fix for CPX in EXORsim).

格式
Asm
Post date
2022-09-03 17:40
Publication Period
Unlimited
  1. OPT 6801
  2. * VTL-2 for 6801
  3. * V-3.6
  4. * 9-23-76
  5. * BY GARY SHANNON
  6. * & FRANK MCCOY
  7. * COPYWRIGHT 1976, THE COMPUTER STORE
  8. *
  9. * Modifications for 6801 fake on exorsim
  10. * and for moving variables out of direct page
  11. * by Joel Matthew Rees
  12. * Copyright 2022, Joel Matthew Rees
  13. * Starting with low-hanging fruit.
  14. * Modifications explained at
  15. * https://joels-programming-fun.blogspot.com/2022/08/vtl-2-part-3-optimizing-for-6801.html
  16. *
  17. * DEFINE LOCATIONS IN MONITOR
  18. * INCH EQU $FF00 ; per VTL.ASM
  19. EINCH EQU $F012 ; exorsim mdos Input byte with echo unless AECHO is set
  20. * INCH EQU $F015 ; exorsim mdos Input char with echo (F012 -> strip bit 7)
  21. * POLCAT EQU $FF24 ; from VTL.ASM
  22. * OUTCH EQU $FF81 ; from VTL.ASM
  23. EOUTCH EQU $F018 ; exorsim mdos Output character with NULs
  24. * OUTS EQU $FF82 ; from VTL.ASM
  25. EPCRLF EQU $F021 ; Primarily for forced initialization in exorsim.
  26. *
  27. * FOR SBC6800:
  28. BREAK EQU $1B ; BREAK KEY
  29. * For exorsim
  30. ACIACS EQU $FCF4 ; exorcisor
  31. ACIADA EQU $FCF5 ; exorcisor
  32. *
  33. * A few interpreter variables in the direct page won't hurt.
  34. * (Yes, I can hear voices of complaint that it's not as "tight" as it could be.)
  35. * (This allows us to save more ROM space and uses DP that would otherwise go wasted.)
  36. * (Trade-offs.)
  37. * (It also helps us understand the code, so we can do a better 6809 transliteration.)
  38. * (I hope the names are meaningful.)
  39. ORG $80 ; Move this according to your environment's needs.
  40. PARSET RMB 2 ; Instead of SAVE0 in TERM/NXTRM
  41. CVTSUM RMB 2 ; Instead of SAVE1 in CBLOOP
  42. MLDVCT EQU CVTSUM ; Instead of SAVE1 in mul/div (1 byte only)
  43. DIVQUO RMB 2 ; Instead of SAVE2 in DIV
  44. MPLIER EQU DIVQUO ; Instead of SAVE2 in MULTIP
  45. EVALPT RMB 2 ; Instead of SAVE3
  46. CNVPTR RMB 2 ; Instead of SAVE4
  47. VARADR RMB 2 ; Instead of SAVE6
  48. OPRLIN RMB 2 ; Instead of SAVE7
  49. EDTLIN RMB 2 ; Instead of SAVE8
  50. INSPTR RMB 2 ; Instead of SAVE10 (maybe? Will some VTL programs want it back?)
  51. SAVLIN RMB 2 ; Instead of SAVE11
  52. SRC RMB 2 ; For copy routine
  53. DST RMB 2 ; ditto
  54. *
  55. * SET ASIDE FOUR BYTES FOR USER
  56. * DEFINED INTERUPT ROUTINE IF NEEDED
  57. ORG $0200
  58. * ZERO must be set at even $100 boundary for address math to work.
  59. ZERO RMB 4 ; INTERUPT VECTOR
  60. AT RMB 2 ; CANCEL & C-R
  61. *
  62. * GENERAL PURPOSE STORRGE
  63. VARS RMB 52 ; VARIABLES(A-Z)
  64. BRAK RMB 2 ; [
  65. * SAVE10 has me worried about implicit linkage in VTL programs. Might need to leave it here.
  66. SAVE10 RMB 2 ; BACK SLASH
  67. BRIK RMB 2 ; ]
  68. UP RMB 2 ; ^
  69. SAVE11 RMB 2 ; Need something in each SAVE to reserve space
  70. * ; to keep the math straight.
  71. * ; Leave the SAVEs declared as they are.
  72. *
  73. SAVE14 RMB 2 ; SPACE (originally unused)
  74. EXCL RMB 2 ; !
  75. QUOTE RMB 2 ; "
  76. DOLR RMB 2 ; #
  77. DOLLAR RMB 2 ; $
  78. REMN RMB 2 ; %
  79. AMPR RMB 2 ; &
  80. QUITE RMB 2 ; '
  81. PAREN RMB 2 ; (
  82. PARIN RMB 2 ; )
  83. STAR RMB 2 ; *
  84. PLUS RMB 2 ; +
  85. COMA RMB 2 ; ,
  86. MINS RMB 2 ; -
  87. PERD RMB 2 ; .
  88. SLASH RMB 2 ; /
  89. *
  90. SAVE0 RMB 2 ; unused
  91. SAVE1 RMB 2 ; unused
  92. SAVE2 RMB 2 ; unused
  93. SAVE3 RMB 2 ; unused
  94. SAVE4 RMB 2 ; unused
  95. SAVE5 RMB 2 ; unused (PSH/PULX)
  96. SAVE6 RMB 2 ; unused
  97. SAVE7 RMB 2 ; unused
  98. SAVE8 RMB 2 ; unused
  99. SAVE9 RMB 2 ; unused (PSH/PULX)
  100. COLN RMB 2 ; :
  101. SEMI RMB 2 ; ;
  102. LESS RMB 2 ; <
  103. EQAL RMB 2 ; =
  104. GRRT RMB 1 ; >
  105. DECB_1 RMB 1
  106. *
  107. DECBUF RMB 4
  108. LASTD RMB 1
  109. DELIM RMB 1
  110. LINLEN EQU 72
  111. LINBUF RMB LINLEN+1
  112. BUFOFF EQU LINBUF-ZERO ; Unmagic 87. Some assemblers will cough at this.
  113. *
  114. ORG $02F1
  115. STACK RMB 1
  116. *
  117. ORG $0300
  118. MI RMB 4 ; INTERUPT VECTORS
  119. NMI RMB 4
  120. PRGM EQU * ; PROGRAM STARTS HERE
  121. * Must have some RAM here.
  122. *
  123. ORG $7800
  124. *
  125. * The COLD boot can be removed or ignored to restore the original behavior,
  126. * but if you do that don't forget to set & (AMPR) and * (STAR) values
  127. * by hand immediately after STARTing.
  128. *
  129. * Also, instead of PROBEing, if you know the limits for a particular ROM
  130. * application, you can set STAR directly:
  131. * LDX #PRGM
  132. * STX AMPR
  133. * LDX #RAMLIM
  134. * STX STAR
  135. * START ...
  136. *
  137. COLD LDS #STACK ; S on 6800 is first free byte on stack.
  138. JSR TRMINI
  139. LDX #PRGM ; initialize program area base
  140. STX AMPR
  141. LDAA #$5A ; Probe RAM limit
  142. LDAB #$A5
  143. BRA PROBET
  144. PROBE STAA 0,X
  145. CMPA 0,X
  146. BNE NOTRAM
  147. STAB 0,X
  148. CMPB 0,X
  149. BNE NOTRAM
  150. INX ; all bits seem to be R/W.
  151. PROBET CPX #COLD
  152. BLO PROBE ; CPX on 6801 works right.
  153. NOTRAM DEX
  154. STX STAR
  155. START LDS #STACK ; re-initialize at beginning of each evaluate
  156. CLRA ; NUL delimiter
  157. LDX #OKM
  158. BSR STRGT
  159. *
  160. LOOP CLRA
  161. STAA DOLR
  162. STAA DOLR+1
  163. JSR CVTLN
  164. BCC STMNT ; NO LINE# THEN EXEC
  165. BSR EXEC
  166. BEQ START
  167. *
  168. LOOP2 BSR FIND ; FIND LINE
  169. EQSTRT BEQ START ; IF END THEN STOP
  170. LDX 0,X ; LOAD REAL LINE #
  171. STX DOLR ; SAVE IT
  172. LDX SAVLIN ; GET LINE
  173. INX ; BUMP PAST LINE #
  174. INX ; BUMP PAST LINE #
  175. INX ; BUMP PAST SPACE
  176. BSR EXEC ; EXECUTE IT
  177. BEQ LOOP3 ; IF ZERO, CONTINUE
  178. LDX SAVLIN ; FIND LINE
  179. LDX 0,X ; GET IT
  180. CPX DOLR ; HAS IT CHANGED?
  181. BEQ LOOP3 ; IF NOT GET NEXT
  182. *
  183. INX ; INCREMENT OLD LINE#
  184. STX EXCL ; SAVE FOR RETURN
  185. BRA LOOP2 ; CONTINUE
  186. *
  187. LOOP3 BSR FND3 ; FIND NEXT LINE
  188. BRA EQSTRT ; CONTINUE
  189. *
  190. EXEC STX OPRLIN ; EXECUTE LINE
  191. JSR VAR2
  192. INX
  193. *
  194. SKIP LDAA 0,X ; GET FIRST TERM
  195. BSR EVIL ; EVALUATE EXPRESSION
  196. OUTX LDX DOLR ; GET LINE #
  197. RTS
  198. *
  199. EVIL CMPA #$22 ; IF " THEN BRANCH
  200. BNE EVALU
  201. INX
  202. STRGT JMP STRING ; TO PRINT IT
  203. *
  204. STMNT STX EDTLIN ; SAVE LINE #
  205. STD DOLR
  206. LDX DOLR
  207. BNE SKP2 ; IF LINE# <> 0
  208. *
  209. LDX #PRGM ; LIST PROGRAM
  210. LST2 CPX AMPR ; END OF PROGRAM
  211. BEQ EQSTRT
  212. STX SAVLIN ; LINE # FOR CVDEC
  213. LDD 0,X
  214. JSR PRNT2
  215. LDX SAVLIN
  216. INX
  217. INX
  218. JSR PNTMSG
  219. JSR CRLF
  220. BRA LST2
  221. *
  222. NXTXT LDX SAVLIN ; GET POINTER
  223. INX ; BUMP PAST LINE#
  224. LOOKAG INX ; FIND END OF LINE
  225. TST 0,X
  226. BNE LOOKAG
  227. INX
  228. RTS
  229. *
  230. FIND LDX #PRGM ; FIND LINE
  231. FND2 STX SAVLIN
  232. CPX AMPR
  233. BEQ RTS1
  234. * LDAA 1,X ; almost missed this.
  235. * SUBA DOLR+1 ; This was necessary because no SUBD
  236. * LDAA 0,X ; and CPX does not affect C flag on 6800
  237. * SBCA DOLR
  238. * PSHB ; B does not seem to be in use.
  239. LDD 0,X ; Use D because we think we want to keep X.
  240. SUBD DOLR
  241. * PULB
  242. BCC SET
  243. FND3 BSR NXTXT
  244. BRA FND2
  245. *
  246. SET LDAA #$FF ; SET NOT EQUAL
  247. RTS1 RTS
  248. *
  249. EVALU JSR EVAL ; EVALUATE LINE
  250. PSHB
  251. PSHA
  252. LDX OPRLIN
  253. JSR CONVP
  254. PULA
  255. CMPB #'$ ; STRING?
  256. BNE AR1
  257. PULB
  258. JMP OUTCH ; THEN PRINT IT
  259. AR1 SUBB #'? ; PRINT?
  260. BNE AR11 ; was out of range.
  261. JMP PRNT ; THEN DO IT
  262. * BEQ PRNT ; When we bring it back within range.
  263. AR11 INCB ; MACHINE LANGUAGE?
  264. PULB
  265. BNE AR2
  266. SWI ; THEN INTERUPT
  267. *
  268. AR2 STD 0,X ; STORE NEW VALUE
  269. ADDD QUITE ; RANDOMIZER
  270. STD QUITE
  271. RTS
  272. *
  273. SKP2 BSR FIND ; FIND LINE
  274. BEQ INSRT ; IF NOT THERE
  275. LDX 0,X ; THEN INSERT
  276. CPX DOLR ; NEW LINE
  277. BNE INSRT
  278. *
  279. BSR NXTXT ; SETUP REGISTERS
  280. * LDS SAVLIN ; FOR DELETE
  281. STX SRC
  282. LDX SAVLIN
  283. STX DST
  284. *
  285. DELT LDX SRC
  286. CPX AMPR ; DELETE OLD LINE
  287. BEQ FITIT
  288. LDAA 0,X
  289. INX
  290. STX SRC
  291. * PSHA
  292. * INX
  293. * INS
  294. * INS
  295. LDX DST
  296. STA 0,X
  297. INX
  298. STX DST
  299. BRA DELT
  300. *
  301. * FITIT STS AMPR ; STORE NEW END
  302. FITIT LDX DST
  303. STX AMPR ; STORE NEW END
  304. *
  305. INSRT LDX EDTLIN ; COUNT NEW LINE LENGTH
  306. LDAB #$03
  307. TST 0,X
  308. BEQ GOTIT ; IF NO LINE THEN STOP
  309. CNTLN INCB ; count bytes
  310. INX
  311. TST 0,X ; Find trailing NUL
  312. BNE CNTLN
  313. *
  314. OPEN CLRA ; CALCULATE NEW END
  315. ADDD AMPR
  316. STD INSPTR
  317. SUBD STAR
  318. BCC RSTRT ; IF TOO BIG THEN STOP
  319. LDX AMPR
  320. * LDS INSPTR ; remember that the 6800/6801 stack is postdecrement push.
  321. * STS AMPR
  322. LDD INSPTR ; remember that the 6800/6801 stack is postdecrement push.
  323. STD AMPR
  324. *
  325. * LDS AMPR
  326. STD DST
  327. INX ; SLIDE OPEN GAP
  328. SLIDE DEX ; going down
  329. STX SRC
  330. LDAB 0,X
  331. * PSHB ; stack blast it
  332. LDX DST
  333. STAB 0,X ; mimic 6800 push
  334. DEX
  335. STX DST
  336. LDX SRC
  337. CPX SAVLIN
  338. BHI SLIDE
  339. *
  340. * DON LDS DOLR ; STORE LINE #
  341. * STS 0,X
  342. DON LDD DOLR ; STORE LINE #
  343. STD 0,X
  344. STX DST ; will skip by offset store
  345. * LDS EDTLIN ; GET NEW LINE
  346. * DES ; pre-increment
  347. LDD EDTLIN ; GET NEW LINE
  348. STD SRC
  349. *
  350. *MOVL INX ; INSERT NEW LINE (skip over LINE # hi byte)
  351. * PULB
  352. * STAB 1,X ; (skips over low byte, BTW)
  353. MOVL LDX SRC
  354. LDAB 0,X
  355. INX
  356. STX SRC
  357. LDX DST
  358. INX ; skip over what was already stored (too tricky for words).
  359. STX DST
  360. STAB 1,X ; note offset store
  361. BNE MOVL ; until NUL stored
  362. *
  363. GOTIT LDS #STACK ; Ready for a new line of input.
  364. JMP LOOP
  365. *
  366. RSTRT JMP START ; warm start over
  367. *
  368. PRNT PULB ; PRINT DECIMAL
  369. PRNT2 LDX #DECBUF ; CONVERT TO DECIMAL
  370. STX CNVPTR
  371. LDX #PWRS10
  372. CVD1 PSHX
  373. LDX 0,X
  374. STX VARADR
  375. LDX #VARADR
  376. JSR DIVIDE
  377. PSHA
  378. LDX CNVPTR
  379. LDAA DIVQUO+1
  380. ADDA #'0
  381. STAA 0,X
  382. PULA
  383. INX
  384. STX CNVPTR
  385. PULX
  386. INX
  387. INX
  388. TST 1,X
  389. BNE CVD1
  390. *
  391. LDX #DECB_1
  392. COM 5,X ; ZERO SUPPRESS
  393. ZRSUP INX
  394. LDAB 0,X
  395. CMPB #'0
  396. BEQ ZRSUP
  397. COM LASTD
  398. *
  399. PNTMSG CLRA ; ZERO FOR DELIM
  400. STRTMS STAA DELIM ; STORE DELIMTER
  401. *
  402. OUTMSG LDAB 0,X ; GENERAL PURPOSE PRINT
  403. INX
  404. CMPB DELIM
  405. BEQ CTLC
  406. JSR OUTCH
  407. BRA OUTMSG
  408. *
  409. CTLC JSR POLCAT ; POL FOR CHARACTER
  410. BCC RTS2
  411. BSR INCH2
  412. CMPB #BREAK ; BREAK KEY?
  413. BEQ RSTRT
  414. *
  415. INCH2 JMP INCH
  416. *
  417. STRING BSR STRTMS ; PRINT STRING LITERAL
  418. LDAA 0,X
  419. CMPA #';
  420. BEQ OUTD
  421. JMP CRLF
  422. *
  423. EVAL BSR GETVAL ; EVALUATE EXPRESSION
  424. *
  425. NXTRM PSHA
  426. LDAA 0,X ; END OF LINE?
  427. BEQ OUTN
  428. CMPA #')
  429. OUTN PULA
  430. BEQ OUTD
  431. BSR TERM
  432. LDX PARSET
  433. BRA NXTRM
  434. *
  435. TERM PSHA ; GET VALUE
  436. PSHB
  437. LDAA 0,X
  438. PSHA
  439. INX
  440. BSR GETVAL
  441. STD EVALPT
  442. STX PARSET
  443. LDX #EVALPT
  444. PULA
  445. PULB
  446. *
  447. CMPA #'* ; SEE IF *
  448. BNE EVAL2
  449. PULA ; MULTIPLY
  450. MULTIP STD MPLIER ; 2'S COMPLEMENT
  451. LDAB #$10
  452. STAB MLDVCT
  453. CLRA
  454. CLRB
  455. *
  456. MULT LSR MPLIER
  457. ROR MPLIER+1
  458. BCC NOAD
  459. MULTI ADDD 0,X
  460. NOAD ASL 1,X
  461. ROL 0,X
  462. DEC MLDVCT
  463. BNE MULT ; LOOP TIL DONE
  464. RTS2 RTS
  465. *
  466. GETVAL JSR CVBIN ; GET VALUE
  467. BCC OUTV
  468. CMPB #'? ; OF LITERAL
  469. BNE VAR
  470. PSHX ; OR INPUT
  471. JSR INLN
  472. BSR EVAL
  473. PULX
  474. OUTD INX
  475. OUTV RTS
  476. *
  477. VAR CMPB #'$ ; OR STRING
  478. BNE VAR1
  479. BSR INCH2
  480. CLRA
  481. INX
  482. RTS
  483. *
  484. VAR1 CMPB #'(
  485. BNE VAR2
  486. INX
  487. BRA EVAL
  488. *
  489. VAR2 BSR CONVP ; OR VARIABLE
  490. LDD 0,X ; OR ARRAY ELEMENT
  491. LDX VARADR ; LOAD OLD INDEX
  492. RTS
  493. *
  494. ARRAY JSR EVAL ; LOCATE ARRAY ELEMENT
  495. ASLD
  496. ADDD AMPR
  497. BRA PACK
  498. *
  499. CONVP LDAB 0,X ; GET LOCATION
  500. INX
  501. PSHB
  502. CMPB #':
  503. BEQ ARRAY ; OF VARIABLE OR
  504. CLRA ; ARRAY ELEMENT
  505. ANDB #$3F ; mask out-of-variable-range
  506. ADDB #$02 ; bump past "interrupt vectors"
  507. ASLB ; make into offset (would be address in DP in original)
  508. ADDD #ZERO ; The 6801 can do this right.
  509. *
  510. PACK STX VARADR ; STORE OLD INDEX
  511. STD CNVPTR
  512. LDX CNVPTR ; LOAD NEW INDEX
  513. PULB
  514. RTS
  515. *
  516. EVAL2 CMPA #'+ ; ADDITION
  517. BNE EVAL3
  518. PULA
  519. ADD ADDD 0,X
  520. RTS
  521. *
  522. EVAL3 CMPA #'- ; SUBTRACTION
  523. BNE EVAL4
  524. PULA
  525. SUBTR SUBD 0,X
  526. RTS
  527. *
  528. EVAL4 CMPA #'/ ; SEE IF IT'S DIVIDE
  529. BNE EVAL5
  530. PULA
  531. BSR DIVIDE
  532. STD REMN
  533. LDD DIVQUO
  534. RTS
  535. *
  536. EVAL5 SUBA #'= ; SEE IF EQUAL TEST
  537. BNE EVAL6
  538. PULA
  539. BSR SUBTR
  540. BNE NOTEQ
  541. TSTB
  542. BEQ EQL
  543. NOTEQ LDAB #$FF
  544. EQL BRA COMBOUT
  545. *
  546. EVAL6 DECA ; SEE IF LESS THAN TEST
  547. PULA
  548. BEQ EVAL7
  549. *
  550. SUB2 BSR SUBTR
  551. ROLB
  552. COMOUT CLRA
  553. ANDB #$01
  554. RTS
  555. *
  556. EVAL7 BSR SUB2 ; GT TEST
  557. COMBOUT COMB
  558. BRA COMOUT
  559. *
  560. PWRS10 FCB $27 ; 10000
  561. FCB $10
  562. FCB $03 ; 1000
  563. FCB $E8
  564. FCB $00 ; 100
  565. FCB $64
  566. FCB $00 ; 10
  567. FCB $0A
  568. FCB $00 ; 1
  569. FCB $01
  570. *
  571. DIVIDE CLR MLDVCT ; DEVIDE 16-BITS
  572. GOT INC MLDVCT
  573. ASL 1,X
  574. ROL 0,X
  575. BCC GOT
  576. ROR 0,X
  577. ROR 1,X
  578. CLR DIVQUO
  579. CLR DIVQUO+1
  580. DIV2 BSR SUBTR
  581. BCC OK
  582. ADDD 0,X
  583. CLC
  584. BRA DIVNOC ; instead of the trick
  585. * The 6801 CPX affects all relevant flags, can't use this trick.
  586. * FCB $9C ; CPX
  587. OK SEC ; $0D
  588. DIVNOC ROL DIVQUO+1
  589. ROL DIVQUO
  590. DEC MLDVCT
  591. BEQ DONE
  592. LSR 0,X
  593. ROR 1,X
  594. BRA DIV2
  595. *
  596. TSTN LDAB 0,X ; TEST FOR NUMERIC
  597. CMPB #$3A
  598. BPL NOTDEC
  599. CMPB #'0
  600. BGE DONE
  601. NOTDEC SEC
  602. RTS
  603. DONE CLC
  604. DUN RTS
  605. *
  606. CVTLN BSR INLN
  607. *
  608. CVBIN BSR TSTN ; CONVERT TO BINARY
  609. BCS DUN
  610. CONT CLRA
  611. CLRB
  612. CBLOOP ADDB 0,X
  613. ADCA #$00
  614. SUBB #'0
  615. SBCA #$00
  616. STD CVTSUM
  617. INX
  618. PSHB
  619. BSR TSTN
  620. PULB
  621. BCS DONE
  622. ASLD
  623. ASLD
  624. ADDD CVTSUM
  625. ASLD
  626. BRA CBLOOP
  627. *
  628. INLN6 CMPB #'@ ; CANCEL
  629. BEQ NEWLIN
  630. INX ; '.'
  631. CPX #ZERO+LINLEN+2 ; (Here's part of what we had to fix for moving the variables.)
  632. BNE INLN2
  633. NEWLIN BSR CRLF
  634. *
  635. INLN LDX #ZERO+2 ; INPUT LINE FROM TERMINAL
  636. INLN5 DEX
  637. CPX #ZERO ; Make this explicit to enable variables moved out of DP.
  638. BEQ NEWLIN ; (Was implicit zero compare X from DEX, now explicit.)
  639. INLN2 JSR INCH ; INPUT CHARACTER
  640. STAB BUFOFF-1,X ; STORE IT
  641. CMPB #$5F ; BACKSPACE?
  642. BEQ INLN5
  643. *
  644. INLIN3 CMPB #$0D ; CARRIAGE RETURN
  645. BMI INLN2
  646. BNE INLN6
  647. *
  648. INLIN4 CLR BUFOFF-1,X ; CLEAR LAST CHAR
  649. LDX #LINBUF
  650. BRA LF
  651. *
  652. * CRLF JSR EPCRLF
  653. CRLF LDAB #$0D ; CARR-RET
  654. BSR OUTCH2
  655. LF LDAB #$0A ; LINE FEED
  656. OUTCH2 BRA OUTCH
  657. *
  658. OKM FCB $0D
  659. FCB $0A
  660. FCC 'OK'
  661. FCB $00
  662. *
  663. TRMINI LDAB #40
  664. TRMILP JSR EPCRLF
  665. DECB
  666. BNE TRMILP
  667. RTS
  668. *
  669. * RECEIVER POLLING
  670. POLCAT LDAB ACIACS
  671. ASRB
  672. RTS
  673. *
  674. * INPUT ONE CHAR INTO B ACCUMULATOR
  675. INCH PSHA
  676. JSR EINCH
  677. TAB
  678. PULA
  679. RTS
  680. *
  681. * OUTPUT ONE CHAR
  682. OUTCH PSHA
  683. TBA
  684. JSR EOUTCH
  685. PULA
  686. RTS
  687. *
  688. ORG COLD
  689. *
  690. END
下載 Printable view

網址

Embed with JavaScript

Embed with iframe

Raw text