home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / genie-commodore-file-library / Information / 128SNIPPETS < prev    next >
Encoding:
Text File  |  2019-04-13  |  62.8 KB  |  1,704 lines

  1.   
  2.    
  3.  --------------------------------------
  4.     The following C64/128 RoundTable
  5.     Bulletin Board Messages have been
  6.     archived by H.HERMAN8 (Howie).
  7.  --------------------------------------
  8.    
  9.    
  10.  ************
  11. Topic 11        Sun Apr 19, 1992
  12. CBM-ED [e.g.bell]            (Forwarded) 
  13. Sub: Snippits for the 128                   
  14.  
  15. Just a place to put useful programming routines for the C128. Why  keep
  16. reinventing the wheel?
  17.  
  18. 72 message(s) total.
  19.  ************
  20.  ------------
  21. Category 5,  Topic 11
  22. Message 1         Sun Apr 19, 1992
  23. CBM-ED [e.g.bell]            (Forwarded) 
  24.  
  25. Here is a neat technique for eliminating the question mark in INPUT 
  26. statements without opening a file to the screen:
  27.  
  28. POKE 21,64:input "<string>";io$:POKE 21,0
  29.  
  30. Make sure you use both POKE's and note... this *will* eliminate any pre-
  31. existing value in 'io$'.
  32.  
  33.  *NOTE*.  If this topic goes over ok, one could be started for the C64 mode
  34. too. In the meantime, you can use this same technique on the C64 but use
  35. address 19 instead of 21.
  36.  ------------
  37. Category 5,  Topic 11
  38. Message 2         Sun Apr 19, 1992
  39. PAUL-MB                      (Forwarded) 
  40.  
  41.  Good topic idea, Ed ;)
  42.  
  43.  Here's a simple 80-column screen on/off toggle:
  44.  
  45.       ON: SYS52684,100,35
  46.      OFF: SYS52684,0,35
  47.  
  48.  Good for drawing screens without the user knowing it :)
  49.  
  50.                               Happy Easter!!   -=* Paul *=-
  51.  ------------
  52. Category 5,  Topic 11
  53. Message 3         Mon Apr 20, 1992
  54. HOWIE-CBM                    (Forwarded) 
  55.  
  56.  e.g.,
  57.  
  58.  My favorite is using the keyboard buffer to poke up to 10 values into 842 
  59.  thru 851, and then the number of the pokes into 208.
  60.  
  61.  So...
  62.  
  63.  10 poke 842,13:poke 843,13:poke208,1:rem executes two carriage returns
  64.  
  65.  Things may be displayed or not, by setting character colors ahead of the 
  66.  pokes.
  67.  
  68.  So you can write to the screen, cursor to the line, do a carriage return 
  69.  and have the command executed.  Very helpful in setting up series of batch 
  70.  type files with Basic for doing unattended file copying chores, and the 
  71.  like (especially with JiffyDos).  Also works fine with the three Digital 
  72.  Pocket programs, letting you enter up to 10 keystrokes which will then be 
  73.  executed *AFTER* the programs have booted.  Allows for a bit of custom 
  74.  configuring, like putting you into a directory for easy file load, or in 
  75.  the case of Writer3, auto starting one of its macros, for almost unlimited 
  76.  activity. (Ought to work the same with lots of commercial progams.)
  77.  
  78.  Only limitation on using these pokes seems to be ones imagination.  :)
  79.  
  80.  ---------------------------
  81.  
  82.  One more, which I've never had to use, but it's nice to have handy is an
  83.  `un-new'.  Enter the following in direct mode:
  84.  
  85.  poke 7170,28:x=7171:do:y=peek(x):x=x+1:loop until y=28:
  86.  poke 7169,dec(right$(hex$(x-2),2))
  87.  
  88.  I broke the above into two lines, but it should get entered as one big line,
  89.  before doing one carriage return.
  90.  
  91.  Howie
  92.  ------------
  93. Category 5,  Topic 11
  94. Message 4         Mon Apr 20, 1992
  95. HOWIE-CBM                    (Forwarded) 
  96.  
  97.  Paul,
  98.  
  99.  I added a few <CR>'s to the routines, and here's what I got:
  100.  
  101.  10 BANK 15
  102.  20 SYS DEC("FFF0"),,ROW,COLUMN,0
  103.  30 RETURN
  104.  
  105.  And the second:
  106.  
  107.  29380 REM -----<DEVICE SETUP>
  108.  29400 :
  109.  29420 TRAP 29740
  110.  29440 INPUT "SOURCE DEVICE       ";D$
  111.  29460 DR%=VAL(D$):IF DR%<8 OR DR%>11 GOTO 29440
  112.  29480 HN%=DR%:GOSUB 29920:IF HN%=. GOTO 29440
  113.  29500 :
  114.  29520 INPUT "DESTINATION DRIVE ";D$
  115.  29540 DD%=VAL(D$):IF DD%<8 OR DD%>11 GOTO 29520
  116.  29560 IF DD%<>DR% THEN HN%=DD%:GOSUB 29920:IF HN%=. GOTO 29520
  117.  29580 :
  118.  29600 INPUT "PRINTER NUMBER    ";D$
  119.  29620 PR%=VAL(D$):IF PR%<4 OR PR%>5 GOTO 29600
  120.  29640 HN%=PR%:GOSUB 29940:IF HN%=. THEN POKE 21,.:GOTO 29600
  121.  29660 TRAP:RETURN
  122.  29680 :
  123.  29700 REM -----<TRAP FOR 'DEVICE NOT PRESENT'>
  124.  29720 :
  125.  29740 IF ER=5 THEN BEGIN
  126.  29760 :  PRINT "DEVICE [" MID$(STR$(HN%),2) "] NOT PRESENT"
  127.  29780 :   SLEEP 4:HN%=.
  128.  29800 BEND
  129.  29820 RESUME NEXT
  130.  29840 :
  131.  29860 REM -----<TEST FOR DEVICE PRESENCE>
  132.  29880 :
  133.  29920 CLOSE15:OPEN 15,HN%,15,"I":CLOSE15:RETURN
  134.  29940 CLOSE 3:OPEN 3,HN%, 7:PRINT#3:CLOSE3:RETURN
  135.  
  136.  You can use a capture buffer like BTP's to save these routines direct in
  137.  tokenized form, and save the typing.  :)
  138.  
  139.  One change to the second one might be nice tho.  Allowing drives from 8 to
  140.  30 for us power users.  :)
  141.  
  142.  Howie
  143.  ------------
  144. Category 5,  Topic 11
  145. Message 5         Sat Apr 25, 1992
  146. CBM-ED [e.g.bell]            (Forwarded) 
  147.  
  148.  Here is a quick and dirty file reader for the C128...
  149.  
  150.  1940 rem -----<read a seq file from disk>
  151.  1960 :
  152.  1980 ft$="":fi$="":input "Read Which File  ";fi$:if fi$ ="" then return
  153.  2000 :
  154.  2020 print "<CLR/HOME><BEL>";:close.:open.,8,.,+"0:"+fi$+ft$:sys 41149
  155.  2040 :
  156.  2060 if ds=64 then begin
  157.  2080 :   input "File Type   s/p/u  ";ft$
  158.  2100 :   if instr("spu",ft$)=. then print "<BEL><2 crsr UP>";:goto 2080
  159.  2120 bend
  160.  \2140 if ds=64 goto 2020
  161.  2160 :
  162.  2180 return
  163.  ------------
  164. Category 5,  Topic 11
  165. Message 6         Mon Apr 27, 1992
  166. CBM-ED [e.g.bell]            (Forwarded) 
  167.  
  168.  Got a use for up to 5 different 80 column screens.   Only 1 block 
  169.  of color, and only the default character set, but for help screens,
  170.  you can't beat it...
  171.  
  172.  540 rem -----<multi-pages of 80 col screen>
  173.  560 :
  174.  561 bank 15:on page% goto 562,563,564,565,566
  175.  562 poke 2606,. :sys dec("cdcc"), .,12:goto 578
  176.  563 poke 2606,16:sys dec("cdcc"),16,12:goto 578
  177.  564 poke 2606,24:sys dec("cdcc"),24,12:goto 578
  178.  565 poke 2606,32:sys dec("cdcc"),32,12:goto 578
  179.  566 poke 2606,40:sys dec("cdcc"),40,12
  180.  567 :
  181.  578 print "<CLR/HOM><BEL>.... your text here" : return
  182.  
  183.  The POKE's to 2606 tell the C128 where to do the printing.  This is
  184.  invisible to you, so the above routine would just set up the screens.
  185.  That is where the SYS commands come in.  They actually toggle the 
  186.  display *to* the new screen memory.  You could also have up to 3
  187.  screens in memory each with it's own color/attribte memory.  I'll put
  188.  that up later, lest someone beats me to it.
  189.  
  190.  Sorry about the numbering schemes... these are taken directly from 
  191.  different programs I have written.
  192.  
  193.  On last note... You *would* want each of the above routines to GOTO
  194.  a different printing routine if you want different printed screens.
  195.  My program follows this with a routine to fill each screen with 4 
  196.  columns of up to 20 filenames, and is variable controlled, which is
  197.  why I only use 1 target address, line 578.
  198.  ------------
  199. Category 5,  Topic 11
  200. Message 7         Sun May 03, 1992
  201. CBM-ED [e.g.bell]            (Forwarded) 
  202.  
  203.  Here is a program to read in Print Shop graphics into 7 variables
  204.  for display on your 80 column screen.  This version uses the 
  205.  3 block graphics.  It is kinda long, but neat!
  206.  
  207.  100 dim oldbyte%(56,13)
  208.  105 gosub 345[gosub 430:print "<clr/home><bel>";
  209.  110 :
  210.  115 for gf=1 to 60:fi$="i"+right$("0"+mid$(str$(gf),2),2)
  211.  120 :
  212.  125 :   open6,8,6,fi$:get#6,a$,a$
  213.  130 :   for row=1 to 51
  214.  135 :      for column=1 to 11
  215.  145 :         get#6,a$
  216.  150 :         oldbyte%(row,column)=asc(a$)
  217.  155 :      next
  218.  160 :   next
  219.  165 :   close6:gosub 215
  220.  170 :
  221.  175 :   print "<bel><wht>" chr$(142);
  222.  180 :   for x=1 to 7
  223.  185 :      print c$(x);
  224.  190 :   next
  225.  195 next:return
  226.  200 :
  227.  205 rem -----<display on 80 column screen>
  228.  210 :
  229.  215 gosub 515:restore 405:parse=1
  230.  220 read a$:b$=mid$(a$,parse,1)
  231.  225 a%=asc(b$):gosub 470:sp=(a%*16)+8192
  232.  230 :
  233.  235 parse=parse+1
  234.  240 for row=1 to 56 step 8
  235.  245 :   column=.
  236.  250 :   hi%=int(sp/256):lo=sp%-(hi%*256)
  237.  255 :   sys dec("cdcc"),hi%,18
  238.  260 :   sys dec("cdcc"),lo%,19
  239.  265 :
  240.  270 :   for cc=row to row+7
  241.  275 :      sys dec("cdcc"),oldbyte%(cc,column),31
  242.  280 :   next
  243.  285 :
  244.  290 :   b$=mid$(a$,parse,1)
  245.  295 :   a%=asc(b$):if a%=. the parse=1:read a$:goto 290
  246.  300 :   gosub 470
  247.  305 :   sp=(a%*16)+8192:parse=parse+1
  248.  310 :   column=column+1:if column<13 goto 250
  249.  315 next
  250.  320 return
  251.  325 :
  252.  330 rem -----<install ml>
  253.  335 :
  254.  340 restore 360:x=.
  255.  345 read a%:if a%<>256 then poke 3400+x,a%:x=x+1:goto 345
  256.  350 return
  257.  355 :
  258.  360 data 94,0,12,232,126,0,12,8,232,228,251,176,4,40,76,76,13,40,96
  259.  365 data 160,6,126,0,12,62,0,13,136,16,247,96,256
  260.  370 :
  261.  375 rem -----<restore 8563 rom set>
  262.  380 :
  263.  385 poke 251,88:poke 252,96:sys 251
  264.  395 stop
  265.  400 :
  266.  405 data "abcdefghijklmnopqrstuvwxyz"
  267.  410 data "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  268.  415 data "1234567890+-!#$%&'()\<>=*^"
  269.  420 data chr$(96)+chr$(95)+"@[]:;,./?"
  270.  421 data chr$(220)+chr$(168)+"<13 spaces>"
  271.  425 :
  272.  430 c$(1)="abcdefghijklm"
  273.  435 c$(2)="nopqrstuvwxyz"
  274.  440 c$(3)="ABCDEFGHIJKLM"
  275.  445 c$(4)="NOPQRSTUVWXYZ"
  276.  450 c$(5)="1234567890+-!"
  277.  455 c$(6)="#$%&'()\<>=*^"
  278.  460 c$(7)=chr$(96)+chr$(95)+"@[]:;,./?"+chr$(220)+chr$(168)
  279.  465 :
  280.  470 if a%>63  and a%<96   then a%=a%-64
  281.  475 if a%>191             then a%=a%-128
  282.  480 if a%>31  and a%<64   then return
  283.  485 if a%>159 and a%<193  then a5%=a%-64
  284.  490 if a%=255             then a%=94
  285.  495 return
  286.  500 :
  287.  505 rem -----<zap upper case character set>
  288.  510 :
  289.  515 sys dec("cdcc"),0,24
  290.  520 sys dec("cdcc"),32,18
  291.  525 sys dec("cdcc"),0,19
  292.  530 sys dec("cdcc"),0,31
  293.  535 sys dec("cdcc"),254,30
  294.  540 for x=1 to 15
  295.  545 :   sys dec("cdcc"),255,30
  296.  550 next
  297.  555 return
  298.  
  299.  Sorry about the length of this, but it is a neat little function that
  300.  you may want to use in your own programs.  It blows away the upper
  301.  case character set.  You will still have upper case letters in the 
  302.  character set your 128 starts out with though.  BTW, in case your term
  303.  is redefining the characters like this one is...
  304.  
  305.  \=british pound sterling sign=chr$(92)
  306.  ^=up arrow=chr$(94)
  307.  ------------
  308. Category 5,  Topic 11
  309. Message 8         Sat May 09, 1992
  310. CBM-ED [e.g.bell]            (Forwarded) 
  311.  
  312.  Found a little technique last night that is Looonnggg overdue...
  313.  How about a way to load a SEQ file from the 1571.  I know there
  314.  is a prg out that does it, complete with source code now, right,
  315.  but how about when you need something small, quick, and dirty?
  316.  
  317.  10 open15,8,15,"i"
  318.  20 print#15,"u0"+chr$(255)+"file name"
  319.  30 bload "filename,s",b1,p7168
  320.  
  321.  Use whatever filename you like, and load it wherever you like in 
  322.  whatever bank.  Still, this is something I wasn't able to do when
  323.  I wrote BLAZE years ago.  Still learning!
  324.  ------------
  325. Category 5,  Topic 11
  326. Message 9         Sat May 09, 1992
  327. C128.JBEE [* Sysop *]        (Forwarded) 
  328.  
  329.  How come you can not just bload the sequential file into memory and read
  330.  it with the monitor from there?
  331.  What does (10+20) do? <- curious minds want to know!
  332.  ------------
  333. Category 5,  Topic 11
  334. Message 10        Sat May 09, 1992
  335. R.KNOP1 [Rob Knop]           (Forwarded) 
  336.  
  337. That's odd code....  Line 10 initialized the drive, which may make sense, but
  338. then line 20 sends the command to the drive to try to burst load the file.
  339. (That's what "u0"+chr$(255)+filename tells the drive; after that, you could do
  340. a series of input#'s which would read the file... only, BASIC is slow enough
  341. that I don't think you can take full advantage of the burst speed. You're
  342. better of writing a burst loader in ML.)
  343.  
  344. What I don't understand is, why do you send this burst command to the drive
  345. and then do a bload?  I thought bload already tried to do burst loading if it
  346. is available.
  347.  
  348. -Rob
  349.  ------------
  350. Category 5,  Topic 11
  351. Message 11        Sun May 10, 1992
  352. CBM-ED [e.g.bell]            (Forwarded) 
  353.  
  354. I usually always ad the 'i' command when I open the command channel.      It
  355. is just my technique.  As for the burst load, I think if you try the little
  356. program you will see that line 20 just tells the drive that it should ignore
  357. the fact that the file is sequential.  The BLOAD is used to pull it in,
  358. directing it to the area in RAM, and the BANK,  where I want it.
  359.  
  360. The key reason for this whole routine is that you can't do a load of any type
  361. on a SEQ file using the C128 and the 1581 or 1571 in 1571  mode.  Not even
  362. using 'filename,s', like you could with the C64.  Thus, to get that
  363. capability, and in burst mode, I issue the command in line 20.  The chr$(255)
  364. simply sets bit 7 in the BCIS fast load command,  which tells the drive to go
  365. ahead and perform the load, even if the file is not a PRG.  That just sets
  366. things up.  The BLOAD follows through.  I am not an expert in using the BCIS,
  367. but I waited a long time to figure out how to do this type of load.  You may
  368. know more than me about the BCIS, but 3 lines to do this is a major
  369. breakthrough for me.  
  370.  
  371. btw:  For any who read this and don't know what BCIS is, it stands for BURST
  372. COMMAND INSTRUCTION SET, which is documented in the back of the manuals for
  373. both the 1571 and 1581.        
  374.  
  375. Thanks for this question.  If I answered correctly, let me know.  If I am
  376. missing something, that will be even more appreciated.  egb
  377.  ------------
  378. Category 5,  Topic 11
  379. Message 12        Sun May 10, 1992
  380. R.KNOP1 [Rob Knop]           (Forwarded) 
  381.  
  382. Aha - yes, very nice!  What I had forgotten was, you couldn't do the bload on
  383. a SEQ file.  (Sort of annoying, really.)  Never occured to me that this
  384. workaround would do it!  But it does make sense.
  385.  
  386. Yeah, a 3-line program, but a nice programming job at that.  (Did you send
  387. this to RUN?  They'd probably love it for their magic tricks.)
  388.  
  389. -Rob
  390.  ------------
  391. Category 5,  Topic 11
  392. Message 13        Sun May 10, 1992
  393. CBM-ED [e.g.bell]            (Forwarded) 
  394.  
  395. I probably could, but for $5, it is just as good to post it here and make it
  396. available now.  I wrote a program called BLAZE several years ago that loads
  397. SEQ files, then prints them to printer/screen real fast. Trouble was, the prgs
  398. had to be changed to PRG, so I had to write a  program, FLIX, to do that.  Too
  399. bad I didn't do the legwork back then!
  400.  ------------
  401. Category 5,  Topic 11
  402. Message 14        Sun May 10, 1992
  403. C128.JBEE [* Sysop *]        (Forwarded) 
  404.  
  405.  Ahhhh..... now I understand :)
  406.  ------------
  407. Category 5,  Topic 11
  408. Message 15        Mon May 11, 1992
  409. M.DULSKI1 [Mark @WIZARD]     (Forwarded) 
  410.  
  411.  I thought it was you couldn't DLOAD a SEQ file?  A while ago I wrote a
  412.  small program that contains this line:
  413.          bload(fa$+",s"),u(d1),p1024
  414.  
  415.  No setting up for burst load ahead of time like you did, Ed.  However I
  416.  do DOPEN the file and immediately DCLOSE it.  Then read DS$.  Maybe that
  417.  is setting it up for burst somehow?  At least my program works like it
  418.  is suppose to ;)  Just don't know why.
  419.  
  420.  ~~Mark~~
  421.  ------------
  422. Category 5,  Topic 11
  423. Message 16        Wed May 13, 1992
  424. CBM-ED [e.g.bell]            (Forwarded) 
  425.  
  426. I don't know what you did Mark... But why would you DOPEN a file you  are
  427. going to BLOAD.  That is not the normal chain of events, and DCLOSE would also
  428. normally be unnecessary.  Anyway, I know what I  was able to do before I found
  429. this technique, and that I can do it now quite nicely.
  430.  
  431. I *do* need some information now for this topic.  I'll delete this  message
  432. if/when I get a reply.  I need the code to lock and unlock a 1581 diskette.  I
  433. know the way to do it on a 1541/1571, which I  may just post, but I have no
  434. detailed information on the workings of the 1581, and no source I know of.
  435.  ------------
  436. Category 5,  Topic 11
  437. Message 17        Thu May 14, 1992
  438. M.DULSKI1 [Mark @WIZARD]     (Forwarded) 
  439.  
  440.  Reason I DOPENed the file was to first check for disk errors.  Chiefly
  441.  for "file not found".  DCLOSEing was done right after and *then* the
  442.  seqential file was BLOADed into bank 1.  Ok ok I probably could have
  443.  TRAPed for errors.  Never said I was an expert in programming   ;-D
  444.  Will admit I have much to learn but as I said, for some reason this
  445.  method worked.  Didn't have to set up for burst load first to get the
  446.  job done.
  447.  
  448.  If you want to see the file I can upload it.  Nothing special about it,
  449.  all it does is take a seq file up to 253 blocks and splits into 2.
  450.  BSAVEing the 2 new ones to disk.  Wizards buffer was bigger than what
  451.  my word proccessor takes and most other seq file splitters took too long
  452.  for me.  Never timed this one but it's fast ;)
  453.  
  454.  ~~Mark~~
  455.  ------------
  456. Category 5,  Topic 11
  457. Message 18        Thu May 14, 1992
  458. CBM-ED [e.g.bell]            (Forwarded) 
  459.  
  460. Mark:  I looked over the topics in this category and couldn't really find
  461. another place to move this discussion that is more appropriate than this.
  462.  
  463. WRT your program, would I be correct in assuming you are running Jiffy DOS, or
  464. any kind of enhancement to your 128.  Your technique does not work on my C128,
  465. even after opening it.  I get a file not found error, whether I use a ',s' or
  466. not.  That is the problem I have always run  into.   I have the Free Spirit
  467. ROM upgrade chip set, but to say  that causes the problem would probably be a
  468. stretch, because the problem is not in the C128, it is in the 1571/1581.  I
  469. have to suspect for now that you are using Jiffy DOS or something, and that
  470. your prg will not work on my machine. Instead of uploading it, post it here
  471. and I will check it to see if it works for me.  Just give me exactly what you 
  472. use, though I just did it on my 128 like this...
  473.  
  474. 10 dopen#3,"tables,s":print ds$ : dclose#3 20 bload "tables,s",b1,p7168
  475.  
  476. the screen output is as follows...
  477.  
  478. run 00, ok,00,00
  479.  
  480. ?file not found error in 20
  481.  
  482. I suspect most of the c128 users will get the same error  using the  same bit
  483. of code  Is this what you did?
  484.  ------------
  485. Category 5,  Topic 11
  486. Message 19        Thu May 14, 1992
  487. CBM-ED [e.g.bell]            (Forwarded) 
  488.  
  489.  sorry about the <CR>'s lost in the prev. msg. in the screen output
  490.  illus.  should have been..
  491.  
  492.  run
  493.  00, ok,00,00
  494.  
  495.  ?file not found error in 20
  496.  ------------
  497. Category 5,  Topic 11
  498. Message 20        Fri May 15, 1992
  499. M.DULSKI1 [Mark @WIZARD]     (Forwarded) 
  500.  
  501.  Ed, you're completely right when you asked about Jiffydos or enhancements
  502.  on my 128.  It's Warp Speed.  I totally forgot about it and feel rather
  503.  foolish ;>  See, I said I had a lot to learn!
  504.  
  505.  And no, my method won't work without Warpspeed attached :(  So I'm happy
  506.  to say, Thank you! for this latest routine.  Will be replacing my method
  507.  with yours!
  508.  
  509.  Keep 'em comming Ed!
  510.         ~~Mark~~
  511.  ------------
  512. Category 5,  Topic 11
  513. Message 21        Fri May 15, 1992
  514. CBM-ED [e.g.bell]            (Forwarded) 
  515.  
  516. Great!  I was kinda suspicious!  And I got a *LOT* more to come, as I cull
  517. them from various programs I've written over the years and am in the process
  518. of writing.  Hope some others will join in some more. There is a lot of useful
  519. stuff I have received from others!
  520.  ------------
  521. Category 5,  Topic 11
  522. Message 22        Sun May 17, 1992
  523. R.KNOP1 [Rob Knop]           (Forwarded) 
  524.  
  525.  Can't remember if I've posted this before, but here's a little assembly
  526.  debugging routine that I use quite a bit.  Call it with .AX having a pointer
  527.  to a multi-byte variable (A=low, X=hi), and Y having the number of bytes in
  528.  your variable.  It prints the variable in hexidecimal.
  529.  
  530.  I give Merlin128 source since that's what I use.... :)   (Although I'll bag
  531.  the all capitals routines, since I'm typing this in the Dialogue128 editor.)
  532.  
  533.  num = $fb      ;Or any other zero page variable...
  534.  bsout = $ffd2  ;Yeah, you gotta call this with Kernal visible
  535.  
  536.  PUTYHEX  sta num
  537.           stx num+1
  538.           dey
  539.  ]L10     lda (num),y
  540.           jsr PUT1HEX
  541.           dey
  542.           bpl ]L10
  543.           rts
  544.  
  545.  
  546.  PUT1HEX  pha
  547.           lsr a
  548.           lsr a
  549.           lsr a
  550.           lsr a
  551.           tax
  552.           lda hexnums,x
  553.           jsr bsout
  554.           pla
  555.           and #%00001111
  556.           tax
  557.           lda hexnums,x
  558.           jsr bsout
  559.           rts
  560.  
  561.  hexnums  txt '0123456789abcdef'
  562.  
  563.  
  564.  -Rob
  565.  ------------
  566. Category 5,  Topic 11
  567. Message 23        Wed May 20, 1992
  568. CBM-ED [e.g.bell]            (Forwarded) 
  569.  
  570.  Here is a couple of ways to check for device presence in ML...
  571.  
  572.        lda dev#
  573.        jsr listen
  574.        lda #$6f
  575.        jsr second
  576.        jsr unlisten
  577.        lda $90
  578.        bmi nodrive
  579.        bpl drivepresent
  580.  
  581.  That one was given to me, and is very similar to the one used in CCGMS.
  582.  This one is the one I use...
  583.  
  584.        lda #0
  585.        jsr setnam
  586.        lda #15
  587.        ldx #device
  588.        tay
  589.        jsr setlfs
  590.        jsr open
  591.        ldx #15
  592.        jsr chkout
  593.        pha
  594.        jsr clrchn
  595.        pla
  596.        cmp #5
  597.        beq nodrive
  598.        bne drivepresent
  599.  
  600.  Either one works.  The first one doesn't need a file to be opened.  The
  601.  second opens a command channel (#15) to the drive similar to 
  602.  OPEN15,drive#,15.
  603.  
  604.  ------------
  605. Category 5,  Topic 11
  606. Message 24        Fri May 29, 1992
  607. HOWIE-CBM                    (Forwarded) 
  608.  
  609.  Well, here's a very basic Basic I whipped together to show the time
  610.  on screen with CMD's RTC:
  611.  
  612.  4 print" [shift/clr home] [23 cursor downs] "
  613.  5 open14,16,15:print#14,"t-ra"
  614.  10 get#14,a$:t$=t$+a$:if st<>64 then 10
  615.  12 print " [2 cursor ups] [25 spaces] ";
  616.  15 print " [1 cursor down] " t$;
  617.  16 t$=""
  618.  20 close14:goto5
  619.  
  620.  This will display the current date and time at one location, updating the
  621.  date and time each second.
  622.  
  623.  Not too useful, but the basic info is here which can be expanded, perhaps
  624.  opening a window on a menu screen, or other enhancement.
  625.  
  626.  Now I've gotta change a few starter (boot) routines for some programs that
  627.  can use the clock to pick up the correct time, when they get run.  Programs
  628.  like Dialogue, Big Blue Reader, GEOS...
  629.  
  630.  Hmm...  I am sure I've left some out.  oh!  CP/M would be nice.  Not quite
  631.  sure how to go about this, however.
  632.  
  633.  For other cbm mode programs that may not access the RTC direct, there
  634.  appear to be some nifty work-arounds.  For example with Pocket Writer3,
  635.  a letter, memo, and note template all pick up a date file to insert in the
  636.  appropriate place.  Pocket Writer will display the current date and time
  637.  thru the command channel, but as far as I know it cannot get `imported'
  638.  into the running program this way.  The work around that I am thinking
  639.  about is to have the main menu (to which all programs exit) branch off
  640.  to write the current date into a file, and then let PW3, when booted,
  641.  thru its auto macros, pick up this file, and change it into a useable
  642.  date file.
  643.  
  644.  Seems like it should work out fine, and the fraction of a second extra
  645.  that this might take shouldn't be all that noticeable.
  646.  
  647.  CP/M tho has me stumped.  Wonder if the routine which picks up the time
  648.  from the Right Time Clock for CP/M can be adapted.
  649.  
  650.  That might be one way...
  651.  
  652.  Howie
  653.  ------------
  654. Category 5,  Topic 11
  655. Message 25        Sat Jul 04, 1992
  656. CBM-ED [e.g.bell]            (Forwarded) 
  657.  
  658.  Need some TRUE ASCII characters for your C128 80 col program?   Here
  659.  are 5, the circumflex (^), underscore (_), left bracket ({), right
  660.  bracket (}), and tilde (~).
  661.  
  662.  10 for c=1 to 7
  663.  20 :   read a%:sp%=(a%*16)+12288
  664.  30 :   hi%=int(sp%/256):lo%=sp%-(hi%*256)
  665.  40 :   
  666.  50 :   sys dec("cdcc"),hi%,18
  667.  60 :   sys dec("cdcc"),lo%,19
  668.  70 :   
  669.  80 :   for x=1 to 8
  670.  90 :      read a%:if a%=256 then x=9: goto 110
  671.  100:      sys dec("cdcc"),a%,31
  672.  110:   next
  673.  120next
  674.  130:
  675.  140 poke 251,88:poke 252,96:sys 251:  rem clear interrupts  
  676.  150: 
  677.  160 data 30,008,028,034,065,000,000,000,000:rem  circumflex
  678.  170 data 31,000,000,000,000,000,000,255,000:rem  underscore
  679.  180 data 91,028,048,024,048,024,048,028,000:rem  left bracket
  680.  190 data 93,028,006,012,006,012,006,028,000:rem  right bracket
  681.  200 data 92,012,012,012,012,000,012,012,012:rem  bar (surprise!)
  682.  210 data 28,000,096,048,024,012,006,003,000:rem  backslash (surprise again)
  683.  220 data 94,000,017,041,070,000,000,000,000:rem  tilde
  684.  
  685.  I missed the bar and backslash characters.  The bar is, I believe, shift +
  686.  or minus, and the backslash is the english pound sterling symbol.  The
  687.  circumflex is the uparrow, the underscore is the back arrow, the right and
  688.  left brackets I believe are the shifted + or - (shift +,-, and pound
  689.  sterling symbols until you figure it out, and the tilde is shift *, I 
  690.  think.  Sorry for the uncertainty.  I am doing this from a listing and
  691.  uncommented memory.  Dontcha hate it when that happens.   :-(
  692.  
  693.  ------------
  694. Category 5,  Topic 11
  695. Message 26        Mon Jul 20, 1992
  696. HOWIE-CBM                    (Forwarded) 
  697.  
  698.  Did you ever have a piece of info, that didn't quite fit in anywhere...
  699.  
  700.  Well I got together some obscure info for a member of our user group.  
  701.  Mostly for CP/M, and hopefully someone else might find this helpful:
  702.  
  703.  This lets drive M turn into another drive, so that software that may want 
  704.  to run from only drive A, will now run from the REU:
  705.  
  706.  To turn drive M: into another Drive:
  707.  ====================================
  708.  
  709.  conf poke fbd1=96fb          turn M into A
  710.  conf poke fbd3=96fb          turn M into B  
  711.  conf poke fbd5=96fb          turn M into C
  712.  conf poke fbd7=96fb          turn M into D
  713.  conf poke fbdb=96fb          turn M into F 
  714.  
  715.  Now drive M will be both drive M and drive A, or whatever.
  716.  
  717.  A dir shows same exact files.
  718.  
  719.  While this is active the alternate drive is off line.
  720.  
  721.  To turn drive A back on:
  722.  ========================
  723.  
  724.  conf poke fbd1=82fa
  725.  
  726.  To turn drive B back on:
  727.  ========================
  728.  
  729.  conf poke fbd3=b9fa
  730.  
  731.  
  732.  And, one more obscure one before Ed throws me out of his Topic...
  733.  
  734.  This, for both 64 and 128 mode:
  735.  
  736.  If anyone would ever want a 1571 to mimic a dual disk drive, maybe to 
  737.  achieve software compatibility, here's how:
  738.  
  739.  Enter either in program or direct mode:
  740.  
  741.  open15,8,15,"v0>h0":close15
  742.  
  743.  Then format (new or header) the disk.
  744.  
  745.  Enter either in program or direct mode:
  746.  
  747.  open15,8,15,"v0>h1" close15
  748.  
  749.  Then format (new or header) the disk.
  750.  
  751.  The 1571 will now respond to program commands directed to drives 0 and 1.
  752.  
  753.  This one was never popular with 128 users, since the activity to the second 
  754.  side could not be burst.
  755.  
  756.  What you end up with is a two sided flippy, that doesn't get flipped, since 
  757.  the other side spins the wrong way....    :)
  758.  
  759.  Howie
  760.  ------------
  761. Category 5,  Topic 11
  762. Message 27        Mon Jul 20, 1992
  763. C128.JBEE [* Sysop *]        (Forwarded) 
  764.  
  765.  Yes, that 1571 trick was in vogue for a while with C-64 BBS owners because
  766.  the 1571 held up better than the C-1541 and had double the storage.
  767.  I think the Laser BBS for the C-128 also did this trick.
  768.  ------------
  769. Category 5,  Topic 11
  770. Message 28        Wed Jul 22, 1992
  771. CBM-ED [e.g.bell]            (Forwarded) 
  772.  
  773. I'll tell you what else that formatting trick is useful for Howie.  If a
  774. person has a lot of 1541 format disks, formatting the back side of the disk
  775. like that keeps the drive from doing all that rattling when y first turn the
  776. computer on or reset and it looks for a boot.  BTW, I think CP/M snippits have
  777. must as much a place here as anything in BASIC or ML for native mode.
  778.  ------------
  779. Category 5,  Topic 11
  780. Message 29        Fri Jul 24, 1992
  781. HOWIE-CBM                    (Forwarded) 
  782.  
  783.  Thanks Ed!   :)
  784.  
  785.  Howie
  786.  ------------
  787. Category 5,  Topic 11
  788. Message 30        Tue Aug 04, 1992
  789. CBM-ED [e.g.bell]            (Forwarded) 
  790.  
  791.  I added some <CR>'s to a snippet Rob posted earlier.  Included is the 
  792.  whole post...
  793.  
  794.  R.KNOP1 [Rob Knop]           at 01:34 EDT
  795.  
  796.  Here's a programming trick that someone in my UG (although I've been bad and
  797.  have missed two meetings :( ) came up with.  I am pulling this off the top of
  798.  my head, so check my code!
  799.  With this, you can execute direct mode commands from within a program.  Some
  800.  commands function differently (the one I have listed here will give an
  801.  error... big whoop, eh?), and one can think of uses for this.
  802.  
  803.  100 gosub1000
  804.  110 rem rest of code
  805.  
  806.  ...
  807.  
  808.  1000 print"<clr>inputa$":print"<c/dwn><c/dwn><c/dwn>":rem "enough downs???"
  809.  1010 print"restore<home>" 
  810.  1020 poke842,13:poke843,13:poke208,2:rem put 2 CR's in keyboard buffer 
  811.  1030 end
  812.  
  813.  What this will do is, put the command you want to execute on the screen, and
  814.  the direct mode "restore".  You then end your program; the two CR's in the
  815.  keyboard buffer are pulled out, the first one executing your command (here
  816. the
  817.  input statement), the second one executing the RETURN.  The RETURN returns
  818. you
  819.  to line 200 of the program.
  820.  
  821.  Neat, eh?
  822.  ------------
  823. Category 5,  Topic 11
  824. Message 31        Tue Aug 04, 1992
  825. CBM-ED [e.g.bell]            (Forwarded) 
  826.  
  827. Just a suggestion for any further additions to this topic... As Mark pointed
  828. out earlier in this topic, the '*sn' command is really  needed to make sure
  829. that what you enter is what we see.  It is  especially important so that the
  830. program segments don't get jumbled into long lines and line divisions are
  831. lost...  Stay tuned... this topic is still under construction...
  832.  ------------
  833. Category 5,  Topic 11
  834. Message 32        Tue Aug 04, 1992
  835. CBM-ED [e.g.bell]            (Forwarded) 
  836.  
  837.  Here is a little unnew taken from the book BASIC 7.0 Internals.  You
  838.  can't get much shorter than this without an outside utility...
  839.  
  840.         poke 7169,1:renumber
  841.  
  842.  Give it a try....
  843.  ------------
  844. Category 5,  Topic 11
  845. Message 33        Fri Sep 04, 1992
  846. HOWIE-CBM                    (Forwarded) 
  847.  
  848.  This is strictly C64 stuff, but it is sooo...  remarkable, I thought I'd 
  849.  place it here for max viewability.  Following from the C64 of John 
  850.  Iannetta:
  851.  
  852.  10 poke55,190:poke56,161:clr
  853.  20 a$="no"+"no"
  854.  30 b$=" honest"+" politicians"
  855.  40 b$="cheap"+"pc's"
  856.  50 c$=" good tv"+" shows"
  857.  60 c$="no"+"no"
  858.  70 printa$;b$;c$
  859.  
  860.  [To avoid even this 'lil bit of typing, those with BTP can use its 
  861.  tokenizing feature to write direct to disk.  Others might try saving as a 
  862.  SEQ, and then doing a: LOAD "filename,s",8]
  863.                                       ^^
  864.  
  865.  (Up arrows courtesy of Mark!)    :)
  866.  
  867.  Howie
  868.  ------------
  869. Category 5,  Topic 11
  870. Message 34        Fri Sep 04, 1992
  871. CBM-ED [e.g.bell]            (Forwarded) 
  872.  
  873.  How about a one-liner to change your prg files to SEQ files, stripping
  874.  line numbers in the process...
  875.  
  876.  open1,8,2,"file,s,w":cmd1:poke24,37:list:print#1:close1:poke24,27
  877.  
  878.  To make it a PRG type file on disk, change the ',s,w' to ',p,w'.
  879.  
  880.  You can also get a machine language monitor dump to SEQ file using a
  881.  similar technique.  Open a file, as above, but don't do any pokes.
  882.  Enter the CMD1 command, then the MONITOR command to enter the machine
  883.  language monitor.  Then just do a display of the desired memory range
  884.  using the 'd' or 'm' commands.  When the cursor comes back, exit the
  885.  monitor using the 'x' command, type  PRINT#1:CLOSE1.
  886.  
  887.  ------------
  888. Category 5,  Topic 11
  889. Message 35        Mon Sep 07, 1992
  890. M.DULSKI1 [Mark @WIZARD]     (Forwarded) 
  891.  
  892. Guys, I give this whole topic - ^^
  893.  ------------
  894. Category 5,  Topic 11
  895. Message 36        Tue Sep 08, 1992
  896. CBM-ED [e.g.bell]            (Forwarded) 
  897.  
  898. Hope that is good!   :^)  The only thing keeping me from puttting up a load
  899. more stuff is time and other projects, which of course, generate  more
  900. snippits.
  901.  ------------
  902. Category 5,  Topic 11
  903. Message 37        Wed Sep 09, 1992
  904. R.KNOP1 [Rob Knop]           (Forwarded) 
  905.  
  906. Hey, on the topic of example code, Craig Taylor, the C= Hacking Mag editor, is
  907. working on an article that ought to be very useful to beginning ML
  908. programmers.  It's the sort of article that I wished I had back when I knew ML
  909. well enough that I basically understood the opcodes and how they each worked,
  910. but was rather clueless about how to go about putting a largish program
  911. together.  Once issue 4 of this Hacking Mag shows up, I'll be sure to upload
  912. it to the libaries here.
  913.  
  914. -Rob
  915.  ------------
  916. Category 5,  Topic 11
  917. Message 38        Wed Sep 09, 1992
  918. C128.JBEE [* Sysop *]        (Forwarded) 
  919.  
  920.  I think LADS128 is the best book for a beginners.
  921.  How it shows the relationship between ML and Basic is worth the cover
  922.  price because it lets you "do now" and understand what you did.
  923.  ------------
  924. Category 5,  Topic 11
  925. Message 39        Wed Sep 09, 1992
  926. CBM-ED [e.g.bell]            (Forwarded) 
  927.  
  928.  I did a major upgrade to LADS, and when done w/my current project will resume
  929. my complete rewrite of it.  And I always liked it too.
  930.  ------------
  931. Category 5,  Topic 11
  932. Message 40        Tue May 18, 1993
  933. HOWIE-CBM                    at 06:12 EDT
  934.  
  935.  I ran across the following from John Iannetta, titled "REALLY NOTHING", which
  936.  while C64 specific (I think) is also equally applicable for the C128:
  937.  
  938.      The zero doesn't get much respect.
  939.   One would not be very pleased if it represented his income, net profit, net
  940.  worth, IQ score, life expectancy, batting average, pulse rate, etc.  And it
  941.  doesn't seem to do much.  If you add it to a number, the result is the same
  942.  number (0 is the "identity element" for addition).  But the invention of the
  943.  zero by the Hindus is considered to be one of the two most important advances
  944.  in mathematics (the other is positional notation, also by the Hindus).
  945.  
  946.      Roman numerals don't include a zero.
  947.   Partly for that reason, you see them only in copyright notices and on paper
  948.  money.  Computers use them all the time.
  949.   They account for about half of all the bits ever used.  In C-64 BASIC, it is
  950.  used for the color "black".  Poke 53280,0 for a black border, poke 53281,0
  951. for
  952.  a black background, poke 646,0 for a black foreground (characters).  Zero is
  953.  "@" in screencode.  If you poke 2004,0 you will see "@" on the bottom line of
  954.  your screen.  Poke 657,0 to prevent changing character set when you press
  955. SHIFT
  956.  and C= keys.  If you poke 56334,0 you will never poke again (until you do a
  957.  STOP/RESTORE).  It turns off the timer (the jiffy clock) that generates the
  958.  system interrupt.  If your terminal program always corrupts the first
  959. character
  960.  received, try doing a poke 169,0 before running the program.
  961.  
  962.      Using a FOR NEXT loop, 0 is often poked into memory to clear the SID
  963.  registers or to initialize graphics memory in hi-res mode (and for many other
  964.  purposes).  So what is the fastest way to do that?  Poke xxxx,0?  That is the
  965.  slowest way.  The following BASIC type-in program will count to 2000 using
  966. five
  967.  different FOR NEXT loops.  Each represents the zero differently.  When you
  968. run
  969.  the program, you will see the elapsed time for each routine. Actually, not0
  970. (or
  971.  -1) is subtracted from each preceding number.  I tried using 0 and it was
  972.  taking forever.  The first routine uses 0 and the second uses a variable (x).
  973.  But x is not defined in the program, so each pass through the loop, BASIC
  974. must
  975.  search through the seven simple variables.  When x is not found, 0 is used.
  976.  But x is NOT defined as 0, so the variables are searched on every pass.  But
  977.  the routine is still faster than the first.  Any time that digits are used
  978.  (whether 0 or 123 or 91), BASIC uses a long routine to convert the characters
  979.  to number in floating point form.
  980.  
  981.      The third FOR NEXT loop uses the variable y.  That IS defined, but as the
  982.  seventh and last of the simple variables.  That routine is a bit faster.  The
  983.  fourth routine uses the variable z, which is the first one defined.  That is
  984.  faster yet.  The last FOR NEXT loop uses "." for zero, and is the fastest of
  985.  them all.  BASIC evaluates "." to zero relatively quickly, and making use of
  986.  that fact can speed up a routine that pokes zeros into a large section of
  987.  memory.
  988.  
  989.  10 poke55,0:poke56,160:clr:z=0:i=0
  990.  20 e=1999:a$=chr$(145):s=60:n=0:y=0
  991.  30 a$(2)="0":a$(3)="x":a$(4)="y"
  992.  40 a$(5)="z":a$(6)=".":goto80
  993.  50 printtab(6);ti/s;tab(18);
  994.  60 print"seconds for ";a$(n)
  995.  70 print:ti$="000000":goto200
  996.  80 pokepeek(61)+256*peek(62)-3,n+50
  997.  90 n=n+1:ifn=1then70
  998.  100 goto50
  999.  200 fori=ztoe:printi-not0;a$:next
  1000.  250 goto80
  1001.  300 fori=ztoe:printi-notx;a$:next
  1002.  350 goto80
  1003.  400 fori=ztoe:printi-noty;a$:next
  1004.  450 goto80
  1005.  500 fori=ztoe:printi-notz;a$:next
  1006.  550 goto80
  1007.  600 fori=ztoe:printi-not.;a$:next
  1008.  650 goto80
  1009.  700 end
  1010.  
  1011.             John
  1012.  
  1013.  ------------
  1014. Category 5,  Topic 11
  1015. Message 41        Tue May 18, 1993
  1016. HOWIE-CBM                    at 06:13 EDT
  1017.  
  1018. uh oh....
  1019.  
  1020. I quess I should have reformatted a few of those lines above....  :(
  1021.  
  1022. Howie
  1023.  ------------
  1024. Category 5,  Topic 11
  1025. Message 42        Tue May 18, 1993
  1026. CBM-MARK                     at 11:32 EDT
  1027.  
  1028.  That snippet is simply excellent Howie!  Keep those comming  ;)
  1029.  
  1030.                 ~~Mark~~
  1031.  ------------
  1032. Category 5,  Topic 11
  1033. Message 43        Tue May 18, 1993
  1034. HOWIE-CBM                    at 23:08 EDT
  1035.  
  1036.  Mark,
  1037.  
  1038.  As long as you asked, here is another one from John Iannetta:
  1039.  
  1040.  --------
  1041.  
  1042.      Did you ever validate a 1541 or 1571 disk and find that you gained quite
  1043.  a few free blocks?  DOS is supposed to keep track of the number of free
  1044.  blocks as you write and delete files.  Every time you store a file onto your
  1045.  disk, DOS puts the block count into the directory entry for that file.  You
  1046.  see it when you list the directory.  Those blocks are allocated in the BAM
  1047.  (block availability map), and cannot be used by future files.  That number
  1048.  is also subtracted from the number of free blocks that appears at the bottom
  1049.  of a directory listing.
  1050.  
  1051.      If you delete (scratch) a file, the entry is removed from the directory.
  1052.  The blocks that were allocated are now freed up, and that number is added to
  1053.  the number of free blocks at the end of the directory.  So you can save and
  1054.  scratch files until the cows come home, and the numbers in the directory
  1055.  listing will always be correct.  WRONG WRONG WRONG.
  1056.  
  1057.      The sum of all of the file block counts plus the number of free blocks
  1058.  should be 664 for a 1541.  But there has been a bug in the DOS scratch (S0:)
  1059.  command that is still present in my 1541-II and 1571 with an -05 ROM.  If
  1060.  you scratch a file whose size is an integral multiple of 254 bytes, DOS will
  1061.  free up one block too few.  There are 254 data bytes in a disk block, so we
  1062.  are talking about the last block being completely full.  In the following
  1063.  BASIC type-in program, a file named "axolotl" is written to disk.  You can
  1064.  change the name (f$ in line 30) if you already have a file of that name on
  1065.  your disk.  The file is then scratched.  The number of free blocks is shown
  1066.  before and after the two operations, and you will see that you lose a free
  1067.  block each time that you run the program.
  1068.  
  1069.      If you run the program ten times, there will be ten fewer blocks shown
  1070.  to be free.  And the disk has the same files at the end as it had at the
  1071.  start.  You merely wrote "axolotl" ten times and scratched "axolotl" ten
  1072.  times.  Run 300 to validate the disk and see the original number of free
  1073.  blocks displayed. The number of blocks used by the file is in the variable
  1074.  n in line 20.  You can change n to any number, but I used 1 to save time.
  1075.  The 1541 never got any speeding tickets.  Some of the best C-64 software
  1076.  ever written was created while waiting for a 1541 to load a program.
  1077.  
  1078.  10 poke55,.:poke56,160:clr
  1079.  20 n=1:z$=chr$(0)
  1080.  30 f$="axolotl":gosub100
  1081.  40 open8,8,1,f$
  1082.  50 fori=1to254*n:print#8:next
  1083.  60 close8
  1084.  70 open15,8,15,"s0:"+f$:close15
  1085.  80 gosub100:end
  1086.  100 print:open8,8,0,"$$"
  1087.  110 fori=1to6:get#8,a$:next
  1088.  120 print:print"0 ";
  1089.  130 get#8,a$:printa$;:ifa$=""then150
  1090.  140 goto130
  1091.  150 print:get#8,a$:get#8,b$
  1092.  160 get#8,a$:get#8,b$:printchr$(157);
  1093.  170 printasc(a$+z$)+256*asc(b$+z$);
  1094.  180 get#8,a$:printa$;:ifstthen200
  1095.  190 goto180
  1096.  200 close8:return
  1097.  300 z$=chr$(0):gosub100
  1098.  310 open15,8,15,"v0:":close15
  1099.  320 gosub100
  1100.  
  1101.             John
  1102.  
  1103.  ---------
  1104.  
  1105.  Running the routine on a 1541 partition within RAMLink had no effect.
  1106.  Beginning and ending block count was the same.
  1107.  
  1108.  However, running it on a 1581 *with* JiffyDos, made me lose one block.
  1109.  
  1110.  A collect brought the missing block back.
  1111.  
  1112.  A nice one!   :)
  1113.  
  1114.  Howie
  1115.  ------------
  1116. Category 5,  Topic 11
  1117. Message 44        Tue May 18, 1993
  1118. CBM-MARK                     at 23:23 EDT
  1119.  
  1120.  Hey, great Howie!  I always noticed the 'extra' block or two that showed up
  1121.  after a validate but never knew *why*.  Now I do ;)
  1122.  
  1123.                  ~~Mark~~
  1124.  ------------
  1125. Category 5,  Topic 11
  1126. Message 45        Wed May 19, 1993
  1127. HOWIE-CBM                    at 03:01 EDT
  1128.  
  1129. oh!
  1130.  
  1131. For those wanting to RUN the program listing above (which I highly recommend
  1132. for those wanting to observe superb Basic coding in action), there is no need
  1133. to actually type it.  That is if you have access to an edit buffer like
  1134. BobsTermPro.  Simply tag the beginning and ending of the listing, and save to
  1135. disk with the Seq To Basic Program option.  It will run when loaded.
  1136.  
  1137. Howie
  1138.  ------------
  1139. Category 5,  Topic 11
  1140. Message 46        Mon May 31, 1993
  1141. CBM-ED [e.g.bell]            at 11:00 EDT
  1142.  
  1143.  I couldn't find the topic asking for it, but here is a little hack I 
  1144.  believe will return the Julian date for any gregorian date input in the
  1145.  format YYMMDD.  The only exception is the leap year exception that occurs
  1146.  on either centuries divisible by 100 or 400... couldn't remember which
  1147.  it was... it does work on all the leap years divisible by 4 otherwise.
  1148.  Does anyone know that quirk in the leap year calculations???
  1149.  
  1150.  
  1151.  20 d$="_\_^_^__^_^_"
  1152.  25 fast
  1153.  30 poke 241,peek(241) or 128
  1154.  35 input "Enter Date [YYMMDD] ";dd$
  1155.  40 :
  1156.  45 yr%=val(left$(dd$,2))
  1157.  50 lp%=-((yr%/4)=int(yr%/4))
  1158.  55 :
  1159.  60 mt%=val(mid$(dd$,3,2)):if mt%<1 or mt%>12 goto 85
  1160.  65 :
  1161.  70 dy%=val(right$(dd$,2))
  1162.  75 if dy%<=asc(mid$(d$,mt%,1)) and 31 goto 95
  1163.  80 if (mt%=2) and (dy%=29) and (lp%=1) goto 95
  1164.  85 print "Invalid Date":sleep 2:goto 35
  1165.  90 :
  1166.  95 jd%=.
  1167.  100 for x=1 to (mt%-1)
  1168.  105 :   jd%=jd%+(asc(mid$(d$,x,1)) and 31)
  1169.  110 next
  1170.  115 :
  1171.  120 jd%=jd%+dy%+(lp%*-(mt%>1)):print "Julian Date :"jd%:goto 35
  1172.  
  1173.  Line 20 will look more sensible when converted to graphic characters.
  1174.  The '_' is the commodore back arrow and the '^' is the commodore up
  1175.  arrow.  The '\' is the commodore pound-sterling key.
  1176.  ------------
  1177. Category 5,  Topic 11
  1178. Message 47        Fri Aug 20, 1993
  1179. G.CORREA [RAMRunner]         at 23:21 EDT
  1180.  
  1181. Heh.  Okay, folks, from an admitted Amiga lover you are reading an admission:
  1182. Now I remember WHY I loved the 128.  All these little hacker tricks.  Thanks
  1183. for the reminder, from me and my two 128s.
  1184.   As for my contribution, I cannot recall WHERE I got it.  All this talk about
  1185. BTP's tokenizing ability made me thing, geez, that'd be handy to have, but YOU
  1186. DON'T NEED IT.  There's a simpler way.
  1187.   Make sure you have a SEQ file.  It'd be best for the file to have no
  1188. extraneous characters in it, just the program, but blank lines are not a 
  1189. problem.  The READY. printed at the end of a listing (say you OPEN 1,8,1,
  1190. "filename,s,w": CMD 1: LIST: PRINT#1: CLOSE 1 to get the listing in SEQ form
  1191. to begin with) will be helpful as it will usually cause an error.
  1192. Alternatively, you can add a DCLEAR as the last line in the SEQ file, with no
  1193. line number.
  1194.   As an example,
  1195.   10 REM A handy little program.
  1196.   20 PRINT "This is a handy little program."
  1197.   DCLEAR
  1198.   (You of course would have to edit this into the file via buffer edit).
  1199.   Now, on to the actual trick.  You have a SEQ file which is a program listing
  1200. and an intense desire NOT to retype it all.  Whatcha gonna do...?  Enter, in
  1201. direct mode,
  1202.   OPEN 1,8,0,"filename,S,R"; SYS 65478,0,1
  1203.   The drive will whirr, blank lines will advance, and what winds it all up
  1204. depends on how the file ends.  If it is a LISTed file with a READY. at the end
  1205. and NO DATA statements, an ?OUT OF DATA error will come up and you're free to
  1206. DCLOSE or DCLEAR (which is my preferred method).  If it is a file that has
  1207. DCLEAR edited into the last line, it'll take care of itself.  If neither, then
  1208. you'll have to type blind, DCLEAR, when the drive motor shuts down (the busy
  1209. light will still be on).  You won't see anything on the screen except for
  1210. blank lines scrolling up.
  1211.   What this does is re-assign input from the keyboard to a SEQ disk file. Your
  1212. drive does all the typing for you.  :)
  1213.  ------------
  1214. Category 5,  Topic 11
  1215. Message 48        Sat Aug 21, 1993
  1216. CBM-ED [e.g.bell]            at 01:58 EDT
  1217.  
  1218.  Good one.  This was published by Miklos G. in an old issue of the
  1219.  Transactor.  I believe the article was titled 'An new look at an
  1220.  old dog' or something very similar.  It has lost nothing over the
  1221.  years for novelty and utility!
  1222.  ------------
  1223. Category 5,  Topic 11
  1224. Message 49        Sun Aug 22, 1993
  1225. G.CORREA [RAMRunner]         at 22:45 EDT
  1226.  
  1227. Ah!  Thanks, eg.  Now that you mention it, I recall it well.  Heckuva one-
  1228. liner.
  1229.  ------------
  1230. Category 5,  Topic 11
  1231. Message 50        Thu Nov 11, 1993
  1232. H.HERMAN1                    at 01:34 EST
  1233.  
  1234.  Here is the *updated* and *corrected* Pocket Writer 3 starter.  I _think_ I
  1235.  posted an earlier version in the Dialogue 128 topic.  Just capture it, and
  1236.  save it as a tokenized BASIC to disk. 
  1237.  
  1238.  --- snip here ---
  1239.  10 en=0:em$="":et=0:es=0
  1240.  20 u=peek(186)
  1241.  30 f$="today.dat"
  1242.  40 open15,16,15
  1243.  50 print#15,"t-rd"
  1244.  60 fori=0to7:get#15,z$:y(i)=asc(z$):next:close15
  1245.  70 ify(1)=93theny1$="1993"
  1246.  80 ify(1)=94theny1$="1994"
  1247.  90 ify(1)=95theny1$="1995"
  1248.  100 ify(1)=96theny1$="1996"
  1249.  110 ify(1)=97theny1$="1997"
  1250.  120 ify(1)=98theny1$="1998"
  1251.  130 ify(1)=99theny1$="1999"
  1252.  140 ify(1)=00theny1$="2000"
  1253.  150 ify(2)=1theny2$="January"
  1254.  160 ify(2)=2theny2$="February"
  1255.  170 ify(2)=3theny2$="March"
  1256.  180 ify(2)=4theny2$="April"
  1257.  190 ify(2)=5theny2$="May"
  1258.  200 ify(2)=6theny2$="June"
  1259.  210 ify(2)=7theny2$="July"
  1260.  220 ify(2)=8theny2$="August"
  1261.  230 ify(2)=9theny2$="September"
  1262.  240 ify(2)=10theny2$="October"
  1263.  250 ify(2)=11theny2$="November"
  1264.  260 ify(2)=12theny2$="December"
  1265.  270 y3$=right$(str$(y(3)),2)
  1266.  280 ify(3)<10theny3$=right$(y3$,1)
  1267.  290 x1$=" ":x3$=","
  1268.  300 xz$=y2$+x1$+y3$+x3$+x1$+y1$
  1269.  310 :
  1270.  320 open15,16,15:print#15,"cp3":close 15
  1271.  330 open15,u,15
  1272.  340 dopen#4,"@"+(f$)+",s,w",u16
  1273.  350 gosub440
  1274.  360 print#4,xz$
  1275.  370 gosub440:dclose#4,u16:close15
  1276.  380 :
  1277.  390 @"cd2:telcom",16
  1278.  400 open15,16,15:print#15,"s-8":fori=1to750:next:close15
  1279.  410 poke842,96:poke843,77:poke844,76:poke845,48:poke846,58:poke847,73
  1280.  415 poke848,78:poke849,13:poke850,108:poke851,80:poke208,10
  1281.  420 open15,11,15:print#15,"ui":close15,15:dload"pw",u11:end
  1282.  430 :
  1283.  440 input#15,en,em$,et,es
  1284.  450 ifen>1thenprint en,em$,et,es:dclose#4,u16:close15:stop
  1285.  460 return
  1286.  --- snip here ---
  1287.  
  1288.  Notes for use:
  1289.  --------------
  1290.  
  1291.  + Call routine from your CMD device which has the RTC.
  1292.  
  1293.  Instead of adding lots of comments to the above, below I'll tell you what
  1294.  is happening so that anyone can delete lines they do not want, and change
  1295.  others, as they want:
  1296.  
  1297.  + Lines 10-330 get the date for a file called today.dat.
  1298.  
  1299.  + Line 320 sets up partition 3 as the default
  1300.  
  1301.  + Lines 330-370 write the file, today.dat, which has today's date into
  1302.  partition number 3.
  1303.  
  1304.  + Line 390 changes the default again, this time to partition 2, and the
  1305.  subdirectory called TELCOM.
  1306.  
  1307.  + Line 400 swaps RAMLink into device #8, because PW 3 OVERLAY.* files are
  1308.  in RAMLink and PW 3 will boot up faster.
  1309.  
  1310.  + Lines 410- 415 poke keystrokes into the 128's keyboard buffer, and these
  1311.  keys will execute _AFTER_ PW 3 has booted.  More on this later.
  1312.  
  1313.  + Line 420 loads and runs PW 3 from drive #11
  1314.  
  1315.  + Line 440-460 do drive error checking and should be left in as it is a part
  1316.  of the routine to write today's date file.
  1317.  
  1318.  Now, if I remember correctly, here is what those pokes make PW do, once it
  1319.  has loaded:
  1320.  
  1321.  (1)  Load a macro file into its macro buffer from PW device 0.  The
  1322.  macro file is called: IN
  1323.  
  1324.  (2)  Execute macro "Q" from that macro file.
  1325.  
  1326.  Now macro "Q" can do anything you would like it to do, including running
  1327.  other macro keys, so you have about 1,000 auto keystrokes to customize
  1328.  things to your liking.
  1329.  
  1330.  Among some of the things it does for me:
  1331.  
  1332.  (a) Swaps RAMLink back into device #16.
  1333.  
  1334.  (b) Loads the file TODAY.DAT into a "template" file so that it gets postioned
  1335.  correctly, and saved to REU in real ascii.  This then allows today.dat on
  1336.  the REU to be accessed by all templates as an external file, which always has
  1337.  the current date.
  1338.  
  1339.  (c) Resets the default RAMLink partition/directory.
  1340.  
  1341.  (d) Concludes by leaving me in a directory of partition 7, with the cursor
  1342.  placed under the template I most often use.  (If I will be using this, a
  1343.  <CR>, or mouse click, has it loaded into PW's buffer.  If not, I am in the
  1344.  partition which holds all PW templates, and can then select another.)
  1345.  
  1346.  It may do some more minor things, but this is the thrust of what all it
  1347.  does each time PW boots.
  1348.  
  1349.  All this customizing adds 2-3 seconds to the overall boot time.
  1350.  
  1351.  Howie
  1352.  
  1353.  P.S.  By extension the procedures listed might work with many different
  1354.  word processors and commercial programs.  It works with all 3 of Digital
  1355.  Solution's Pocket programs.
  1356.  ------------
  1357. Category 5,  Topic 11
  1358. Message 51        Thu Nov 11, 1993
  1359. CBM-ED [e.g.bell]            at 04:01 EST
  1360.  
  1361.  Nice addition to the topic Howie!!!  :)
  1362.  ------------
  1363. Category 5,  Topic 11
  1364. Message 52        Wed Dec 29, 1993
  1365. S.EYRSE                      at 21:51 EST
  1366.  
  1367.  This will TOKENIZE a seq text file
  1368.  that you have downloaded from this or
  1369.  other Boards. It is very good for those
  1370.  quick little things that people put in
  1371.  posts.
  1372.      It will run in a AUTO mode or
  1373.  MANUAL use which ever is best for the
  1374.  file your working on.
  1375.      There are Doc's attached which
  1376.  explain all in more depth. It only goes
  1377.  one way SEQ to BASIC, cause that is all
  1378.  you really need.  STEVE :)
  1379.  And what this is is file TOKENS.ARC
  1380.  that I just uploaded to area 20 Disk&File
  1381.  seemed to be the right place. It should be
  1382.  file #14055 when released. Hope it will 
  1383.  help those who don't have Bob's term but
  1384.  want to have the Puter type in the small
  1385.  files found here..
  1386.  ------------
  1387. Category 5,  Topic 11
  1388. Message 53        Mon Oct 03, 1994
  1389. H.HERMAN1                    at 05:29 EDT
  1390.  
  1391. Would anyone know if there is any difference, when do a software reset on the
  1392. 128, between using sys65341, or BANK1:sys57344?
  1393.  
  1394. From observation, they both seem to do the same thing, very well.  Anyway, I
  1395. wondered if one would be better to use than the other.
  1396.  
  1397. Howie
  1398.  ------------
  1399. Category 5,  Topic 11
  1400. Message 54        Mon Oct 03, 1994
  1401. CBM-ED [e.g.bell]            at 08:20 EDT
  1402.  
  1403.  Howie:  Both end up at the same address, sort of.  Instead of BANK 1
  1404.  you should really do BANK 15.  The routine may be copied into all
  1405.  banks, but I would recommend accessing it in bank 15.  SYS 65341 should
  1406.  also work in BANK 1 as the routine is copied into all banks 'just in 
  1407.  case'.
  1408.  
  1409.  The difference between the two is just that one is a documented entry
  1410.  address and the other is the direct address.  When I need to do a reset
  1411.  I use the 'bank 15:sys 57344' or from the monitor, 'g fe000' to call this
  1412.  block of code.  Commodore internal code uses an internal call, 
  1413.  JMP ($FFFC) to do the same thing (at yet another entry point).
  1414.  
  1415.  Another recommended entry point (which I have never found completely
  1416.  satisfying) is at 65366, the PHOENIX entry point which is supposed to,
  1417.  among other things, call the routine at 57344 to some point.  Try it tho
  1418.  from immediate mode, and you will see that it does not do the same thing
  1419.  as the RESET routine (57344) at all, at least not all of the same things.
  1420.  The evidence will be on your screen.
  1421.  
  1422.  Does all of this answer your question or just muddy the water further.
  1423.  >:)
  1424.  ------------
  1425. Category 5,  Topic 11
  1426. Message 55        Tue Oct 04, 1994
  1427. H.HERMAN1                    at 04:11 EDT
  1428.  
  1429. Ed,
  1430.  
  1431. It sure does!  No more muddy waters here....
  1432.  
  1433. The extra info about PHOENIX and g fe000 are especially interesting.  I  like
  1434. the g fe000 and see myself using this from now on, and when I run into 
  1435. trouble.
  1436.  
  1437. I did PHOENIX a number of times, and while it is certainly a lot faster  than
  1438. SYS 65341 or BANK15:SYS57344, I get the feeling that it is not quite  as
  1439. thorough.  It just seems too fast.  What?  Booting the RAMLink boot  file.  I
  1440. feel better when the 128 seems to take its time, and (hopefully)  go through a
  1441. series of resets, or whatever, during that 1.5 second delay,  or whatever it
  1442. might be.
  1443.  
  1444. The difference between the original two is something that I had wondered 
  1445. about for quite sometime.
  1446.  
  1447. Now I can begin to wonder about more esoteric things!  :)
  1448.  
  1449. Thanks!
  1450.  
  1451. Howie
  1452.  
  1453.  ------------
  1454. Category 5,  Topic 11
  1455. Message 56        Mon Nov 14, 1994
  1456. H.HERMAN1                    at 21:51 EST
  1457.  
  1458.  Here's one of Jim Brain's teaser-questions......
  1459.  
  1460.  At the Basic interperter enter:  ?""+-0
  1461.  
  1462.  I did, and was I surprised!!  :)
  1463.  
  1464.  I quess Jim will explain all this...
  1465.  
  1466.  Howie
  1467.  ------------
  1468. Category 5,  Topic 11
  1469. Message 57        Sat Nov 26, 1994
  1470. BADCO                        at 16:49 EST
  1471.  
  1472. Anyone have a snippit to sniff out whether a machine has 64k VDC ram oor 16k?
  1473. I am having a dog of a time figuring out how to do this... I know there must
  1474. be a way. I can go into 64k mode with machines that have 64k fine and all
  1475. that, I just need to be able to tell if a machine has 64k VDC in it or not.
  1476.    Regards,
  1477.        Sean. 
  1478.  ------------
  1479. Category 5,  Topic 11
  1480. Message 58        Sat Nov 26, 1994
  1481. E.GBELL [e.g.bell]           at 19:43 EST
  1482.  
  1483.  Sean:  There was a little one posted around here not too long ago by
  1484.  Fred Bowen.  Bet THE.OUTLAW still has a copy of it somewhere.  I was
  1485.  never able to get it to work, but others were.
  1486.  ------------
  1487. Category 5,  Topic 11
  1488. Message 59        Sat Nov 26, 1994
  1489. THE.OUTLAW                   at 21:56 EST
  1490.  
  1491. I'll have to look for it, I know it's here somewhere :>
  1492.  ------------
  1493. Category 5,  Topic 11
  1494. Message 60        Sun Nov 27, 1994
  1495. BADCO                        at 08:41 EST
  1496.  
  1497. I would greatly appreciate it. I really need this code. I am working on puon
  1498. putting all the maps for GWterm into VDC ram, (provided you have a 64k VDC
  1499. machine) as to speed up the play even further. Along with a few other "bonus"
  1500. features I have in mind for 64k vdc machines
  1501.     Thanks in advance,
  1502.             Sean
  1503.  ------------
  1504. Category 5,  Topic 11
  1505. Message 61        Sun Nov 27, 1994
  1506. THE.OUTLAW                   at 12:09 EST
  1507.  
  1508.   
  1509.  EB> Sean:  There was a little one posted around here not too long ago by
  1510.  EB> Fred Bowen.  Bet THE.OUTLAW still has a copy of it somewhere.  I was
  1511.  EB> never able to get it to work, but others were.
  1512.  
  1513.  Here it is. I couldn't find the original post, so I retyped it! :>
  1514.  
  1515.   ------------
  1516.  1 REM FRED'S NIFTY PROGRAM TO DETERMINE SIZE OF 8563 DRAM
  1517.  10 BANK15: AD=DEC("D600"): DA=AD+1: GOSUB 900             :REM SETUP ML
  1518.  20 POKEAD,28: S=PEEK(DA): POKEDA,63                       :REM SELECT 64K
  1519.  30 I=16896: SYSW,I/256,18:SYSW,IAND255,19,SYSW,85,31      :REM WRITE $55
  1520.  40 I=16896: SYSW,I/256,18:SYSW,IAND255,19:SYSR,,31:RREGC1 :REM READ HERE
  1521.  50 I=17152: SYSW,I/256,18:SYSW,IAND255,19:SYSR,,31:RREGC2 :REM AND HERE
  1522.  60 I=16896: SYSW,I/256,18:SYSW,IAND255,19:SYSW,170,31     :REM WRITE $AA
  1523.  70 I=16896: SYSW,I/256,18:SYSW,IAND255,19:SYSR,,31 RREGC3 :REM READ HERE
  1524.  80 I=17152: SYSW,I/256,18:SYSW,IAND255,19:SYSR,,31 RREGC4 :REM AND HERE
  1525.  90 POKEAD,28: POKEDA,S:SYSDEC("FF62")                     :REM RESTORE 16/64K
  1526.  100 IF C1=C2 AND C3=C4 THEN PRINT "16K": ELSE PRINT"64K"  :REM DID IT ECHO?
  1527.  110 END
  1528.  900 FORI=0TO13: READA$: POKEDEC("1800")+DEC(A$): NEXT
  1529.  910 R=DEC("1800"): DATA 8E,00,D6,AD,01,D6,60              :LDA $D601:RTS
  1530.  920 W=DEC("1800"): DATA 8E,00,D6,8D,01,D6,60              :LDA $D601:RTS
  1531.  930 RETURN
  1532.  ------------
  1533. Category 5,  Topic 11
  1534. Message 62        Sun Nov 27, 1994
  1535. D.TUOMI [Doctor]             at 21:25 EST
  1536.  
  1537.  I originally asked this question myself.  The program I finally came up
  1538.  with (which was actually a hybrid of the various programs on-line was
  1539.  ) was this:
  1540.  
  1541.  10 BANK 15:AD=DEC("D600"):DA=AD+1:R=DEC("1800"):W=DEC("1807")
  1542.  20 FOR I=0 TO 13:READ A$:POKE R+I,DEC(A$):NEXT I
  1543.  30 DATA 8E,00,D6,AD,01,D6,60,8E,00,D6,8D,01,D6,60
  1544.  35 POKE AD,28:S=PEEK(DA):POKE DA,63
  1545.  40 I=16896:WW=85:X=0:GOSUB 100:X=1:GOSUB 100:C1=X:I=17152:X=1:GOSUB100:C2=X
  1546.  45 POKE AD,28:POKE DA,S:SYS ("FF62")
  1547.  50 IF C1=C2 THEN PRINT "16K VDC":ELSE PRINT "64K VDC"
  1548.  60 END
  1549.  100 SYS W,I/256,18:SYS W,I AND 255,19
  1550.  110 IF X THEN SYSR,,31:RREGX:RETURN:ELSE SYSW,WW,31:RETURN
  1551.  
  1552.  I hope I typed that in correctly. It should be if you have problems let
  1553.  me know.  That's the routine I ended up using in my 128 menu program.
  1554.  
  1555.  Doc.
  1556.  ------------
  1557. Category 5,  Topic 11
  1558. Message 63        Sat Dec 03, 1994
  1559. J.THOMPSO122 [JIMBOB51]      at 23:28 EST
  1560.  
  1561. Maverick from Software support will do that. Plus they sell the memory board
  1562. if you want to add on.
  1563.  
  1564.         Jimbob ;]
  1565.  ------------
  1566. Category 5,  Topic 11
  1567. Message 64        Mon Dec 05, 1994
  1568. E.GBELL [e.g.bell]           at 18:07 EST
  1569.  
  1570.  For anyone who wants it, I fixed the file sent up to detect 16 or 64K
  1571.  VDC.  I have never been able to get the ones I buffer to work.  This one
  1572.  does, at least for me.... all of my machines are now 64K, and they detect
  1573.  it fine.  Someone w/a 16K machine might want to give this a try to make 
  1574.  sure that works too.
  1575.  
  1576.  1 rem fred's nifty program to determine size of 8563 dram
  1577.  5 w=dec("cdcc"):r=dec("cdda")
  1578.  10 bank15: ad=dec("d600"): da=ad+1                        :rem setup ml
  1579.  20 pokead,28: s=peek(da): pokeda,63                       :rem select 64k
  1580.  30 i=16896: sysw,i/256,18:sysw,iand255,19:sysw,85,31      :rem write $55
  1581.  40 i=16896: sysw,i/256,18:sysw,iand255,19:sysr,,31:rregc1 :rem read here
  1582.  50 i=17152: sysw,i/256,18:sysw,iand255,19:sysr,,31:rregc2 :rem and here
  1583.  60 i=16896: sysw,i/256,18:sysw,iand255,19:sysw,170,31     :rem write $aa
  1584.  70 i=16896: sysw,i/256,18:sysw,iand255,19:sysr,,31:rregc3 :rem read here
  1585.  80 i=17152: sysw,i/256,18:sysw,iand255,19:sysr,,31:rregc4 :rem and here
  1586.  90 pokead,28: pokeda,s:sysdec("ff62")                     :rem restore 16/64k
  1587.  95 print chr$(14)chr$(147)
  1588.  100 if c1=c2 and c3=c4 then print "16K": else print"64K"  :rem did it echo?
  1589.  110 end
  1590.  
  1591.  You'll note that the data statements are gone.  They poked a shortened 
  1592.  form of the VDC pokes into memory.  I just used existing ROM routines to
  1593.  do this, and an added plus are that these do the whole procedure. 
  1594.  ------------
  1595. Category 5,  Topic 11
  1596. Message 65        Sun Apr 02, 1995
  1597. W.OVE                        at 14:36 EDT
  1598.  
  1599. I am looking for the vector that is used for the reset of the computer when
  1600. the reset button is pushed. I assume that this must be something in hardware
  1601. that alway goes to the same place.  I am hoping to modify a program that
  1602. always restes back to itsefl when the button is pushed. I am hoping to get it
  1603. to go back to basic. I would like to find the  address it is going to so I
  1604. could do a restart to the progrm with a  syssys from basic. 
  1605.  
  1606. I am not sure this is clear to even me. I do hope someone follows what I am
  1607. saying.  Also is there a memory map or documentation in library files on Genie
  1608. that would help whith these types of questions. The jargon of the macjhine and
  1609. machine language programers is confusing. to the dabbler. Are vectors the same
  1610. as pointers/? Is charout the name of a latin singer? thank you w.ove
  1611.  ------------
  1612. Category 5,  Topic 11
  1613. Message 66        Sun Apr 02, 1995
  1614. E.GBELL [e.g.bell]           at 19:20 EDT
  1615.  
  1616.  Bill:  Oddly enough, that is one of the questions that got me started 
  1617.  learning ML.  Of course, when I was starting, books were very easy to
  1618.  find and magazines were plentiful.  I don't have an answer for you right
  1619.  off the top of my head, but I can answer some of what you ask....
  1620.  
  1621.  A vector is kind of like a pointer.  Think of it like this.... your boss
  1622.  wants you to do something for him.  He sends you to the mail room where you
  1623.  pick up the orders telling you what he wants done.  He could have told you
  1624.  directly, but instead he sent you to the mail room.  Here is the kick...
  1625.  when you go to the mail room to get your orders, they tell you to go back
  1626.  to the printer right outside the boss' office and get the memo there and
  1627.  deliver it to the dispatcher.  That is kind of how vectors always struck
  1628.  me.... a machine language routine jumps through a vector, which is indeed
  1629.  a pointer, and in the case of the Commodore, the initial pointer points to
  1630.  the address immediately after the original jump.  The benefit is that the
  1631.  vector is in RAM and can be changed by you or anyone... things can be 
  1632.  'wedged' in in that way..... new routines that do their stuff and then 
  1633.  go where they were originally headed.
  1634.  
  1635.  The reset vector in the 1128 (and the 64 too I believe) is at $FFFC, which
  1636.  is RAM sort of... in that it is copied into all banks so that it can be 
  1637.  accessed wherever the computer happens to be when the reset is pushed.
  1638.  However, there must be one master copy, and this is the one I think you 
  1639.  would have problems with....
  1640.  
  1641.  You might be able to trick the program by wedging something into the
  1642.  NMI vector at 792 and 793 to point at address 16387 (I believe that is it)
  1643.  which is the basic warm start address.  The pokes would be:
  1644.  
  1645.      poke 792,3 : poke 793,64
  1646.  
  1647.  If your program does not change the vectors, when you press the RESTORE
  1648.  key this should drop you gently into the BASIC editor at the READY prompt.
  1649.  No guarantees... just one of the things I'd try if I were working on
  1650.  it.
  1651.  
  1652.  CHAROUT, or CHROUT, which I prefer, just a commonly used label for the
  1653.  ROM routine that prints a character out to whatever channel (screen/printer/
  1654.  etc.) happens to be open.  Might be a Latin singer too... not sure.  :)
  1655.  
  1656.  By the way, my quest years ago was to do this on the 64 so that the
  1657.  reset key would just restart the program.  There is a way to beat the
  1658.  reset key with a few pokes of specific characters at the right address 
  1659.  and the address where you want the program to jump.  Keep in mind that
  1660.  even knowing where the address is of the vector being used, you would still
  1661.  have to find out where it is loaded.  :/
  1662.  ------------
  1663. Category 5,  Topic 11
  1664. Message 67        Sun Apr 02, 1995
  1665. D.TUOMI [Doctor]             at 19:34 EDT
  1666.  
  1667. One of the ways I know of to change the reset on the 64 is by fooling the
  1668. computer into thinking there is a cartridge in the port.  You do this by
  1669. placing a set of characters in a particular location.  Unfortunately, I do not
  1670. have my notes here with me, so I can't tell you preceisly, but someone else
  1671. might be able to jump in.  Once the computer is fooled into thinking a
  1672. cartridge is in place, it will try to run whatever is at location 32768 in
  1673. memory.  You can place your own program there to do whatever it is you want to
  1674. do.
  1675.  
  1676. Doc.
  1677.  ------------
  1678. Category 5,  Topic 11
  1679. Message 68        Thu Apr 06, 1995
  1680. W.OVE                        at 08:23 EDT
  1681.  
  1682. Thank you for your replys. Actually the restore key serves a good  function f
  1683. in the prigram and so I don not wish to change it. I am looking to get the
  1684. computer to set set (get the Commodore start up screen) when I push the reset
  1685. button on the side of the computer.  The program corrently just restarts
  1686. itself when you push the button. It has a quit sequence, but if you go through
  1687. that it washes the  memory. If I could get a normal reset it would still be in
  1688. memory and I could restart it with a sys. I was assuming that the computer
  1689. have some location determined by hardware/rom that it must have to first got
  1690. to to begin the restart sequence, and wass hoping that if the program is
  1691. changing vector? pointer? that I could change it back to the stock one that I
  1692. could get a normal restart of the computer by pushing the reset button.
  1693.   w.ove
  1694.  ------------
  1695.  
  1696. Command: CATegories, TOPics, REAd, REPly
  1697.          BROwse, SETcat, EXIt, or HELp
  1698.   
  1699.   
  1700.  --------------------------------------
  1701.              End of Messages 
  1702.  --------------------------------------
  1703.