home *** CD-ROM | disk | FTP | other *** search
/ 64'er 1985 August / 64er_Magazin_85-08_1985_Markt__Technik_de.d64 / vocabulary.sorce (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  12KB  |  489 lines

  1. 40 open1,8,15,"s:forth.voc":close1
  2. 50 open1,8,1,"forth.voc"
  3. 60 :
  4. 70 :
  5. 100 :           sys  9*4096
  6. 105 :           .opt oo
  7. 110 stack         =  $cf00
  8. 115 retstack      =  $ce00
  9. 120 pos           =  $0002
  10. 122 retpos        =  $00fc
  11. 125 l             =  $00fd
  12. 130 h             =  $00fe
  13. 135 hl            =  $00fd
  14. 140 print         =  $ffd2
  15. 145 :            *=  $c000
  16. 146 reg1         *=  *+2
  17. 147 reg2         *=  *+2
  18. 148 reg3         *=  *+2
  19. 150 ;----------------------
  20. 155 cls         lda  #"[147]"
  21. 160 :           jmp  print
  22. 165 ;----------------------
  23. 170 show        jsr  pop
  24. 175 :           sta  $62
  25. 180 :           stx  $63
  26. 185 :           ldx  #$90
  27. 190 :           lda  $62
  28. 195 :           bmi  minus
  29. 200 plus        lda  #" "
  30. 205 :           jsr  print
  31. 210 :           sec
  32. 215 :           jmp  $bdd4
  33. 220 minus       lda  #"-"
  34. 225 :           jsr  print
  35. 230 :           clc
  36. 235 :           jmp  $bdd4
  37. 240 ;----------------------
  38. 245 push        sta  h
  39. 250 :           stx  l
  40. 255 push1       ldx  pos
  41. 260 :           lda  h
  42. 265 :           sta  stack,x
  43. 270 :           inx
  44. 275 :           lda  l
  45. 280 :           sta  stack,x
  46. 285 :           inx
  47. 290 :           stx  pos
  48. 295 :           rts
  49. 300 ;----------------------
  50. 305 pop         ldx  pos
  51. 310 :           dex
  52. 315 :           lda  stack,x
  53. 320 :           sta  l
  54. 325 :           dex
  55. 330 :           lda  stack,x
  56. 335 :           sta  h
  57. 340 :           stx  pos
  58. 345 :           lda  h
  59. 350 :           ldx  l
  60. 355 :           rts
  61. 360 ;----------------------
  62. 365 drop        jmp  pop
  63. 370 ;----------------------
  64. 375 dup         jsr  pop
  65. 380 :           jsr  push
  66. 385 :           jmp  push1
  67. 390 ;----------------------
  68. 395 swap        jsr  pop
  69. 400 :           sta  reg1
  70. 405 :           stx  reg1+1
  71. 410 :           jsr  pop
  72. 415 :           sta  reg2
  73. 420 :           stx  reg2+1
  74. 425 :           lda  reg1
  75. 430 :           ldx  reg1+1
  76. 435 :           jsr  push
  77. 440 :           lda  reg2
  78. 445 :           ldx  reg2+1
  79. 450 :           jmp  push
  80. 455 ;----------------------
  81. 460 over        dec  pos
  82. 465 :           dec  pos
  83. 470 :           jsr  pop
  84. 475 :           inc  pos
  85. 480 :           inc  pos
  86. 485 :           inc  pos
  87. 490 :           inc  pos
  88. 495 :           jmp  push
  89. 500 ;----------------------
  90. 505 retpop      ldx  retpos
  91. 510 :           dex
  92. 515 :           lda  retstack,x
  93. 520 :           sta  l
  94. 525 :           dex
  95. 530 :           lda  retstack,x
  96. 535 :           sta  h
  97. 540 :           stx  retpos
  98. 545 :           lda  h
  99. 550 :           ldx  l
  100. 555 :           rts
  101. 560 ;----------------------
  102. 565 retpush     sta  h
  103. 570 :           stx  l
  104. 575 retpush1    ldx  retpos
  105. 580 :           lda  h
  106. 585 :           sta  retstack,x
  107. 590 :           inx
  108. 595 :           lda  l
  109. 600 :           sta  retstack,x
  110. 605 :           inx
  111. 610 :           stx  retpos
  112. 615 :           rts
  113. 620 ;-----------------------
  114. 625 subtraktion sec
  115. 630 :           lda  reg1
  116. 635 :           sbc  reg2
  117. 640 :           sta  reg3
  118. 645 :           lda  reg1+1
  119. 650 :           sbc  reg2+1
  120. 655 :           sta  reg3+1
  121. 660 :           rts
  122. 665 ;-----------------------
  123. 670 addition    clc
  124. 675 :           lda  reg1
  125. 680 :           adc  reg2
  126. 685 :           sta  reg3
  127. 690 :           lda  reg1+1
  128. 695 :           adc  reg2+1
  129. 700 :           sta  reg3+1
  130. 705 :           rts
  131. 710 ;-----------------------
  132. 715 cr          lda  #13
  133. 720 :           jmp  print
  134. 725 ;-----------------------
  135. 730 vergleich   jsr  pop
  136. 735 :           stx  reg1
  137. 740 :           sta  reg1+1
  138. 745 :           jsr  pop
  139. 750 :           stx  reg2
  140. 755 :           sta  reg2+1
  141. 760 :           jmp  subtraktion
  142. 765 ;-----------------------
  143. 770 gleich      jsr  vergleich
  144. 771 :           lda  reg3
  145. 772 :           ora  reg3+1
  146. 775 :           beq  wahr1
  147. 780 falsch1     lda  #0
  148. 785 :           tax
  149. 790 :           jmp  push
  150. 795 wahr1       lda  #0
  151. 800 :           ldx  #1
  152. 805 :           jmp  push
  153. 810 ;-----------------------
  154. 815 groesser    jsr  vergleich
  155. 820 :           bcc  wahr2
  156. 825 falsch2     lda  #0
  157. 830 :           tax
  158. 835 :           jmp  push
  159. 840 wahr2       lda  #0
  160. 845 :           ldx  #1
  161. 850 :           jmp  push
  162. 855 ;-----------------------
  163. 860 kleiner     jsr  swap
  164. 865 :           jmp  groesser
  165. 870 ;-----------------------
  166. 875 nicht       jsr  pop
  167. 880 :           ora  l
  168. 885 :           beq  wahr3
  169. 890 falsch3     lda  #0
  170. 895 :           tax
  171. 900 :           jmp  push
  172. 905 wahr3       lda  #0
  173. 910 :           ldx  #1
  174. 915 :           jmp  push
  175. 920 ;-----------------------
  176. 925 hole        jsr  pop
  177. 930 :           stx  reg1
  178. 935 :           sta  reg1+1
  179. 940 :           jsr  pop
  180. 945 :           stx  reg2
  181. 950 :           sta  reg2+1
  182. 955 :           rts
  183. 960 ;-----------------------
  184. 965 und         jsr  hole
  185. 970 :           lda  reg1
  186. 975 :           and  reg2
  187. 980 :           sta  l
  188. 985 :           lda  reg1+1
  189. 990 :           and  reg2+1
  190. 995 :           sta  h
  191. 1000 :           jmp  push1
  192. 1005 ;-----------------------
  193. 1010 oder        jsr  hole
  194. 1015 :           lda  reg1
  195. 1020 :           ora  reg2
  196. 1025 :           sta  l
  197. 1030 :           lda  reg1+1
  198. 1035 :           ora  reg2+1
  199. 1040 :           sta  h
  200. 1045 :           jmp  push1
  201. 1050 ;-----------------------
  202. 1055 exoder      jsr  hole
  203. 1060 :           lda  reg1
  204. 1065 :           eor  reg2
  205. 1070 :           sta  l
  206. 1075 :           lda  reg1+1
  207. 1080 :           eor  reg2+1
  208. 1085 :           sta  h
  209. 1090 :           jmp  push1
  210. 1095 ;-----------------------
  211. 1100 add         jsr  hole
  212. 1105 :           jsr  addition
  213. 1110 :           ldx  reg3
  214. 1115 :           lda  reg3+1
  215. 1120 :           jmp  push
  216. 1125 ;-----------------------
  217. 1130 sub         jsr  swap
  218. 1135 :           jsr  hole
  219. 1140 :           jsr  subtraktion
  220. 1145 :           ldx  reg3
  221. 1150 :           lda  reg3+1
  222. 1155 :           jmp  push
  223. 1160 ;-----------------------
  224. 1165 mul         jsr  hole
  225. 1170 :           ldy  #0
  226. 1175 :           sty  reg3
  227. 1180 :           sty  reg3+1
  228. 1185 :           ldy  #16
  229. 1190 loop16      asl  reg3
  230. 1195 :           rol  reg3+1
  231. 1200 :           rol  reg2
  232. 1205 :           rol  reg2+1
  233. 1210 :           bcc  lab2
  234. 1215 :           clc
  235. 1220 :           lda  reg3
  236. 1225 :           adc  reg1
  237. 1230 :           sta  reg3
  238. 1235 :           lda  reg3+1
  239. 1240 :           adc  reg1+1
  240. 1245 :           sta  reg3+1
  241. 1250 :           bcc  lab2
  242. 1255 :           inc  reg2
  243. 1260 :           bne  lab2
  244. 1265 :           inc  reg2+1
  245. 1270 lab2        dey
  246. 1275 :           bne  loop16
  247. 1280 :           ldx  reg3
  248. 1285 :           lda  reg3+1
  249. 1290 :           jmp  push
  250. 1295 ;-----------------------
  251. 1300 division    jsr  hole
  252. 1305 :           ldy  #16
  253. 1310 :           lda  #0
  254. 1315 :           sta  reg3
  255. 1320 :           sta  reg3+1
  256. 1325 loop17      rol  reg2
  257. 1330 :           rol  reg2+1
  258. 1335 :           rol  reg3
  259. 1340 :           rol  reg3+1
  260. 1345 :           sec
  261. 1350 :           lda  reg3
  262. 1355 :           sbc  reg1
  263. 1360 :           tax
  264. 1365 :           lda  reg3+1
  265. 1370 :           sbc  reg1+1
  266. 1375 :           bcc  lab4
  267. 1380 :           sta  reg3+1
  268. 1385 :           stx  reg3
  269. 1390 lab4        dey
  270. 1395 :           bne  loop17
  271. 1400 :           rol  reg2
  272. 1405 :           rol  reg2+1
  273. 1410 :           rts
  274. 1415 ;-----------------------
  275. 1420 div         jsr  division
  276. 1425 :           ldx  reg2
  277. 1430 :           lda  reg2+1
  278. 1435 :           jmp  push
  279. 1440 ;-----------------------
  280. 1445 mod         jsr  division
  281. 1450 :           ldx  reg3
  282. 1455 :           lda  reg3+1
  283. 1460 :           jmp  push
  284. 1465 ;-----------------------
  285. 1470 trs         jsr  retpop
  286. 1475 :           jmp  push
  287. 1480 ;-----------------------
  288. 1485 tsr         jsr  pop
  289. 1490 :           jmp  retpush
  290. 1495 ;-----------------------
  291. 1500 do          jsr  swap
  292. 1505 :           jsr  tsr
  293. 1510 :           jmp  tsr
  294. 1515 ;-----------------------
  295. 1520 ind         jsr  trs
  296. 1525 :           inc  retpos
  297. 1530 :           inc  retpos
  298. 1535 :           rts
  299. 1540 ;-----------------------
  300. 1545 loop1       jsr  trs
  301. 1550 :           jsr  dup
  302. 1555 :           jsr  trs
  303. 1560 :           jsr  swap
  304. 1565 vergl       jsr  vergleich
  305. 1570 :           bcc  wahr4
  306. 1571 falsch4     jsr  drop
  307. 1575 :           jsr  drop
  308. 1579 :           sec
  309. 1580 :           rts
  310. 1585 wahr4       inc  retpos
  311. 1590 :           inc  retpos
  312. 1595 :           jsr  add
  313. 1600 :           jsr  tsr
  314. 1605 :           clc
  315. 1610 :           rts
  316. 1615 ;-----------------------
  317. 1620 loop        lda  #0
  318. 1625 :           ldx  #1
  319. 1630 :           jsr  push
  320. 1635 :           jmp  loop1
  321. 1640 ;-----------------------
  322. 1645 loopplus    jsr  pop
  323. 1650 :           inc  pos
  324. 1655 :           inc  pos
  325. 1660 :           lda  h
  326. 1665 :           bpl  loop1
  327. 1670 :           jsr  trs
  328. 1675 :           jsr  dup
  329. 1680 :           jsr  trs
  330. 1685 :           jmp  vergl
  331. 1690 ;-----------------------
  332. 1695 if          jsr  pop
  333. 1700 :           ora  l
  334. 1705 :           beq  nein
  335. 1710 ja          sec
  336. 1715 :           rts
  337. 1720 nein        clc
  338. 1725 :           rts
  339. 1730 ;-----------------------
  340. 1735 emit        jsr  pop
  341. 1740 :           txa
  342. 1745 :           jmp  print
  343. 1750 ;-----------------------
  344. 1755 get         jsr  $ea87
  345. 1760 :           cpx  #255
  346. 1765 :           beq  null
  347. 1766 :           cpx  #13
  348. 1767 :           bcs  nonull
  349. 1770 null        ldx  #$00
  350. 1775 nonull      lda  #$00
  351. 1780 :           jmp  push
  352. 1785 ;-----------------------
  353. 1790 key         jsr  get
  354. 1795 :           jsr  dup
  355. 1800 :           jsr  if
  356. 1805 :           bcs  next5
  357. 1810 :           jsr  drop
  358. 1815 :           jmp  key
  359. 1820 next5       rts
  360. 1825 ;-----------------------
  361. 1830 putzeile    stx  l
  362. 1835 :           sta  h
  363. 1840 :           ldy  #0
  364. 1845 loopput     lda  (hl),y
  365. 1850 :           beq  endput
  366. 1855 :           jsr  print
  367. 1860 :           iny
  368. 1865 :           bne  loopput
  369. 1870 endput      rts
  370. 1875 ;-----------------------
  371. 1880 type        jsr  pop
  372. 1885 :           stx  $f7
  373. 1890 :           jsr  pop
  374. 1895 :           ldy  #0
  375. 1900 looptype    lda  (hl),y
  376. 1905 :           jsr  print
  377. 1910 :           iny
  378. 1915 :           cpy  $f7
  379. 1920 :           bne  looptype
  380. 1925 :           rts
  381. 1930 ;-----------------------
  382. 1935 expect      jsr  pop
  383. 1940 :           stx  $f9
  384. 1945 :           jsr  pop
  385. 1950 :           stx  $f7
  386. 1955 :           sta  $f8
  387. 1960 :           ldx  #0
  388. 1965 :           ldy  #0
  389. 1970 loopex      jsr  $ffcf
  390. 1975 :           sta  ($f7),y
  391. 1980 :           cmp  #13
  392. 1985 :           beq  endex
  393. 1990 :           inx
  394. 1995 :           iny
  395. 2000 :           cpy  $f9
  396. 2005 :           bne  loopex
  397. 2010 endex       rts
  398. 2015 ;-----------------------
  399. 2020 depth       lda  pos
  400. 2025 :           lsr  a
  401. 2030 :           tax
  402. 2035 :           lda  #0
  403. 2040 :           jmp  push
  404. 2045 ;-----------------------
  405. 2050 dpoke       jsr  pop
  406. 2055 :           stx  $f7
  407. 2060 :           sta  $f8
  408. 2065 :           jsr  pop
  409. 2070 :           ldy  #1
  410. 2075 :           sta  ($f7),y
  411. 2080 :           txa
  412. 2085 :           dey
  413. 2090 :           sta  ($f7),y
  414. 2095 :           rts
  415. 2100 ;----------------------
  416. 2105 poke        jsr  pop
  417. 2110 :           stx  $f7
  418. 2115 :           sta  $f8
  419. 2120 :           jsr  pop
  420. 2125 :           ldy  #0
  421. 2130 :           txa
  422. 2135 :           sta  ($f7),y
  423. 2140 :           rts
  424. 2145 ;----------------------
  425. 2150 dpeek       jsr  pop
  426. 2155 :           stx  $f7
  427. 2160 :           sta  $f8
  428. 2165 :           ldy  #0
  429. 2170 :           lda  ($f7),y
  430. 2175 :           tax
  431. 2180 :           iny
  432. 2185 :           lda  ($f7),y
  433. 2190 :           jmp  push
  434. 2195 ;----------------------
  435. 2200 peek        jsr  pop
  436. 2205 :           stx  $f7
  437. 2210 :           sta  $f8
  438. 2215 :           ldy  #0
  439. 2220 :           lda  ($f7),y
  440. 2225 :           tax
  441. 2230 :           lda  #0
  442. 2235 :           jmp  push
  443. 2240 ;----------------------
  444. 2245 call        jsr  pop
  445. 2246 :           lda  780
  446. 2247 :           ldx  781
  447. 2248 :           ldy  782
  448. 2250 :           jmp  (hl)
  449. 2255 ;----------------------
  450. 2260 pick        jsr  pop
  451. 2265 :           ldy  pos
  452. 2270 :           sty  reg1
  453. 2275 :           txa
  454. 2280 :           asl  a
  455. 2285 :           sta  pos
  456. 2290 :           jsr  pop
  457. 2300 :           ldy  reg1
  458. 2305 :           sty  pos
  459. 2312 :           jmp  push
  460. 2313 ;----------------------
  461. 2315 rot         jsr  pop
  462. 2320 :           stx  reg1
  463. 2325 :           sta  reg1+1
  464. 2330 :           jsr  pop
  465. 2335 :           stx  reg2
  466. 2340 :           sta  reg2+1
  467. 2345 :           jsr  pop
  468. 2350 :           stx  reg3
  469. 2355 :           sta  reg3+1
  470. 2360 :           ldx  reg2
  471. 2365 :           lda  reg2+1
  472. 2370 :           jsr  push
  473. 2375 :           ldx  reg1
  474. 2380 :           lda  reg1+1
  475. 2385 :           jsr  push
  476. 2390 :           ldx  reg3
  477. 2395 :           lda  reg3+1
  478. 2400 :           jmp  push
  479. 2405 ;----------------------
  480. 2410 load        jsr  $aefd
  481. 2415 :           jsr  $e1d4
  482. 2420 :           lda  #1
  483. 2425 :           sta  $b9
  484. 2430 :           lda  #0
  485. 2435 :           jmp  $ffd5
  486. 2440 ;----------------------
  487. 9600 :           .sst 8,2,"@:label,s,w"
  488. 9610 :           .end
  489.