|
Post by wendling on Feb 14, 2021 12:13:11 GMT
You say: I really need, "Mapping The 128" Well, I found the $793C at…... Mapping The 128. (blz157) www.cubic.org/~doj/c64/mapping128.pdfFloating point variables don’t need $793c as it converts an integer to floating point. You do need $8e42. This routine converts FAC1 to a string of digits at $0100. Read the 5 floating point variable bytes from bank1 with your jsr fetch1 into a buffer. Read that buffer into FAC1 with $8BD4 (Mapping The 128 blz225): In your listing: 05: ldy #$02 loop: jsr fetch1 sta buffer-2,y; -2 because y starts with 2 iny cpy #07 bne loop lda #<buffer ldy #>buffer jsr $8bd4 jsr $8e42
aa=1234 in memory:41 41 8b 1a 40 00 00 a=1234 in memory:41 00 8b 1a 40 00 00 aa%=1234 in memory:c1 c1 04 d2 00 00 00 a%=1234 in memory:c1 80 04 d2 00 00 00 variable memory starts in bank1 at $0400.
|
|
|
Post by stiggity on Feb 14, 2021 22:51:51 GMT
Bingo!! i just caught myself reading the .pdf for 40mins. eheh i have a mint 128 prm, but that book is either eluding me, or vice versa..
I do have yet, 1 more question(s). In all of the integer/floating point variable handling, using the _technique_ I was taught, via the O3/O4/O5 means of defining an integer/variable/floating point variables. The routines you helped me with, or any other similar defining routine, if the variable being searched for has not yet been defined, the program will hang. Is there some down&dirty way too see IF a variable already has been defined?
Thanks alot for the help. It means more when an individual actually explains something! Kudos!
|
|
|
Post by stiggity on Feb 14, 2021 23:37:34 GMT
Wendling: Thank you for every bit of help!!! (even if its only 8) <jk> it amazes me, I searched/looked thru articles, the little bits of c= ASM snippets, and was at a halt. If there ever comes a day my assistance helps someone, I'll be a happy camper. Again, I hope to talk to you sometime soon.
|
|
|
Post by gsteemso on Feb 16, 2021 10:35:04 GMT
I vaguely recall that BASIC maintains some kind of index of extant variables. It's kinda-sorta compressed for simpler handling -- I believe the variable name is kept in a 2-byte structure, with the high bit of each byte repurposed: concatenating them gives a two-bit field with, obviously, 4 possible states; specifically, a1 (floating-point number), a1% (integer), a1$ (string), and FN a1 (user-defined math function). I'm pretty fuzzy on what it does to link that to the actual data (I expect it'd be a simple 2-byte pointer), and I don't remember how it keeps track of which variables are actually arrays, but I know for a fact it's laid out in all of those "MAPPING A C128" type of books.
|
|
|
Post by stiggity on Feb 21, 2021 5:19:37 GMT
Yeah, would make for a good read. lol Just ran a prg for the c128.. Spraypaint 1.5 WOW!!!! pull down windows, easy navigation, and a powerful editor. I'm somewhat familiar with arrays on the 64 (Some heap calls to ROM chunks) but also, had some help with that. How the 128 stores all variable data in bank 1, and knowing the proper ROM calls to perform the needed functions is where I get in a jam. Im not necessarily writing a BASIC program, but in a round-a-bout way, thats what it is. Utilizing an ML "kernal" for the extensive calls, output I/O, file I/O, rs232 handler, and about 200 blocks of other stuff. The main reason I asked is, maybe, thats something that could easily be demonstrated, and my learning process begins there.
|
|
|
Post by robertb on Feb 25, 2021 7:29:46 GMT
Just ran a prg for the c128.. Spraypaint 1.5 WOW!!!! Are you referring to Spray Paint 128 from PHD Software?
Truly, Robert Bernardo
|
|
|
Post by stiggity on Mar 2, 2021 6:55:51 GMT
Robert: Yes.. version 1.5. I guess someone stole all of there hardware and floppies, and the author was able to find a version 1.0 source, and release 1.5... Very cool program. Okay, it is now time for "c128 Assembly Programming questions." I've written very basic addition, subtraction routines, in a crude manner, but what is the most effective means of dividing a number in 1/2? let's say the accumulator is holding #80. LDA #80, what's a quick and dirty method of simply dividing it in 1/2?? The Accumulator value will never exceed 255. Again, when I run into a road block, I try to reach out, and see if someone wouldn't mind helping.
|
|
|
Post by bjonte on Mar 2, 2021 6:59:51 GMT
let's say the accumulator is holding #80. LDA #80, what's a quick and dirty method of simply dividing it in 1/2? I’m going to assume you want to divide by 2. Shifting is the way to cheaply multiply or divide by 2. LSR will divide by 2.
|
|
|
Post by stiggity on Mar 2, 2021 19:37:28 GMT
BJONTE: Thanks! totally appreciate your words of advice. Here's yet something else that I'm not aware of. I use the below snippet, to manipulate the MMU and configure $B000-$BFFF as accessible RAM.
lda #$0E sta $ff00 jmp
|
|
|
Post by stiggity on Mar 2, 2021 19:44:55 GMT
sorry... pick-up where I left off.. I'm able to store code in the $B000-$BFFF range after setting $ff00 to $0E. Are there any other ways too allocate more than the $B000-$BFFF range, as free accessible RAM. On the c64, setting the directional register, banking out the BASIC ROM $A000-$BFFF is doable. I guess what I'm asking is, I store code under $1300 - $3fff (Screen Memory) and am utilizing the VDC. Is there any way too keep basic in, and kernal, while possible storing code from $A000-$BFFF, $8000-$9FFF? I believe I'm initializing my MAP using bank15, and bload all the modules lying in $B000-$BFFF.
-Thanks! :-)
|
|