home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / genie-commodore-file-library / Information / 00CAT5MSGS.SFX / 01cat5msgs < prev   
Encoding:
Text File  |  1990-02-12  |  43.6 KB  |  1,045 lines

  1.  ************
  2. Topic 3         Mon Oct 21, 1991
  3. H.HERMAN1                    (Forwarded) 
  4. Sub: miscellany...                          
  5.  
  6. I couldn't think of any other place where I could put this.
  7. 82 message(s) total.
  8.  ************
  9.  ------------
  10. Category 5,  Topic 3
  11. Message 41        Wed Aug 25, 1993
  12. T.RUTTER2 [Troy Rutter]      at 22:37 EDT
  13.  
  14. Ed:
  15.  
  16. Sounds great, except for one small detail.  When Kermit made his source code
  17. available for SIDpic, he left the following in the file description:
  18.  
  19. "This code requires the use of Craug Chamberlain Sidplayer M/L (version one)
  20. that was especially modified to work with my player.  If you want to work on
  21. this and add more to my player, I cannot help you beyond providing this code
  22. abd pointing you to the M/L attached to SIDPIC V3.5 - I cannot distribute
  23. Craig's M/L as it might offend him.  If you want it though, you CAN figure out
  24. from my Source Code where his M/L loads into, and take it out of SIDPIC V3.5."
  25.  
  26. So, the actual ML that PLAYS the music is still in executable form only.  I
  27. would still appreciate it, however, if you took a look at the source code.
  28. Especially routines such as:
  29.  
  30. frommem
  31.  convert
  32.  
  33. and etc.
  34.  
  35.  
  36. PS.. the SIDfest is not until 1994.
  37.  -Troy
  38.  ------------
  39. Category 5,  Topic 3
  40. Message 42        Wed Aug 25, 1993
  41. C128.JBEE                    at 22:48 EDT
  42.  
  43.  Since I have the exclusive rights to the book, I do not mind the passing of
  44.  the code back and forth if it means getting something accomplished that
  45.  will increase the sales of the book.
  46.  ------------
  47. Category 5,  Topic 3
  48. Message 43        Thu Aug 26, 1993
  49. CBM-ED [e.g.bell]            at 10:00 EDT
  50.  
  51.  Does that mean, John, that you do have the source code for the SID
  52.  player?  ;)
  53.  
  54.  Troy:  I looked at the source code you sent me today, and I can honestly
  55.  say I can't understand why Kermit made such an extensive use of the 
  56.  .bas pseudo-op in PAL!  It is confusing reading, but I did find something
  57.  you should find interesting.  The routines you want to convert and
  58.  print the word strings seem to me to already exist in the code.  The
  59.  pertinent routine is FROMMEM in line 352.  It first calls the routine
  60.  called ROUTINE, which moves the variable pointers for I presume A1$ 
  61.  into the variables at $8c-$8e.  These are used as pointers and general
  62.  information into the string.  Note the definition of A1$ in line 11.
  63.  This seems to me to be defining the string in memory for use by the
  64.  FROMMEM routine.  It receives the string data when you call FROMMEM from
  65.  the BASIC routine.  Note particularly lines 161-175 (esp. lines 166-175).
  66.  If you study this routine, you should be able to either use it or see
  67.  how it is used.  It seems to me to do exactly what you want done tho,
  68.  and in ml to boot.  The routine CONVERT at line 410 in your source
  69.  file is a conversion routine.  I did not study it closely, but based
  70.  on what you say, I assume it converts A1$ data to the proper format.
  71.  It makes this change to the string directly.
  72.  
  73.  Without running this, the code seems to me to:
  74.  
  75.  set the word address in lne 168, poking the low and high bytes into
  76.  113 and 114  ($71/$72 used in FROMMEM)  I'm not sure what line 166 is
  77.  doing, but I bet it is turning something off, probably an interrupt (I
  78.  just checked... that is exactly what it is doing. See line 833)
  79.  167 is also assigning LA the value held in .x(low) and .y(high).
  80.  Line 169 calls FROMMEM, which loads the next string into A1$, and then
  81.  puts the length of that string into A.  Line 170 puts the string into
  82.  t$, necessary since you NEVER want to mess with A1$ or you would goof
  83.  it up as far as length!!!!  It assigns it the value of left$(a1$,a)
  84.  which pares it down to its actual length.  Line 171 apparently sets up
  85.  the pointer for the next string an also stores that in WA. Line 172
  86.  sets up the FROMMEM routine again, and line 173 calls it, doing as 
  87.  described above.  Line 174 converts a1$ for printing and stores it into
  88.  w2$ and updates the address pointer.  At this point, I don't know what
  89.  the difference is between t$ and w$, but you could find that out by
  90.  doing run-time displays (after reassembling the program with the
  91.  appropriate instructions) to see what is in them with each iteration
  92.  of the routine.  Bottom line is that the routines you need are already
  93.  written and available for your use.  Give them a try and see if I'm not
  94.  right.  
  95.  
  96.  Now, do you have access to Kermit Woodall?  I contacted him YEARS ago
  97.  about using Wxmodem in BellTerm,tho I never did.  I don't have his 
  98.  address even if I did have a presence of mind with him.  Based on what
  99.  John said about the book rights, it seems you have a basis for asking
  100.  for Craig's player source code if you are willing and have that kind
  101.  of access to him, and I would consider it a personal favor if you did!
  102.  egb
  103.  ------------
  104. Category 5,  Topic 3
  105. Message 44        Sat Aug 28, 1993
  106. T.RUTTER2 [Troy Rutter]     at 13:46 EDT
  107.  
  108. Ed, all,
  109.  
  110. unfortunately, I have tried to use those subroutines in my programs and it
  111. locks up...  i think it is bad memory management... here is what I have:
  112.  
  113. Main basic program:  7169-10026
  114.  ML (frommem,routine,convert) 12288-12378
  115.  SID files load in at 15000
  116.  sid routine:  49152-53152
  117.  
  118. And it locks up after i use modlink to put them all in one file.  Im wondering
  119. if modlink iteself uses some of that memory in there.
  120.  
  121. Also, i wonder why the basic program loads at 7169... isnt it sposed to load
  122. at 2048 or something?
  123.  
  124. BTW.. modlink = Modlink by Robert Stoerelle (MALAKAI)
  125.  
  126. Any idears?
  127.  
  128.  ------------
  129. Category 5,  Topic 3
  130. Message 45        Sat Aug 28, 1993
  131. C.DRUTIS [Monsoon]           at 23:15 EDT
  132.  
  133. Greetings. This seems as good a place to ask as any...
  134.  
  135. Could someone tell me if it's possible to run an ML subroutine within Bank 1?
  136.  
  137.   I want to put a text editor within Bank 1, but no matter what I do with the
  138. MMU register or the PCR's, the program refuses to work properly (or at all)
  139. within Bank 1. It works fine when I load it in Bank 0, though.
  140.  
  141.    For Bank 1, I begin with the following code:
  142.  
  143.      LDA #$4E   ; corresponds to %01001110 which SHOULD be : Bank 1 RAM
  144.      STA $D500  ;                                         Kernal and IO
  145.      .
  146.      .
  147.      .
  148.      STA $FF00
  149.  
  150.     Of course when I use it in Bank 0 I use LDA #$0E.
  151.  
  152.     Any help would be apprecitated.
  153.  
  154. [Apptest 0000321.A]
  155.  
  156.  ------------
  157. Category 5,  Topic 3
  158. Message 47        Sun Aug 29, 1993
  159. C128.JBEE                    at 00:43 EDT
  160.  
  161.  It sounds like a Basic 7.0 shell (C-128) using the original SID ML (C-64).
  162.  ------------
  163. Category 5,  Topic 3
  164. Message 48        Sun Aug 29, 1993
  165. R.KNOP1 [Rob Knop]           at 00:43 EDT
  166.  
  167. Troy-
  168.  
  169. I don't think you want to link these various sections into one file.  It looks
  170. like there are gaps between where the various sectios want to go.  I don't
  171. know how this linker works, but if it just links the files together into one
  172. program, the resulting program will load sequentially in memory starting at
  173. the load address, not putting the various parts where they ought to go.
  174.  
  175. If modlinker takes care of this, somebody please correct me....
  176.  
  177. Re: the starting address, the usual start for BASIC programs is indeed 2049.
  178. It sounds like the code was moved up for a relocated start-of-BASIC (e.g. to
  179. make room below the start of BASIC for a custom character set, a trick I used
  180. to use way back when).
  181.  
  182. How do you want this program to function after it has been linked?
  183.  
  184. -Rob
  185.  ------------
  186. Category 5,  Topic 3
  187. Message 49        Sun Aug 29, 1993
  188. R.KNOP1 [Rob Knop]           at 00:44 EDT
  189.  
  190. Monsoon-
  191.  
  192. I assume that you are issuing a "BANK 1" command before loading the ML program
  193. and SYS'ing to the address?  If not, then there's the simple answer :D
  194.  
  195. What are you calling in the way of BASIC and KERNAL subroutines?  I am not
  196. sure, but I believe it possible that some of the Kernal subroutines may only
  197. return to bank 15, or at any rate a configuration with RAM 0 rather than RAM 1
  198. visible.  Hopefully, and probably, this is not the case, and the Kernal
  199. routines are friendly, but it is possible.  It is more likely with some of the
  200. BASIC routines.  It's been years since I've directlly called any BASIC or
  201. KERNAL routines from RAM 1, and the only reason I did that was because I was
  202. doing it from within GEOS, and in GEOS it is usually not necessary to directly
  203. call BASIC or the Kernal.
  204.  
  205. Any idea just where the code is dying?  What is the manner in which it dies?
  206.  
  207. Ideally, ML things should work in RAM 1 just as they do in RAM 0.
  208.  
  209. Curious, why are you locating the program in RAM 1 as opposed to RAM 0?
  210.  
  211. -Rob
  212.  ------------
  213. Category 5,  Topic 3
  214. Message 50        Sun Aug 29, 1993
  215. R.KNOP1 [Rob Knop]           at 00:45 EDT
  216.  
  217. Aha!  JBEE posted that even as I was composing my reply, but yes, that load
  218. address is the standard start of BASIC for the 128, so it may be the BASIC
  219. program was intended to run on the 128.
  220.  
  221. -Rob
  222.  ------------
  223. Category 5,  Topic 3
  224. Message 51        Sun Aug 29, 1993
  225. C.DRUTIS [Monsoon]           at 04:09 EDT
  226.  
  227. Rob,
  228.  
  229.    Yes, I've issued a BANK1 command when I've tried to start if from Basic.
  230. I've also issued a G10400 (it resides at $400 in Bank 1) from the monitor.
  231.  
  232.    It doesn't crash... it simply stalls. In other words nothing happens. The
  233. computer doesn't lock up because it responds to a RS/Restore. This is why I'm
  234. puzzled. If it couldn't reach the kernal from Bank 1, it would (or should)
  235. break and drop to the monitor.
  236.  
  237.    I'm beginning to suspect that the kernal and the 128's editor wasn't
  238. designed to interact with Bank 1. I was kinda hoping someone had successfully
  239. written a program that uses them from Bank 1. Thanks anyway.  :)
  240.  
  241.    Oh... I want to put it in Bank 1 because of memory constraints in Bank 0. I
  242. also don't want to rewrite the entire thing using INDFET and INDSTA and the
  243. like. Call it laziness. <g>
  244.  
  245. [Apptest  00324.A]
  246.  
  247.  ------------
  248. Category 5,  Topic 3
  249. Message 52        Mon Aug 30, 1993
  250. R.KNOP1 [Rob Knop]           at 01:08 EDT
  251.  
  252. Monsoon- re: putting code in Bank 1 because of memory constraints, actually,
  253. this is a reasonable thing to do.  Speed constraints would be another good
  254. reason; if you are writing (say) a text editor that keeps its text in BANK 1,
  255. it might be advantageous to write short "memory moving" routines in bank 1,
  256. which would save several cycles for each lda and sta as compared to INDSTA and
  257. INDFET.
  258.  
  259. One other little obvious thing to check: how have you set the MMU register for
  260. common memory?  If you haven't messed with it, $400 should be fine. Also, are
  261. you using this program at all with BASIC?  If so, have you moved up the
  262. pointers for the bottom of variable memory?
  263.  
  264. Re: 128's OS interacting with Bank 1, in my experience the monitor works
  265. beautifully with Bank 1, no problem there.  Again, I am not sure about the
  266. Kernal.
  267.  
  268. One thing that might be worth trying: setting break points.  You can do this
  269. manually, by replacing instructions with BRK instructions.  Put these varying
  270. distances into your code, and if, when you execute the code, the program
  271. breaks out to the monitor from one of these, you know that the code is at
  272. least getting that far.  Another option would be to check out HEXPERT, which
  273. is a simple ML debugger that lets you set breakpoints and step through code. I
  274. am not sure that Hexpert will work with code in Bank 1, since (again) I
  275. haven't tried it, but it's probably worth looking at.
  276.  
  277. -Rob
  278.  ------------
  279. Category 5,  Topic 3
  280. Message 53        Mon Aug 30, 1993
  281. C.DRUTIS [Monsoon]           at 04:09 EDT
  282.  
  283.  
  284.   Rob,
  285.  
  286.   Yes, yes, no, yes. :) Did that. The monitor resides in RAM-0. I've used
  287. Hexpert. I've also set break points.
  288.  
  289.   The program actually WORKS in bank 1, but it doesn't seem to interact with
  290. some of the Kernal routines (GETIN and BSOUT for ex.).
  291.  
  292.   Yet, I HAVE found a kludgy work-around. What I did was move the program down
  293. to $1000 in Bank 1 (or, as you say, RAM-1 ), I then shifted Common Ram to 4k.
  294. I found a few spare bytes in that 4k and put in three subroutines that did the
  295. actual JSRs to the Kernal routines. Then I JSR to those routines from the
  296. program in place of the original Kernal calls. Seems to work.
  297.  
  298.    BTW, after much searching, I did find a couple of references to RAM 1 not
  299. working with the Kernal. On page 414 of the 128-PRG it says that you must be
  300. in RAM-0 (with I/O and high ROM). And on page 403 it states that you should
  301. invoke configurations 12, 13, 14 or 15; all of which use RAM-0.
  302.  
  303.    Thanks for your help. :)
  304.  
  305. [Apptest 00334.A]
  306.  
  307.  ------------
  308. Category 5,  Topic 3
  309. Message 54        Tue Aug 31, 1993
  310. R.KNOP1 [Rob Knop]           at 01:34 EDT
  311.  
  312. One thing you can do is use JSRFAR (or eqivalent) to call the Kernal routines-
  313. all it takes is changing one byte in the RAM routine to return to another
  314. configuration other than bank 15.  Myself, I don't really like JSRFAR (too
  315. much of a pain to use), so I brewed up something else that I call "JSROB"
  316. which is very much like what you describe doing with your "switchboard"
  317. routines in the 4K of common RAM- the main difference being that I put JSROB
  318. in zero page (obviously, this won't work if you want to use BASIC with the
  319. program). This requires less setup than JSRFAR, saves and restores the
  320. registers itself, and returns to the bank from whence it was called. IMHO such
  321. an entity is a better and safer way to call Kernal routines from Bank 1 than
  322. changing the return configuration of JSRFAR.
  323.  
  324. If anybody is interested I could post the routine here (it's short).
  325.  
  326. Re: terminology, I use RAM-0 and RAM-1 to refer to the RAM blocks in the 128,
  327. and Bank n to refer to the 128 standard memory configuration number n.
  328. Although bank 0 and bank 1 are (roughly) the same is RAM-0 and RAM-1, this way
  329. I avoid confusing myself when I start talking about bank 0 RAM being visible
  330. in bank 15 and such things.
  331.  
  332. -Rob
  333.  ------------
  334. Category 5,  Topic 3
  335. Message 55        Thu Sep 02, 1993
  336. T.RUTTER2 [Troy Rutter]      at 21:18 EDT
  337.  
  338. Indeed, Modlink thorws the files where they are supposed to be when it runs.
  339.  
  340. As for moving basic up...  I do use that trick... but later in the program.
  341. What it does is this:
  342.  
  343. The main program loads, BLAMMO!  Throws the SID ML at $c000, ML routines
  344. wherever they may go (since they aren't added yet)
  345.  
  346. Then it moves basic up to 15000 so i dont have to mess with loading the SIDs
  347. in at different addresses using the sys commands all the time...  really kinda
  348. handy.  I chose 15000 for no particular reason.  Scott Resh told me to place
  349. it at 16 something... but I like 15. :D
  350.  
  351. Im verrrrry hesitant to post exactly what my program is doing... for 2
  352. reasons:
  353.         1)  My code is very messy. ;D
  354.         2)  Somebody may see how simple(?!) my routine is and beat me to
  355.                 the punch)
  356.  
  357. But if somebody would help me out getting the words display, they would be
  358. included in the program... but I have to know who it is... and then give me
  359. time to clean up my code, add comments, etc.  (BTW.. id really appreciate
  360. this... Scott gives me hints but will not collaborate or help, he makes HIS
  361. run right but wont tell me how it works!)  Actually, Scott is a lot of help,
  362. and I thank him every time I get for making me figure things out.  But this
  363. needs to get done and I am nowhere nearer to figuring words out than i was 2
  364. years ago.
  365.  
  366. -Troy
  367.  
  368.  ------------
  369. Category 5,  Topic 3
  370. Message 56        Sun Sep 05, 1993
  371. CBM-ED [e.g.bell]            at 01:26 EDT
  372.  
  373.  Troy:
  374.  
  375.  There seem to be answers to 2 questions being posted as tho they were
  376.  just one... I have some observations on what has been said so far
  377.  based n a very quick glance at what has already been said....
  378.  
  379.  
  380.   TR> Main basic program:  7169-10026
  381.   TR>  ML (frommem,routine,convert) 12288-12378
  382.   TR>  SID files load in at 15000
  383.   TR>  sid routine:  49152-53152
  384.  
  385.  Rob correctly fingered your problem here.  Note the SID routine loads
  386.  in C block... this is where the 64 version of the  program loads.
  387.  Remember the SID code is interrupt driven, and this will not correctly
  388.  transport to the 128 for this reason.  This code is under ROM, and 
  389.  that ROM must be present during interrupts... or more correctly, that
  390.  RAM will be switched out of context immediately upon the start of the
  391.  interrupt each time.  BTW, whoever id'd the start address of BASIC 7.0
  392.  was correct, and at the same time identified the problem with what you
  393.  are trying to do.
  394.  
  395.  wrt what Jeff said about Modlinker...
  396.  
  397.   JJ> Your program MUST have been saved from where it runs, not only
  398.   JJ> for proper LOAD address, but for line links.
  399.  
  400.  Correct wrt load address, but unless this involves some requirement
  401.  of the linker, BASIC programs are relinked every time they are loaded
  402.  so the line links are irrelevant as long as they are within the correct
  403.  range in terms of bytes.  And this is petty anyway, because it doesn't
  404.  take one thing away from the answer... except that it seems to be geared
  405.  for 64 mode programs, which doesn't seem to be the case here.  And I bet
  406.  the C block SID address is why.
  407.  
  408.  ------------
  409. Category 5,  Topic 3
  410. Message 57        Sun Sep 05, 1993
  411. CBM-ED [e.g.bell]            at 01:40 EDT
  412.  
  413.  Monsoon:  Steve Punter published the technique he used in Word Writer
  414.  in a Transactor from many years ago that requires about 20 bytes in
  415.  common memory and about 30 or 40 in the $FF block of memory... it is 
  416.  some fancy footwork allowing kernal routines to be called from any
  417.  bank and return to the caller bank... and he also published a cute little
  418.  code to allow routines to be called from any bank in any bank and the
  419.  return to the proper bank.  His program did what you seem to want to
  420.  do.  The code is neat, and the memory used is negligible because it is,
  421.  in high memory, in a normally unused section of code, and in common 
  422.  memory, very small.  He had the same objections you do.
  423.  ------------
  424. Category 5,  Topic 3
  425. Message 58        Sun Sep 05, 1993
  426. CBM-ED [e.g.bell]            at 01:56 EDT
  427.  
  428.  Troy:
  429.  
  430.  I did say that I believe your problem is trying to run 64 mode ML on a
  431.  128, under ROM, and irq code at that, but I did want to say one other
  432.  thing that would help if you can convince someone to share their source
  433.  code for the SID player.
  434.  
  435.   TR> Then it moves basic up to 15000 so i dont have to mess with
  436.   TR> loading the SIDs in at different addresses using the sys
  437.   TR> commands all the time...  really kinda handy.  I chose 15000
  438.   TR> for no particular reason.  Scott Resh told me to place it at
  439.   TR> 16 something... but I like 15. :D
  440.  
  441.  Scott Resh is correct, you should use 16384, but for your convenience,
  442.  not anything mystical.  If you use the GRAPHIC commands, I believe 
  443.  GRAPHIC 1:GRAPHIC 5, your BASIC code will be moved to 16384 automatically
  444.  with no pokes from you, and you will then have the 9k from 7169-16383
  445.  in which to put your irq code IFF you can get someone to assemble it
  446.  to 1] work there, and 2] read the SID song data wherever it ends up.
  447.  I still stand by my original answer wrt the routines I told you about.
  448.  They will work, and probably work on the 128 (tho not with the GRAPHIC
  449.  thing I just mentioned) unchanged if assembled and BLOADED.  The reason
  450.  they won't work as they are is due to the relocating being done.  Remember,
  451.  you are assembling them at the end, and connected to, the BASIC portion
  452.  of the program.  As I mentioned earlier, the line links won't be changed
  453.  because the linker, tho it will relink the program, will stop at the
  454.  3 zeroes at the end of your code, but all JSR's and JMP's and references
  455.  to internal routines will be hopelessly confused  when you 
  456.   install the program at a different address, and in this case, you
  457.  would have to check to see where PAL puts the start of code in a BASIC
  458.  type pseudo-op assembly.  Does it assume 2049 or do you explicitly put
  459.  it somewhere.  If you can do that, assemble it at 16384 and your battle
  460.  is 1/2 fought, albeit the easy half.   When you put it at 15000, you are
  461.  making your job unnecessarily hard.
  462.  ------------
  463. Category 5,  Topic 3
  464. Message 59        Sun Sep 05, 1993
  465. C.DRUTIS [Monsoon]           at 10:07 EDT
  466.  
  467. e.g.bell,
  468.  
  469.    I wish I had the Transactor you mentioned a week ago -- t'would have saved
  470. me a great deal of time.
  471.  
  472.    As it is, the technique of putting the kernal calls in common RAM works for
  473. the most part. I only used three kernal routines in the program, BSOUT, GETIN,
  474. and PLOT. BSOUT and GETIN worked fine this way, but PLOT would bomb-out every
  475. time. My guess is that some Kernal routines flip to RAM-0 (or mess with the
  476. MMU in some way) as a matter of course. Luckily, writing a cur sor-positioning
  477. routine to replace PLOT was pretty easy.
  478.  
  479. [Apptest 0412]
  480.  
  481.  
  482.  ------------
  483. Category 5,  Topic 3
  484. Message  60       Sun Sep 05, 1993
  485. CBM-ED [e.g.bell]            (Forwarded) 
  486.  
  487.  Monsoon:  I was on vacation since August 27... hehe.  I really see no
  488.  reason for what  you are experiencing though with 1 possible exception.
  489.  How are you handling interrupts?  You know that when an interrupt hits
  490.  bank 15 must be in context, right?  There is an exceptionally neat little
  491.  routine you can use to make sure all goes well for you when programming
  492.  in other banks so that the interrupts occur properly... and this could
  493.  very well have been your problem all along, you know... the technique
  494.  involves the BRK interrupt, and looks like this:
  495.  
  496.            sei
  497.            lda 788;       first point brk vector
  498.            sta 790;        at irq service code
  499.            lda 789
  500.             sta 791
  501.            lda #<irqsrv; then point irq vector
  502.            sta 788
  503.            lda #>irqsrv;  at your switch
  504.            sta 789
  505.            cli
  506.            rts
  507.  
  508.  irqsrv    = *
  509.            lda #0
  510.            sta $ff00;      set bank 15 configuration
  511.            brk;            and service irq thru brk
  512.            nop
  513.            pla;            restore old configuration
  514.            sta $ff00
  515.            pla;            and .a, .x, and .y also
  516.            tay
  517.            pla
  518.            tax
  519.            pla
  520.            rti
  521.  
  522.  irqsrv MUST be in common ram and this should take care of interrupt
  523.  processing for you wherever your code is.  This code was contributed to
  524.  Transactor, Volume 8, Issue 3, by Chris Miller, author of Buddy and a
  525.  bunch of other stuff, and he ascribes it to Brial Hilce, author of 
  526.  Pro-Line's Cocompiler.
  527.  
  528.  Now, why should you go to the trouble of using this now... considering 
  529.  that you are working in bank 1, interrupts may prove to be a problem
  530.  down the road even if they were not the current problem, and this little
  531.  trick is almost too neat not to use...  Anyway, may future sailing be
  532.  smooth!
  533.  ------------
  534. Category 5,  Topic 3
  535. Message 62        Mon Sep 06, 1993
  536. CBM-ED [e.g.bell]            at 05:53 EDT
  537.  
  538.  Jeff:
  539.  
  540.   JJ> If the programmer does what I suggest, the program WON'T be
  541.   JJ> linked when LOADED.  Only the first BASIC program will be
  542.   JJ> linked.  The BASIC routine will come to the first 000 and
  543.   JJ> think it's at the end of the program when there's a sea of
  544.   JJ> binary data and a whole program in higher memory.  If that
  545.   JJ> program isn't linked properly, all lockup could break loose.
  546.  
  547.  This is what I said would happen... the BASIC code would be 
  548.  relinked, and that unless you were speaking of something peculiar
  549.  to modlinker....  why would binary data have to be relinked?
  550.  I have been under the impression that modlinker linked multiple
  551.  ml modules to a BASIC program.  (I know that even a BASIC program is
  552.  binary data at the very lowest level, btw  ;)  I have never used 
  553.  modlinker.... are you saying that it allows you to, for example, link
  554.  a basic program to a block of sprite data to a block of ml code to 
  555.  another block of BASIC program (which would have to be relinked) or 
  556.  that the sprite data and ML code would have to be relinked.  If the
  557.  former, that makes for some interesting questions I would have regarding
  558.  modlinker.  
  559.  
  560.  Actually, what you suggested I don't think would have worked for him.
  561.  He said his code loaded at 7169, which is not $1800, but $1c01, the
  562.  start address for 128 mode BASIC 7.0 files, which Rob or JBEE noted.
  563.  I got the impression you were answering based on a 64 mode program that
  564.  twiddled the start-of-basic pointers.  If modlinker shuffles all the
  565.  various program parts into place after a load, I would think it would
  566.  handle the relinking also (via a call to that routine, tho I don't know
  567.  if it is as accessible in the 64 mode as in 128 mode).  Does Modlinker
  568.  require a BLOAD?  (or load ,8,1).  If so, even the first program would
  569.  not be linked.  This is kind of interesting... especially what kind of
  570.  linking the sea of binary data and the program in higher memory need.
  571.  ------------
  572. Category 5,  Topic 3
  573. Message 63        Mon Sep 06, 1993
  574. C.DRUTIS [Monsoon]           at 08:14 EDT
  575.  
  576. Nice code, e.g., thanks. I'll try it out the next time I update the program.
  577.  
  578.  
  579. [Apptest 0451]
  580.  
  581.  
  582.  ------------
  583. Category 5,  Topic 3
  584. Message 64        Mon Sep 06, 1993
  585. T.RUTTER2 [Troy Rutter]      at 10:57 EDT
  586.  
  587. Whoa!
  588.  
  589. Time Out!
  590.  
  591. My SID player is on a 64... where did the 128 come into play?
  592.  
  593. I remember the sid code Ed wanted was for the 128, but my SID player is for
  594. the 64.  I dont think the graphic commands will work in basic 2.  <g>
  595.  
  596. BTW ed... im still trying to get a hold of some people... a couple more people
  597. to try for what you need.  Keep your fingers crossed.
  598.  
  599. -Troy
  600.  ------------
  601. Category 5,  Topic 3
  602. Message 65        Mon Sep 06, 1993
  603. CBM-ED [e.g.bell]            at 13:40 EDT
  604.  
  605.  Troy:  The reason we were considering the 128 BASIC was the load address
  606.  you gave of 7169.  That is where the 128 mode BASIC programs normally load.
  607.  However, if you d what you are saying you are doing, your problem is 
  608.  very apparent.  Kermit assembled the code we have been talking about using
  609.  the .bas pseudo-op, and it automatically adds the ML to the end of the 
  610.  BASIC code.   I thought I had already pointed out that when you relocate
  611.  the BASIC code anywhere, even 1 byte higher or lower in memory, you screw up
  612.  all of the absolute references in the ML code.  If you want to move the
  613.  start of BASIC up, you must assemble your code (using PAL or Buddy, whichever
  614.  it is you were using) to that address and assemble it there.  This will
  615.  assure that the routines I mention will work correctly.  Otherwise they are
  616.  going to work like fish out of water.  Give this a try and see how you make
  617.  out.
  618.  ------------
  619. Category 5,  Topic 3
  620. Message 67        Mon Sep 06, 1993
  621. CBM-ED [e.g.bell]            at 23:02 EDT
  622.  
  623.  Jeff:
  624.   JJ> I wrote the book on linking.  Every issue of LOADSTAR only has
  625.   JJ> 2300 blocks of space available.  In my five years at LOADSTAR,
  626.   JJ> I have had to link and pack SCORES of programs.
  627.  
  628.  I asked you specifically if the linking you were talking about had 
  629.  something to do with the linker program.  What I said has to do 
  630.  specifically with program links, and I said, as you did, that only
  631.  the first BASIC program loaded would be linked.  I also asked you if
  632.  your linker linked BASIC to ML to BINARY to BASIC, for example, so that
  633.  I could understand why ** BASIC ** would have to link binary data etc.
  634.  I said, and am correct (as you also said) that it would not.  So far, in
  635.  the particulars, we seem to agree, right?
  636.  
  637.   JJ> I've developed a foolproof method of getting these things
  638.   JJ> linked, packed and on the issue with utilities designed for
  639.   JJ> programs that load at $801
  640.  
  641.  I'm sure you have.  I have no reason to question that.  After all, you
  642.  wrote the book, right.  However, the original questioner stated in his
  643.  post that his program did not load at $0801, and he uploaded source
  644.  code to me that you did not have access to for your answer.  That does
  645.  not mean that what you suggest would not work.  I was answering based on
  646.  information I had, his post (which, as others also noted, indicated a
  647.  start at 7169 and not $0801/2049).  Based on what I saw of his start of
  648.  program at 7169, I made a natural assumption that this was a 128 mode
  649.  BASIC program, which you did not, right or wrong.  But given a BASIC
  650.  program that starts at 7169, do you agree that address 43 and 44 will
  651.  have no effect on the start of BASIC in 128 mode?  That such pokes will
  652.  not work?  As it is, the program is in 64 mode, but I was paying attention
  653.  to what Troy was asking me, not some utility of my own that I thought 
  654.  would solve his problem.
  655.  
  656.  None of this is solving Troy's problem tho (and I only mentioned the
  657.  incorrect hex thing because, again, it seemed to more than me that we
  658.  were dealing with a BASIC 7.0 program rather than a relocated BASIC 2.0
  659.  program) and for Troy, I stand by my answer, especially if it is in
  660.  64 mode.  Assembling the code, including the BASIC portion of it, at 
  661.  2049 (or 7169) and loading it at 15000, when it has attached ML, will
  662.  simply not work, and I doubt if StarLinker or ModLinker, or any other
  663.  program, could make it work, and I know you will agree with that too.
  664.  (the source code is in PAL format or Buddy, whichever has the .bas 
  665.  pseudo-op, and has a big BASIC section at the start, followed by an
  666.  attached ML section which is auomatically assembled and saved as one
  667.  file, so we are on the same page)
  668.  
  669.  Just to synch  what we are  talking about, when I talk about linking,
  670.  I am talking about the linking that is done to a BASIC program after
  671.  it is loaded with a ',8', which, as we both have said, will only go to
  672.  the terminating 3 zeroes at the end of the file, regardless of how much
  673.  is in the file.  I don't know how your linker works, tho I did ask.  You can
  674.  check my post to see that that is what I had said.
  675.  ------------
  676. Category 5,  Topic 3
  677. Message 68        Tue Sep 07, 1993
  678. T.RUTTER2 [Troy Rutter]      at 14:59 EDT
  679.  
  680. Ed, all:
  681.  
  682. I figured out one minor problem... the reason my basic file was loading aty
  683. 7169 or something like that was because I renumbered the program and saved it
  684. in 128 mode, so the file pointer kept the 128 basic address.
  685.  
  686. :)
  687.  
  688.  ------------
  689. Category 5,  Topic 3
  690. Message 69        Tue Sep 07, 1993
  691. CBM-ED [e.g.bell]            at 1748 EDT
  692.  
  693.  Troy:  2 things came to me today that will cause a problem with doing the
  694.  things the way you are doing them.
  695.  
  696.  First, when using the Kermit code you sent me with the ML attached to the
  697.  BASIC.... did you make ANY changes at all to the BASIC.  If so, there is 
  698.  one major problem.  In programs constructed like that, you cannot make any
  699.  edits to the BASIC code at all using the BASIC editor.  Any changes must be
  700.  made to the ML source code, which includes the BASIC portion, and all must
  701.  be reassembled or the ML will be totally trashed.
  702.  
  703.  Second, I now understand what you are doing wrt the start-of-basic pointer,
  704.  moving it so you can just LOAD the SID data and it goes to address 15000.
  705.  There are 2 major problems with this.  First, the way BASIC programs
  706.  operate require the start-of-basic pointer to be pointing at the true start
  707.  of BASIC code.  This is necessary so all of the GOSUBs will work, among 
  708.  other things.  For forward branches/jumps, the BASIC interpreter starts at
  709.  the current address and searches forward to the end of the BASIC program 
  710.  for the desired address.  However, for backward GOSUBs, the search starts
  711.  at the start of BASIC, which I am sure is derived from those pointers.  You
  712.  have tricked it into looking in the wrong place for its search if I 
  713.  understand things correctly.  In addition, and semi-related to what Jeff 
  714.  and I were saying, if you locate the start of basic pointers to point to
  715.  15000 so that you can just 'LOAD "DATA",8' for example, when this data is
  716.  loaded, the computer will attempt to link the data as though it was a BASIC
  717.  program file, which at best will trash your SID data, and at worst, cause 
  718.  the lockups you describe.
  719.  
  720.  Thanks for filling us in on that 7169 address.  It was tainting many of the
  721.  answers I was giving.  To deal with the first problem I mentioned above,
  722.  you are going to either have to get PAL and do your edits with the BASIC
  723.  and ML and then assemble it, or you will have to separate the ML and BASIC
  724.  and make your edits like that.  The second problem you will have to use the
  725.  pokes/sys's suggested if the files are not set to load at 15000.  As for 
  726.  the lockups, either could cause them.
  727.  ------------
  728. Category 5,  Topic 3
  729. Message 70        Sat Sep 11, 1993
  730. CBM-ED [e.g.bell]            at 09:54 EDT
  731.  
  732.  Troy:  I wrote a little code last night at work that you can use to
  733.  display your word files.  I need to verify a couple things before 
  734.  posting it though.  Do the word files end with 0's and does each line
  735.  end with a carriage return.  I can make the code relocatable, but that
  736.  is a bit more work than I want to do, but it is very very short and
  737.  I believe you will be able to work with it.  I'll post it as soon as you
  738.  give me the answer to those 2 questions.  Also tell me where you would
  739.  like the code to execute.  It is less than 256 bytes so any even page
  740.  would be fine.  I wanted to fit it into the cassette buffer, but it was
  741.  not to be because of the lookup-table.  How about, say, $CF00?
  742.  ------------
  743. Category 5,  Topic 3
  744. Message 71        Mon Sep 13, 1993
  745. T.RUTTER2 [Troy Rutter]      at 19:08 EDT
  746.  
  747. Ed, sounds great!
  748.  
  749. There is a carraige return at the end of every line, and also a 00 at the end
  750. of the words file.  The SID player ML is located from $c000-Cfff  The basic
  751. program is at 2049 with the SID archives being loaded at 15000.  So locating
  752. the subroutine at $3000 (12288) should be safe as long as my program doesnt
  753. get too big.
  754.  
  755. On a linear note:
  756.  
  757. Image my surprise when I found the following in Jim Butterfield's book...
  758.  
  759. "If the Commodore character is below $3f, it may be transmitted directly to
  760. the ASCII facility
  761.  
  762. "If the COmmodore character is between $40 and $5f, it should be logically
  763. ORed with $20 before transmission
  764.  
  765. "If the Commodore character is between $c0 and $df, it should be logically
  766. ANDed with $7f before transmission."
  767.  
  768. Sheesh, maybe I should have looked at this before I started... ::sigh::
  769.  
  770.  ------------
  771. Category 5,  Topic 3
  772. Message 72        Mon Sep 13, 1993
  773. CBM-ED [e.g.bell]            at 21:08 EDT
  774.  
  775.  Troy:
  776.  
  777.  Then my code is correct.  I'll post the source here tomorrow when I have 
  778.  more time for the routine, and I'll assemble a copy at 12288 and drop it
  779.  in your mail box along with the routine addresses you will need.  There
  780.  will be 2, one to set it all up and one to call for each line of words.
  781.  BTW, I'll pot the source in this topic... tomorrow.
  782.  
  783.  As for Butterfield's code, yes, it is just that simple to translate
  784.  PETSCII to TRUE Ascii.  Many don't choose that algorithm because it is
  785.  slower than a lookup table, and in telecom, a very frequent user of that
  786.  kind of code, speed is kind of important.  However, in your code it is 
  787.  not that critical.  Maybe I'll try to make the code relocatable tonight
  788.  at work.   The lookup table is one of the bigger obstacles to making the
  789.  routine relocatable, and, as a matter of fact, where it can be put.
  790.  Remove that and it will fit in the cassette buffer and you won't have to
  791.  worry at all about BASIC.
  792.  
  793.  BTW, the code you quoted from Butterfield is going in the opposite 
  794.  direction, so to speak.  You need code to translate from True ASCII to
  795.  PETSCII, tho it is not all that difficult a task.  I'm sure I have the
  796.  code to do it somewhere around, but it will take less time to rewrite 
  797.  than to find.
  798.  ------------
  799. Category 5,  Topic 3
  800. Message 73        Tue Sep 14, 1993
  801. CBM-ED [e.g.bell]            at 10:00 EDT
  802.  
  803.  Troy:  Here it is.. it was somewhat longer than I originally anticipated.
  804.  The code is only like 70 bytes or so, but I am posting an assembly 
  805.  dump, including instructions for using it and DATA statments for poking
  806.  it in from your BASIC.  Test it cuz I can't.  If we need to adjust it
  807.  we'll do that... here goes:
  808.  
  809.  
  810.  
  811.  30    last edited 09/14/93 by e.g.bell - source code in egads format
  812.  35    
  813.  40    -----<this code is relocatable>
  814.  45    -----<program variables - rs232 zp variables>
  815.  50    
  816.  55                   low        =   $f7        
  817.  60                   high       =   $f8        
  818.  65                   h.low      =   $f9        
  819.  70                   h.high     =   $fa        
  820.  75    
  821.  80    -----<kernal calls>
  822.  85    
  823.  90                   chrout     =   $ffd2      
  824.  95                   plot       =   $fff0      
  825.  100   
  826.  105   -----<entry for text display
  827.  110   
  828.  115   3000  18       routine    clc            
  829.        3001  90 09               bcc show       
  830.  120   
  831.  125   -----<initialize word address pointers>
  832.  130   
  833.  135   3003           setup      =   *          
  834.  140   3003  85 f7               sta low        
  835.        3005  85 f9               sta h.low      
  836.  145   3007  86 f8               stx high       
  837.        3009  85 fa               sta h.high     
  838.  150   300b  60                  rts            
  839.  155   
  840.  160   -----<show a line of text in row .x>
  841.  165   
  842.  170   300c  a0 00    show       ldy #0         
  843.        300e  18                  clc            
  844.        300f  20 f0 ff            jsr plot       
  845.  175   
  846.  180   3012  a0 00               ldy #0         
  847.  185   3014  b1 f7    !01        lda (low)y    
  848.        3016  d0 09               bne !02        
  849.  190   
  850.  195   -----<handle end of words by resetting pointers>
  851.  200   
  852.  205   3018  a6 f9               ldx h.low      
  853.        301a  86 f7               stx low        
  854.  210   301c  a6 fa               ldx h.high     
  855.        301e  86 f8               stx high       
  856.  215   3020  60                  rts            
  857.  220   
  858.  225   -----<update words pointer>
  859.  230   
  860.  235   3021  e6 f7    !02        inc low        
  861.        3023  d0 02               bne !21        
  862.  240   3025  e6 f8               inc high       
  863.  245   
  864.  250   -----<is this the end of the current line>
  865.  255   
  866.  260   3027  c9 0d    !21        cmp #13        
  867.        3029  f0 18               beq !03        
  868.  265   
  869.  270   -----<translate from true ascii>
  870.  275   
  871.  280   302b  c9 41               cmp #65        
  872.        302d  90 0e               bcc !24        < "a"
  873.  285   302f  c9 5b               cmp #91        
  874.        3031  90 08               bcc !22        <="z"
  875.  290   3033  c9 61               cmp #97        
  876.        3035  90 06               bcc !24        some punctuation chars
  877.  295   
  878.  300   -----<print and loop for next character>
  879.  305   
  880.  310   3037  e9 20               sbc #32        
  881.        3039  b0 02               bcs !24        'upper' to lower case
  882.  315   
  883.  320   303b  69 80    !22        adc #128       'lower' to upper case
  884.  325   
  885.  330   303d  20 d2 ff !24        jsr chrout     
  886.  335   3040  18                  clc            
  887.        3041  90 d1               bcc !01        for relocatable
  888.  340   
  889.  345   -----<return to caller - line has been printed and pointers are>
  890.  350   -----<pointing at next string>
  891.  355   
  892.  360   3043  60       !03        rts            
  893.  365   
  894.  370   -----<to use this code>
  895.  375   
  896.  380     setting up
  897.  385         1]  poke 780,word-address-low
  898.  390         2]  poke 781,word-address-high
  899.  395         3]  sys routine+3
  900.  400   
  901.  405     showing a line of words
  902.  410         1]  poke 781,row-to-display-text-on
  903.  415         2]  sys routine
  904.  420   
  905.  425     when the routine returns
  906.  430         - if peek(780)=0 then end-of-words-data
  907.  435         - if peek(780)>0 then end-of-line
  908.  440   
  909.  
  910.  This is the data you would poke into memory to install the above routine.
  911.  
  912.  12288 data 024,144,009,133,247,133,249,134
  913.  12296 data 248,133,250,096,160,000,024,032
  914.  12304 data 240,255,160,000,177,247,208,009
  915.  12312 data 166,249,134,247,166,250,134,248
  916.  12320 data 096,230,247,208,002,230,248,201
  917.  12328 data 013,240,024,201,065,144,014,201
  918.  12336 data 091,144,008,201,097,144,006,233
  919.  12344 data 032,176,002,105,128,032,210,255
  920.  12352 data 024,144,209,096,-1
  921.  
  922.  122 does not use the zp pointers I used.  That would cause a definite
  923.  problem.  Let me know how this works for you.
  924.  ------------
  925. Category 5,  Topic 3
  926. Message 74        Tue Sep 14, 1993
  927. T.RUTTER2 [Troy Rutter]      at 15:33 EDT
  928.  
  929. Ed,
  930.  I changed one thing in your code...
  931.  
  932. on line 3037 I changed subtracting 32 to subtracting 128.  The words file dont
  933. include any characters between 97 and 122.  All alphabetic chars
  934.  are either between 65 and 90 or 193-218.
  935.  
  936. It works great in my tests so far. :)
  937.  
  938. also, as I said in Email, I think the SID program uses 780,782 as well as 250.
  939. Could be some problems... ill check and see.
  940.  
  941. Thanks... looking better!
  942.  
  943.  ------------
  944. Category 5,  Topic 3
  945. Message 75        Tue Sep 14, 1993
  946. CBM-ED [e.g.bell]            at 23:24 EDT
  947.  
  948.  Troy:
  949.   TR> on line 3037 I changed subtracting 32 to subtracting 128.  The
  950.   TR> words file dont include any characters between 97 and 122. 
  951.   TR> All alphabetic chars  are either between 65 and 90 or 193-218.
  952.  
  953.  If all alphabetic characters are in the range you say, this is not
  954.  a true ascii file, and it sounds to me like there should be no
  955.  translation needed at all.  That is even further suggested by your
  956.  question about the color codes.
  957.  
  958.   TR> I think the SID program uses 780,782 as well as 250.
  959.  
  960.  Registers 780-782 are the .a, .x, .y, and .sp registers respectively, used
  961.  by virtually all ML programs in the 64 mode.  If SID uses 250, that would
  962.  be a problem, but if it is working as well as you say, I don't think it
  963.  is.  You'll have to keep an eye on that.  You may have to do some 
  964.  thinking about other registers than what I used, and how I did it.
  965.  
  966.  As for the changes you made, I really need to see a copy of the data
  967.  file you are using.  You have made me rethink the whole translation
  968.  required.  I had been under the impression this was in true ascii format
  969.  because of what you had said earlier.  But that would not be consistent 
  970.  with using color sequences or the range you mention above.  It sounds more
  971.  now like none is needed.  Could you ul a file, or direct me to the 
  972.  number of one in our libs that I can download and check out myself.  Does
  973.  the program that combines the components into the SAL or whatever they
  974.  are called do any kind of compression or anything on the files?
  975.  ------------
  976. Category 5,  Topic 3
  977. Message  76       Thu Nov 10, 1994
  978. J.SZCZAP                     (Forwarded) 
  979.  
  980. I have no idea if this is the right place to ask this,but... I have  a C-64
  981. and was wondering about computer languages... I've noticed that TONS of people
  982. make programs  and demos on the C-64,  in machine lnguage... Is   there
  983. anywhere that I  can find  out how to program in  mchine language??? I really 
  984. would like to find out...
  985.  
  986. Thanks... Justin...
  987.  ------------
  988. Category 5,  Topic 3
  989. Message 77        Sat Nov 12, 1994
  990. GEOS-TIM                     at 01:30 EST
  991.  
  992. Justin, >>Is there anywhere that I can find out how to program in Machine 
  993. >>language???
  994.   In our libraries, right here in the Commodore area there are many files on
  995. ML programming.  You can get a large list, by Setting your library to #61 (all
  996. libraries) and using the search of "ML". Several examples I got were: file #
  997. 2910 ML Column.ARC,  file # 15892 Tutor.ARC a basic and ML tutor prgs., file #
  998. 14896  ML Tutor.SDA, file # 12199 MLearn-JBEE.txt, and also three files that
  999. were from a Programming course in our RT...file numbers 14555,14556, and
  1000. 14438.
  1001.     There were also files with memory maps, ML monitors, etc. Happy
  1002. programming.......Programming keeps the platform alive. :)
  1003.                                 :) -Tim
  1004.  ------------
  1005. Category 5,  Topic 3
  1006. Message 78        Sun Nov 13, 1994
  1007. CBM-MARK                     at 00:42 EST
  1008.  
  1009.  Thanks for replying to Justin, Tim!  Sheesh, *I* forgot all about those
  1010.  ML tudor files in he Libs :/
  1011.  
  1012.                   ~~Mark~~
  1013.  ------------
  1014. Category 5,  Topic 3
  1015. Message 79        Sun Nov 13, 1994
  1016. J.SZCZAP                     at 18:23 EST
  1017.  
  1018. This is Justin... Thanksa lot for your help!!!
  1019.  ------------
  1020. Category 5,  Topic 3
  1021. Message 80        Tue Nov 15, 1994
  1022. J.FOWLER [Lone Wolf]         at 19:38 EST
  1023.  
  1024. Hi! I have PowerC 128 and 64, I was wondering if the some of the files intthe
  1025. libs that are suppossedly fix's to bugs in the C compiler. one I have disolved
  1026. in to a file that ends with .a and when i veiwed it it had a C function
  1027. header, however all the code was in assembly. do I need to compile the code on
  1028. Power Assembler? Also their was a peek poke fix that is in the same format. Do
  1029. I really need this fix or is it just some minor bug. Also I noticed that the
  1030. linker does not like using 2 drives is there some thing I need to do to get it
  1031. to work better. Also using the CED syntax  checker editor gives my errors on
  1032. global variables at times, when i use them inside other functions! Is there a
  1033. better syntax checker than having to discover error at compile time!
  1034.  ------------
  1035. Category 5,  Topic 3
  1036. Message 81        Wed Nov 16, 1994
  1037. PIXELS [Lee Sr.]             at 20:40 EST
  1038.  
  1039.   Lone Wolf,
  1040.  
  1041. See ya in Cat 5, Topic 10; "Programming in C".
  1042.  
  1043.  ------------
  1044.  
  1045. 5 ?