Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 21:45 25 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CHIP-8 interpreter/emulator

Author Message
BobDevries

Senior Member

Joined: 08/06/2011
Location: Australia
Posts: 266
Posted: 01:35am 26 Apr 2012
Copy link to clipboard 
Print this post

Hi all,

Nick suggested writing a CHIP-8 interpreter...

To do that, though, I'd need to have available some sort of byte array. I'd need at least 1024 bytes; that was the minimum size of the DREAM 6800 memory. The first 256 bytes were scratchpad and variables, the next 256 bytes were the screen ram and the rest was user programme space.

I suppose a string array could be used, but I'm a little at a loss as to how string arrays are implemented in MMBASIC.

The manual says that each string can be up to 255 bytes, but it seems that only MID$ can be used to access e single character of that array. If I used for example, a$(1), I get an error array must be dimensioned first. If I use DIM a$(255), I get out of memory error. It seems to me that it may be trying to set up an array of 255 strings of 255 characters each.

It would be lovely to have a BYTE size variable (and arrays) to use.

Thoughts, anyone?

Regards,


Bob Devries
Dalby, QLD, Australia
 
djuqa

Guru

Joined: 23/11/2011
Location: Australia
Posts: 447
Posted: 01:41am 26 Apr 2012
Copy link to clipboard 
Print this post

256 Byte String Variable size
so maybe
1 string == Scratchpad
1 String == Screen ram
and have a string array for the Programme space.

write a simple user defined function that writes / read the string array as a linear address space.


VK4MU MicroController Units

 
BobDevries

Senior Member

Joined: 08/06/2011
Location: Australia
Posts: 266
Posted: 01:56am 26 Apr 2012
Copy link to clipboard 
Print this post

Hi djuqa,

unfortunately, the maximum string length is 255 bytes, not 256 (See Maximite Manual page 8). Even if the string started at byte 0, that character is not accessible since functions like MID$ can only reference from position 1.

Regards,
Bob Devries
Dalby, QLD, Australia
 
djuqa

Guru

Joined: 23/11/2011
Location: Australia
Posts: 447
Posted: 01:59am 26 Apr 2012
Copy link to clipboard 
Print this post

OK setup up 1 Big String array
20 elements long = 255*20 == 5K Approx
write Function / statements to access it as a flat address space
VK4MU MicroController Units

 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024