home *** CD-ROM | disk | FTP | other *** search
-
-
- CBM-ED [e.g.bell] (Forwarded)
-
- I can add a couple of suggestions to yours JBEE. In your first line, with
- the dsave, I always precede that with a scratch command and follow it with
- a dverify command. But after the REM, I put a quotation mark followed by
- enough deletes to pull all but the command back to the start of the line
- and delete the REM and the line number. I usually include an 'x=08' or
- something as the first statement on the line, and a ,u(x) after the
- 'scratch', 'dsave', and 'dverify', so that I can easily change device
- numbers in all 3 commands with 1 or 2 keystrokes. It usually works out
- to about 8 deletes after the quotes. *note* this will *NOT* work if your
- filenames have upper case letters in them.
-
- I do something similar w/my routines, but I renumber them just before I
- save them to disk, then incorporate the first number into the file name.
- For example, if I have a routine to display a directory, I might
- renumber it starting with line 1000 in increments of 1 line number. then
- when I save the file, I'll call it 1000 directory. I have a COMBINE
- command built into my C128 chips, and use that to build up a foundation
- of routines for new programs. Just renumber when I'm finished.
- Each routine on the 'routine disk' starts with a different group of line
- numbers, which is why I can combine them w/o fear of overwriting anything,
- and since I renumber in increments of 1, I have a *lot* of space to
- maneuver.
-
-
- BTW, that inclusion of deletes can work for any line you use to clean things
- up with after a test run. I use one to restore the character set pointer
- and one also with the FIND command, also in my C128 chipset.
-
- Your suggestion about the routines reminded me of the disk I have dedicated
- to that purpose from TotalRecall that speeded up development of the support
- programs. It is a source of much of what I have entered into that Snippits
- topic in Cat 21.
-
- ------------
- Category 5, Topic 3
- Message 23 Fri Jul 24, 1992
- C128.JBEE [* Sysop *] (Forwarded)
-
- The only thing I don't like about scratching old files is sometimes I need
- them :D Also, I keep a time and date log of all the files created both for
- development, legal, and accounting purposes. So it literally doesn't pay
- for me to scratch them :)
- Of course if you are using a 1541/71 and saving 140+ block files every
- ten minutes scratching the old ones will probably save a ton of disk space.
- Even at $0.25 a piece you could go through some dollars fast :)
-
- The combine command sounds pretty interesting, did you burn your own
- routine into a ROM?
- ------------
- Category 5, Topic 3
- Message 24 Fri Jul 24, 1992
- HOWIE-CBM (Forwarded)
-
- JBEE,
-
- The Basic program listing, and structure is terrific! You have several
- features that I will now incorporate into my template for use with new
- projects.
-
- They all seem so easy to implement. I don't know why I never thought of
- them. Very helpful info! :)
-
- Howie
- ------------
- Category 5, Topic 3
- Message 25 Fri Jul 24, 1992
- HOWIE-CBM (Forwarded)
-
- Ed,
-
- Yes! Tell us more about your custom chips!! And especially COMBINE. :)
-
- For short combines, I've used that ole: LIST, LOAD, and enter <CR>'s.
-
- For big combines, and where something gets inserted into the middle of
- something else, BTP's buffer. :)
-
- Howie
- ------------
- Category 5, Topic 3
- Message 26 Fri Jul 24, 1992
- CBM-ED [e.g.bell] (Forwarded)
-
- John: get ready to blush. The COMBINE command in my C128 is indeed from a
- set of custom chips from Free Spirit, a ROM replacement that I was sold on
- when I read the review many years ago in TC128. Course, you were not the
- publisher then. The chips also have a FIND, CHANGE, and MERGE. The MERGE
- gets a little flakey sometimes, not sure why. I have a Super Chip (ha!) from
- I forget who that is really a piece of garbage. Anyway, the COMBINE function
- just appends programs to the end of whatever program is in memory. Then I
- just renumber the file. It's great. as a matter of fact, I use FIND and
- CHANGE so much, I don't think I'll get JIFFY DOS any time soon cuz I would
- lose that in their chip upgrade. The chipset also fixes some bugs like the
- shift-q, and I believe the relative coordinates in the graphics commands.
- There are other commands I have long since forgotten because I don't use
- them. I think there is also a numeric base conversion function but since I
- have that in the BASIC language, the MLM, and probably my Mach 128, I"m not
- sure about that. I believe there is also a nice set of FKEY definitions,but
- there is some contention among chips in my C128 so I"m not sure which chipset
- has the priority in that regard. Know the ones I like are not the ones I
- have, but it is a nice chip set. At $50, it was not cheap though, and I
- don't know if it is still available, but for the FIND and CHANGE alone, it was
- worth every penny!
- ------------
- Category 5, Topic 3
- Message 27 Sat Jul 25, 1992
- C128.JBEE [* Sysop *] (Forwarded)
-
- Yea, I remember that review ;)
- ------------
- Category 5, Topic 3
- Message 28 Sat Jul 25, 1992
- M.MCCORMIC10 [Mike Mc-] (Forwarded)
-
- I have uploaded the genealogy prigram that we are discussing and started a
- topic for it in Cat.3,Topic #27.
-
- The files are #'s 9900,9901,9902,9903,9904,9905. All are SDA.
-
- Mike Mc-
- ------------
- Category 5, Topic 3
- Message 29 Sun Jul 26, 1992
- CBM-ED [e.g.bell] (Forwarded)
-
- I grabbed them yesterday Mike. They dissolved ok, but file 3, I believe, has
- a couple of duplicate files at least. I started over on a separate disk
- after 2 failures for that reason. The filenames as uploaded don't reflect
- the fact that they are SDA's either, for general info. I didn't have time to
- run the prgs, and will now have to move them around on disks first. >>sigh<<
- but this is a *massive* program in terms of support file count, etc. Can you
- give me some kind of idea what files I *need* to run the prog and duplicate
- the problem. I'd rather not have to deal with all of those files if I don't
- have to.
- ------------
- Category 5, Topic 3
- Message 30 Sat Oct 31, 1992
- M.MCCORMIC10 [Mike Mc-] at 07:29 EST
-
- Ed-
-
- I didn't realize that you had also answered my question in this topic.You can
- eliminate; overlay,notewriter,and files that have those names.
-
- I will repeat the problem.This program will do all that I ask "EXCEPT"create a
- record or chart for the irst great grandfather person # 8. That is where I
- get "string to long"error.All the great grandparents work fine. Could there be
- a missing module?
-
- This is everything that I have.
-
- Mike Mc-
- ------------
- Category 5, Topic 3
- Message 31 Sat Oct 31, 1992
- CBM-ED [e.g.bell] at 08:53 EST
-
- I just posted a long answer to your other post, Mike. See my post and then
- we can go from there. I have to dig up my copies of all those files. When
- dissolving them, I found at least 1 or 2 duplicate files in different archives
- and was never sure if they were different, or what. Also, this puts another
- thing into the equation. Your data. Could you drop a copy of what you are
- entering here or in my mailbox (CBM-ED) so I can enter things exactly as you
- are entering them. I may or may not be able to duplicate your results if I am
- not using the same data. But let me see what I can do... and give me every
- detail of what you have done. I've never used a genealogy program so I am
- starting from square one on every front.
-
- ------------
- Category 5, Topic 3
- Message 33 Tue Jan 19, 1993
- R.KNOP1 [Rob Knop] at 00:43 EST
-
- I echo Bruce's sentiment that the Hacking Magazine is a good place to see
- source code. Some of the articles there are pretty technical, and useful even
- for folks who are old hands at ML. Recently, the editor, Craig Taylor,
- started up a series where he's writing a "Space Invasion" game, which looks
- like it could be very useful for someone who knows the basics of ML but is
- unsure how to do anything with it.
-
- Another good place for source code with explanations are the old Transactor
- magazines!
-
- -Rob
- ------------
- Category 5, Topic 3
- Message 34 Sun Jun 06, 1993
- GULLIBLE [Jon] at 16:53 EDT
-
- Can't think of a better place to put this...
-
- I'm working on a sequel to my PI DEMO. A demo which has the first 18,000
- digits of PI in the scroll.
-
- I now have a file listing the first 1.25 Million digits of PI and I would like
- to come up with a compression method that will let me put as many digits
- possible in available memory...probably about 40K.
-
- So far, the best I can get is a 2.4:1 compress ratio. It works like this:
- Take the sequence:
- 123456789012
- 123 = 0001111011
- 456 = 0111001000
- 789 = 1100010101
- 012 = 0000001100
- These 40 bits equal 5 bytes:
- 00011110 11011100 10001100 01010100 00001100
- Thus, 12 digits in 5 bytes or 2.4:1
-
- Can anyone think of a better compression method? The reason I ask is that 0-9
- is only 10 different characters and there are 256 in a byte. 25:1???
-
- I know this is a weird request... :) But, I'd appreciate any help or
- suggestions. Thanks.
- ------------
- Category 5, Topic 3
- Message 35 Sun Jun 13, 1993
- C128.JBEE at 09:01 EDT
-
- Gullible,
- I have been thinking this over and believe I have found a solution, short
- of compression, that might work, especially with a series of numbers such
- as PI. Which is special in the way the numbers are (not;) sequenced.
-
- It takes 3 bits to represent a digit 0-9, but how about representing the
- difference from one digit to another instead of using a trinary solution?
-
- Example:
- Start the data flow with the first number
- then start reading everything in according to bits
-
- If the first bit is zero it means to use the next bit to add or subtract
- 1 from the number in the A,X, or Y register. Then display that number.
-
- 0000 0000 -> first bit=0 so use the next bit to determine if you should
- add or subtract, it is zero so subtract -1 from the A reg
-
- 0000 0010 -> first bit=0 so use the next bit to determine if you should
- add or subtract, it is one so add +1 to the A reg
-
- If you have a zero following the nine you would add one but write a zero
- to the register. So you would have to sacrifice speed for compression by
- doing comparisons to a table of rules that says if A is greater than nine
- (CMP) then A = 0
-
- If you have a sequence of numbers such as 4345 that would require 12 bits
- at least but using this method only 8 bits!
-
- Now what happens if the first bit encountered is a 1? Then use the
- next three bits to branch to a table that keeps spliting the table of
- remaining numbers in half. 01x3x56789
-
- 0135 6789
-
- Bit #2
- true false
- 0135 6789
- / /
- Bit #3 =1 Bit #3 =0
- true false true false
- 01 35 67 89
- / / / /
- Bit #4 =1 Bit #4 =0 Bit #4=1 Bit#4
- true false true false true false true flase
- 0 1 3 5 6 7 8 9
-
-
- The only draw back is the size of the table vs compression gained and the
- logic needed to keep track of where you are in the current byte (bit
- wise). I am not even sure it would compress the file better than using
- your method. But this is all I could think of taking into account the
- way PI is represented and not knowing the odds of a digit having or not
- having a number lower or higher than it, following it. Though I am sure
- the occurance of such is probably high. Hey, that in itself would make
- an interesting project :)
- ------------
- Category 5, Topic 3
- Message 36 Sun Jun 13, 1993
- GULLIBLE [Jon] at 15:58 EDT
-
- Thanks for the response. I hadn't thought about using a difference method. I
- am a bit confused as to how 4345 can be represented as 8 bits. If you have two
- bits that say subtract 1, then how do you know if those two bits mean subtract
- one or are the first two bits of a 3-4 bit sequence?
-
- I will look over your post in greater detail. I do believe that using math
- will yield the best results.
- ------------
- Category 5, Topic 3
- Message 37 Sun Jun 13, 1993
- C128.JBEE at 23:17 EDT
-
- If the first bit is unset (0), you know you are going to add or subtract
- with the bit following it. If the following bit is set you add one,
- if it is unset (0) you subtract one.
-
- So a sequence of numbers such as 4345 (remember we started with a number
- three) only requires two bits per digit because we are representing the
- change, not the digit. Since the sequence 4 3 4 5
-
- up one ____ ___ up one
- down one ______ ______ up one
-
- looks like that it would be represented in binary as
- 10100010
- ----(4 up one)
- (3 down one)
- (4 up one)
- (5 up one)
-
- 8 bits!
-
- You use the first bit to determine if you are going to be using two bits
- or four bits to determine the next number. So you will always have at
- least a 2x compression over the storing of just the numbers is ASCII
- form.
- ------------
- Category 5, Topic 3
- Message 38 Wed Aug 25, 1993
- T.RUTTER2 [Troy Rutter] at 19:17 EDT
-
- Hi again people, well, its time to jump on the bandwagon and TRY (crossing
- fingers) to finish my SIDplayer. As many of you have followed through the
- Ultrasid Player topic under Sight & Sound, my SID player plays the individual
- parts of the sid archives, msw, pil, wpl, sal, slr, etc... without having to
- dissolve them. The only thing holding me back is the words display. Right
- now the conversion time from in memory to display is awfully sloooooooow.
- Heres the scoop:
-
- For some odd reason, the creators of Singalong songs (Kermit and Joe I think?)
- decided to store the word files in standard ASCII instead of PETSCII. So...
- heres what happens in my program as it stands now. (Simplified of course) Im
- doing this as a basic source around ML subroutine... so bear with me...
-
- get location of words file, assign this to variable: WD
- create array wd$
- get character from memory
- compare - does it need to be converted?
- If so, convert
- If not, store as is in WD$(x)
- if peek(wd)=carraige return then x=x+1:go start over
- if peek(wd)=0 then start music, start wds display.
-
- This takes forever. I have also tried two other ways: 1) The "Index table"
- as it is referred to by ML experts. This works... but still bothers me...
- slow, plus i have no idea what im doing. 2) Display without storing in wd$.
- This is faster, but it is not guaranteed to display fast enough to keep in
- time with the mus flags.
-
- If anybody can take a look at some SID player source code and help me out, i
- would appreciate being enlightened on how to display the words. It seems like
- most sidplayers do some kind of banking so its automatic. I dunno. I have
- the source and object code in PAL (i think) of sidpic 3.4 if that would help.
- I REALLY want to get this sucker done before the next SID-Fest.
-
- Thanks,
- Troy
-
- ------------
- Category 5, Topic 3
- Message 39 Wed Aug 25, 1993
- CBM-ED [e.g.bell] at 21:26 EDT
-
- Troy:
- TR> I have also tried two other ways: 1) The "Index table" as it
- TR> is referred to by ML experts. This works... but still bothers
- TR> me... slow, plus i have no idea what im doing. 2) Display
- TR> without storing in wd$.
-
- If you are insistent on doing this display in BASIC, the 'Index Table'
- is the fastest possible if done correctly. What you are doing is
- creating a lookup table for conversion from ASCII to PETSCII. You use
- the numeric value of the ASCII character as an index into the table,
- which eliminates all IF statements, the REAL time hogs in a BASIC
- program, from the equation entirely.
-
- I would recommend doing the whole operation in ML, which would
- assure the needed speed, and if you shelled to it from BASIC, you would
- still be in control of the timing of the display. An added plus is
- that it would take far less memory to do in ML than it would in BASIC,
- particularly when you consider the elimination of the arrays, another
- BASIC time hog.
-
- TR> If anybody can take a look at some SID player source code and
- TR> help me out, i would appreciate being enlightened on how to
- TR> display the words. It seems like most sidplayers do some kind
- TR> of banking so its automatic. I dunno. I have the source and
- TR> object code in PAL (i think) of sidpic 3.4
-
- I will be happy to do that for the opportunity to get hold of the
- sid player source code. What you are requesting seems to me to be
- an extremely easy thing to do. However, when is the SID-Fest. I will
- have to get your source code quickly to get it done for you because
- I am leaving for vacation tomorrow night. On the upside, I can't
- imagine what you want taking any more than about 5 minutes to code
- once I have the source code. If you can't work with this time-frame,
- I hope you will still share the SID Player source code, which I've been
- looking for for a long time. I'm not planning anything that would
- 'compete' with your work, and not for the C64 at all. But how does all
- of this sound? I already have the lookup-tables in files from other
- programs.... You get the code uploaded tonight I may be able to have
- your solution first thing in the morning when I get home from work.
-
- (The above assumes we are talkingML source code, tho your mention of
- PAL format pretty much indicates that)
- ------------
- Category 5, Topic 3
- Message 40 Wed Aug 25, 1993
- R.KNOP1 [Rob Knop] at 22:25 EDT
-
- 5-3
-
- Troy- what exactly is done in the "compare" step where you decide if the
- string needs to be converted? Is this something that detects whether the
- string is PETSCII or ASCII, or is it done on a character-by-character basis?
-
- One thing that will help is to write a short ML subroutine to do your
- conversion for you... this will tend to make things faster. Once in ML, my
- favorite way to do these things it the "Index Table" method. Basically, you
- need to build a 256 byte table. Let AV be the ASCII value (known) of the
- character, and PV be the PETSCII value (desired) of the character. Then, the
- AV'th byte in the table is PV, assuming a properly built table. In other
- words:
-
- ldx #AV ; or wherever you find the ASCII value, put that in .X
- lda table,x
-
- At this point, .A will hold the PETSCII value, and you can stick it wherever
- you want it.
-
- -Rob
- ------------
- Category 5, Topic 3
- Message 41 Wed Aug 25, 1993
- T.RUTTER2 [Troy Rutter] at 22:37 EDT
-
- Ed:
-
- Sounds great, except for one small detail. When Kermit made his source code
- available for SIDpic, he left the following in the file description:
-
- "This code requires the use of Craug Chamberlain Sidplayer M/L (version one)
- that was especially modified to work with my player. If you want to work on
- this and add more to my player, I cannot help you beyond providing this code
- abd pointing you to the M/L attached to SIDPIC V3.5 - I cannot distribute
- Craig's M/L as it might offend him. If you want it though, you CAN figure out
- from my Source Code where his M/L loads into, and take it out of SIDPIC V3.5."
-
- So, the actual ML that PLAYS the music is still in executable form only. I
- would still appreciate it, however, if you took a look at the source code.
- Especially routines such as:
-
- frommem
- convert
-
- and etc.
-
-
- PS.. the SIDfest is not until 1994.
- -Troy
- ------------
- Category 5, Topic 3
- Message 42 Wed Aug 25, 1993
- C128.JBEE at 22:48 EDT
-
- Since I have the exclusive rights to the book, I do not mind the passing of
- the code back and forth if it means getting something accomplished that
- will increase the sales of the book.
- ------------
- Category 5, Topic 3
- Message 43 Thu Aug 26, 1993
- CBM-ED [e.g.bell] at 10:00 EDT
-
- Does that mean, John, that you do have the source code for the SID
- player? ;)
-
- Troy: I looked at the source code you sent me today, and I can honestly
- say I can't understand why Kermit made such an extensive use of the
- .bas pseudo-op in PAL! It is confusing reading, but I did find something
- you should find interesting. The routines you want to convert and
- print the word strings seem to me to already exist in the code. The
- pertinent routine is FROMMEM in line 352. It first calls the routine
- called ROUTINE, which moves the variable pointers for I presume A1$
- into the variables at $8c-$8e. These are used as pointers and general
- information into the string. Note the definition of A1$ in line 11.
- This seems to me to be defining the string in memory for use by the
- FROMMEM routine. It receives the string data when you call FROMMEM from
- the BASIC routine. Note particularly lines 161-175 (esp. lines 166-175).
- If you study this routine, you should be able to either use it or see
- how it is used. It seems to me to do exactly what you want done tho,
- and in ml to boot. The routine CONVERT at line 410 in your source
- file is a conversion routine. I did not study it closely, but based
- on what you say, I assume it converts A1$ data to the proper format.
- It makes this change to the string directly.
-
- Without running this, the code seems to me to:
-
- set the word address in lne 168, poking the low and high bytes into
- 113 and 114 ($71/$72 used in FROMMEM) I'm not sure what line 166 is
- doing, but I bet it is turning something off, probably an interrupt (I
- just checked... that is exactly what it is doing. See line 833)
- 167 is also assigning LA the value held in .x(low) and .y(high).
- Line 169 calls FROMME, which loads the next string into A1$, and then
- puts the length of that string into A. Line 170 puts the string into
- t$, necessary since you NEVER want to mess with A1$ or you would goof
- it up as far as length!!!! It assigns it the value of left$(a1$,a)
- which pares it down to its actual length. Line 171 apparently sets up
- the pointer for the next string an also stores that in WA. Line 172
- sets up the FROMMEM routine again, and line 173 calls it, doing as
- described above. Line 174 converts a1$ for printing and stores it into
- w2$ and updates the address pointer. At this point, I don't know what
- the difference is between t$ and w$, but you could find that out by
- doing run-time displays (after reassembling the program with the
- appropriate instructions) to see what is in them with each iteration
- of the routine. Bottom line is that the routines you need are already
- written and available for your use. Give them a try and see if I'm not
- right.
-
- Now, do you have access to Kermit Woodall? I contacted him YEARS ago
- about using Wxmodem in BellTerm,tho I never did. I don't have his
- address even if I did have a presence of mind with him. Based on what
- John said about the book rights, it seems you have a basis for asking
- for Craig's player source code if you are willing and have that kind
- of access to him, and I would consider it a personal favor if you did!
- egb
- ------------
- Category 5, Topic 3
- Message 44 Sat Aug 28, 1993
- T.RUTTER2 [Troy Rutter] at 13:46 EDT
-
- Ed, all,
-
- unfortunately, I have tried to use those subroutines in my programs and it
- locks up... i think it is bad memory management... here is what I have:
-
- Main basic program: 7169-10026
- ML (frommem,routine,convert) 12288-12378
- SID files load in at 15000
- sid routine: 49152-53152
-
- And it locks up after i use modlink to put them all in one file. Im wondering
- if modlink iteself uses some of that memory in there.
-
- Also, i wonder why the basic program loads at 7169... isnt it sposed to load
- at 2048 or something?
-
- BTW.. modlink = Modlink by Robert Stoerelle (MALAKAI)
-
- Any idears?
-
- ------------
- Category 5, Topic 3
- Message 45 Sat Aug 28, 1993
- C.DRUTIS [Monsoon] at 23:15 EDT
-
- Greetings. This seems as good a place to ask as any...
-
- Could someone tell me if it's possible to run an ML subroutine within Bank 1?
-
- I want to put a text editor within Bank 1, but no matter what I do with the
- MMU register or the PCR's, the program refuses to work properly (or at all)
- within Bank 1. It works fine when I load it in Bank 0, though.
-
- For Bank 1, I begin with the following code:
-
- LDA #$4E ; corresponds to %01001110 which SHOULD be : Bank 1 RAM
- STA $D500 ; Kernal and IO
- .
- .
- .
- STA $FF00
-
- Of course when I use it in Bank 0 I use LDA #$0E.
-
- Any help would be apprecitated.
-
- [Apptest 0000321.A]
-
- ------------
- Category 5, Topic 3
- Message 46 Sun Aug 29, 1993
- J.JONES36 [LOADSTAR] at 00:09 EDT
-
- YOu could try STARLINKER, on LOADSTAR #105. It can link up to 140 blocks
- worth of BASIC and ML. Just remember that with SL, your program MUST have a
- CLR before any variables are declared. The trouble you're facing though
- really isn't because of MODLINK. I see this as I'm typing. MODLINK and
- STARLINKER are meant for BASIC prgs that run from $0801. Your BASIC PRG is
- running from around $1800. Here's what you do:
-
- Turn off your computer for a few secs. This clears memory in case you're
- going to crunch the resulting program. Turn it on and write a one liner at
- $0801
-
- 10 POKE44,HI:POKE43,LO:POKE HI*256,0:RUN
-
- Where HI is the HI byte of your program's location and LO is the Low byte.
- DON'T RUN IT YET! Now type:
-
- LOAD "YourProgram",8,1
-
- Your program MUST have been saved from where it runs, not only for proper LOAD
- address, but for line links.
-
- If you have JiffyDOS, DON'T use the %filename substitution since this won't
- set SOV pointers.
-
- Now type:
-
- SAVE"combo",8
-
- This will SAVE the one liner you just typed in, a big gap of nothingness, then
- your program at $1800. When RUN, this program will switch control to the
- program at $1800 and RUN it. THIS file will link properly with MODLINK or
- STAR LINKER. You can include any ML or graphics data between these areas, but
- LOAD the highest data last.
-
- If you have font data at $800, use a monitor to load the fon, then the one
- line program, then your BASIC program, then save them all in one file. Your
- BASIC program will have to restore the 8-16 bytes of corrupted font data when
- it's first RUN. Or you can just have some ML copy an entire font from
- elsewhere.
-
- I link at least two programs per month. Usually they run at $1000. I have no
- prob.
- ------------
- Category 5, Topic 3
- Message 47 Sun Aug 29, 1993
- C128.JBEE at 00:43 EDT
-
- It sounds like a Basic 7.0 shell (C-128) using the original SID ML (C-64).
- ------------
- Category 5, Topic 3
- Message 48 Sun Aug 29, 1993
- R.KNOP1 [Rob Knop] at 00:43 EDT
-
- Troy-
-
- I don't think you want to link these various sections into one file. It looks
- like there are gaps between where the various sectios want to go. I don't
- know how this linker works, but if it just links the files together into one
- program, the resulting program will load sequentially in memory starting at
- the load address, not putting the various parts where they ought to go.
-
- If modlinker takes care of this, somebody please correct me....
-
- Re: the starting address, the usual start for BASIC programs is indeed 2049.
- It sounds like the code was moved up for a relocated start-of-BASIC (e.g. to
- make room below the start of BASIC for a custom character set, a trick I used
- to use way back when).
-
- How do you want this program to function after it has been linked?
-
- -Rob
- ------------
- Category 5, Topic 3
- Message 49 Sun Aug 29, 1993
- R.KNOP1 [Rob Knop] at 00:44 EDT
-
- Monsoon-
-
- I assume that you are issuing a "BANK 1" command before loading the ML program
- and SYS'ing to the address? If not, then there's the simple answer :D
-
- What are you calling in the way of BASIC and KERNAL subroutines? I am not
- sure, but I believe it possible that some of the Kernal subroutines may only
- return to bank 15, or at any rate a configuration with RAM 0 rather than RAM 1
- visible. Hopefully, and probably, this is not the case, and the Kernal
- routines are friendly, but it is possible. It is more likely with some of the
- BASIC routines. It's been years since I've directlly called any BASIC or
- KERNAL routines from RAM 1, and the only reason I did that was because I was
- doing it from within GEOS, and in GEOS it is usually not necessary to directly
- call BASIC or the Kernal.
-
- Any idea just where the code is dying? What is the manner in which it dies?
-
- Ideally, ML things should work in RAM 1 just as they do in RAM 0.
-
- Curious, why are you locating the program in RAM 1 as opposed to RAM 0?
-
- -Rob
- ------------
- Category 5, Topic 3
- Message 50 Sun Aug 29, 1993
- R.KNOP1 [Rob Knop] at 00:45 EDT
-
- Aha! JBEE posted that even as I was composing my reply, but yes, that load
- address is the standard start of BASIC for the 128, so it may be the BASIC
- program was intended to run on the 128.
-
- -Rob
- ------------
- Category 5, Topic 3
- Message 51 Sun Aug 29, 1993
- C.DRUTIS [Monsoon] at 04:09 EDT
-
- Rob,
-
- Yes, I've issued a BANK1 command when I've tried to start if from Basic.
- I've also issued a G10400 (it resides at $400 in Bank 1) from the monitor.
-
- It doesn't crash... it simply stalls. In other words nothing happens. The
- computer doesn't lock up because it responds to a RS/Restore. This is why I'm
- puzzled. If it couldn't reach the kernal from Bank 1, it would (or should)
- break and drop to the monitor.
-
- I'm beginning to suspect that the kernal and the 128's editor wasn't
- designed to interact with Bank 1. I was kinda hoping someone had successfully
- written a program that uses them from Bank 1. Thanks anyway. :)
-
- Oh... I want to put it in Bank 1 because of memory constraints in Bank 0. I
- also don't want to rewrite the entire thing using INDFET and INDSTA and the
- like. Call it laziness. <g>
-
- [Apptest 00324.A]
-
- ------------
- Category 5, Topic 3
- Message 52 Mon Aug 30, 1993
- R.KNOP1 [Rob Knop] at 01:08 EDT
-
- Monsoon- re: putting code in Bank 1 because of memory constraints, actually,
- this is a reasonable thing to do. Speed constraints would be another good
- reason; if you are writing (say) a text editor that keeps its text in BANK 1,
- it might be advantageous to write short "memory moving" routines in bank 1,
- which would save several cycles for each lda and sta as compared to INDSTA and
- INDFET.
-
- One other little obvious thing to check: how have you set the MMU register for
- common memory? If you haven't messed with it, $400 should be fine. Also, are
- you using this program at all with BASIC? If so, have you moved up the
- pointers for the bottom of variable memory?
-
- Re: 128's OS interacting with Bank 1, in my experience the monitor works
- beautifully with Bank 1, no problem there. Again, I am not sure about the
- Kernal.
-
- One thing that might be worth trying: setting break points. You can do this
- manually, by replacing instructions with BRK instructions. Put these varying
- distances into your code, and if, when you execute the code, the program
- breaks out to the monitor from one of these, you know that the code is at
- least getting that far. Another option would be to check out HEXPERT, which
- is a simple ML debugger that lets you set breakpoints and step through code. I
- am not sure that Hexpert will work with code in Bank 1, since (again) I
- haven't tried it, but it's probably worth looking at.
-
- -Rob
- ------------
- Category 5, Topic 3
- Message 53 Mon Aug 30, 1993
- C.DRUTIS [Monsoon] at 04:09 EDT
-
-
- Rob,
-
- Yes, yes, no, yes. :) Did that. The monitor resides in RAM-0. I've used
- Hexpert. I've also set break points.
-
- The program actually WORKS in bank 1, but it doesn't seem to interact with
- some of the Kernal routines (GETIN and BSOUT for ex.).
-
- Yet, I HAVE found a kludgy work-around. What I did was move the program down
- to $1000 in Bank 1 (or, as you say, RAM-1 ), I then shifted Common Ram to 4k.
- I found a few spare bytes in that 4k and put in three subroutines that did the
- actual JSRs to the Kernal routines. Then I JSR to those routines from the
- program in place of the original Kernal calls. Seems to work.
-
- BTW, after much searching, I did find a couple of references to RAM 1 not
- working with the Kernal. On page 414 of the 128-PRG it says that you must be
- in RAM-0 (with I/O and high ROM). And on page 403 it states that you should
- invoke configurations 12, 13, 14 or 15; all of which use RAM-0.
-
- Thanks for your help. :)
-
- [Apptest 00334.A]
-
- ------------
- Category 5, Topic 3
- Message 54 Tue Aug 31, 1993
- R.KNOP1 [Rob Knop] at 01:34 EDT
-
- One thing you can do is use JSRFAR (or eqivalent) to call the Kernal routines-
- all it takes is changing one byte in the RAM routine to return to another
- configuration other than bank 15. Myself, I don't really like JSRFAR (too
- much of a pain to use), so I brewed up something else that I call "JSROB"
- which is very much like what you describe doing with your "switchboard"
- routines in the 4K of common RAM- the main difference being that I put JSROB
- in zero page (obviously, this won't work if you want to use BASIC with the
- program). This requires less setup than JSRFAR, saves and restores the
- registers itself, and returns to the bank from whence it was called. IMHO such
- an entity is a better and safer way to call Kernal routines from Bank 1 than
- changing the return configuration of JSRFAR.
-
- If anybody is interested I could post the routine here (it's short).
-
- Re: terminology, I use RAM-0 and RAM-1 to refer to the RAM blocks in the 128,
- and Bank n to refer to the 128 standard memory configuration number n.
- Although bank 0 and bank 1 are (roughly) the same is RAM-0 and RAM-1, this way
- I avoid confusing myself when I start talking about bank 0 RAM being visible
- in bank 15 and such things.
-
- -Rob
- ------------
- Category 5, Topic 3
- Message 55 Thu Sep 02, 1993
- T.RUTTER2 [Troy Rutter] at 21:18 EDT
-
- Indeed, Modlink thorws the files where they are supposed to be when it runs.
-
- As for moving basic up... I do use that trick... but later in the program.