RetroBrew Computers Forum
Discussion forum for the RetroBrew Computers community.

Home » RBC Forums » General Discussion » Newbie with Tiny68K (Description of a newbie's experiences with Tiny68K)
Re: Newbie with Tiny68K [message #4310 is a reply to message #4309] Tue, 06 February 2018 20:09 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
smp,

To transfer the Srecords that norwestrzh provided, you need a program called SRIN. You can find it here:
https://www.retrobrewcomputers.org/forum/index.php?t=msg& ;th=201&goto=3332&#msg_3332

Since cpmtools is so useful, you should learn how to use it to transfer files in and out of cpm disk image. Here is how I would use cpmtools to extract files from diskc.cpm.fs image:

copy the disk definition that norwestrzh provided:

diskdef sim
seclen 128
tracks 512
sectrk 256
blocksize 2048
maxdir 4096
skew 0
boottrk 1
os 2.2
end

and append to file 'diskdefs' in cpmtools. diskdefs is collection of various Disk Parameter Block.
copy the simulation disk image, diskc.cpm.fs, to the cpmtools directory
execute this two commands:
cpmcp -f sim diskc.cpm.fs 0:f83.bin f83.bin <--(copy user 0 file named 'f83.bin' in disk image 'diskc.cpm.fs' of the format 'sim' to 'f83.bin')
cpmcp -f sim diskc.cpm.fs 0:f83.68k f83.68k <--(copy user 0 file named 'f83.68k' in disk image 'diskc.cpm.fs' of the format 'sim' to 'f83.68k')

Now, you should see two files named f83.68k and f83.bin in cpmtools directory. You can gkermit them to Tiny68K. Once they are transferred to Tiny68K, type 'f83' and you should see this message:

68000 Forth 83 Model
Version 2.1.0
Modified 03Jun84

You are on your own now because I know nothing of Forth
Re: Newbie with Tiny68K [message #4311 is a reply to message #4310] Wed, 07 February 2018 10:01 Go to previous messageGo to next message
smp is currently offline  smp
Messages: 49
Registered: January 2018
Location: Bedford, NH, USA
Member
plasmo wrote on Tue, 06 February 2018 23:09
... Since cpmtools is so useful, you should learn how to use it to transfer files in and out of cpm disk image. Here is how I would use cpmtools to extract files from diskc.cpm.fs image: ...


Hi Bill,

Thank you *very* much for the instructions. I agree that getting some experience using cpm tools will be quite beneficial. I noodled my way through it and I managed to get access to the disk image file, and then extract the two F83 files. I pulled the files into CP/M using GKermit, and I have the F83 running! I found that F83 requires several of the BLK files from before, so I extracted them (again) from the LBR file. I now have everything together on my disk B: and it all seems to be running. I have lots more experimenting to do with F83, for sure.

Thanks also to Roger and Rienk for your advice and assistance, too! You folks are all awesome, with all your advice and assistance. Being new to the 68K is interesting, as I can often get myself confused due to my past experience with 8080 & Z80 CP/M machines. I get thinking that I know what I'm doing and before I know it, I'm wandering in the weeds with these new tools that I haven't used before.

Thanks again, guys, I really appreciate you all.

smp
Re: Newbie with Tiny68K [message #4312 is a reply to message #4311] Wed, 07 February 2018 11:53 Go to previous messageGo to next message
smp is currently offline  smp
Messages: 49
Registered: January 2018
Location: Bedford, NH, USA
Member
I've been playing around with F83. I typed in my Forth version of my favorite test program, how many ways to make $1 from change:
VARIABLE P
VARIABLE N
VARIABLE D
VARIABLE Q
VARIABLE C

: DOLLAR
DECIMAL
CR 0 C !
101 0 DO
   I P !
   21 0 DO
      I N !
      11 0 DO
         I D !
         5 0 DO
            I Q !
            P @ N @ 5 * D @ 10 * Q @ 25 *
            + + + 100 =
            IF
               ." P=" P @ . ." N=" N @ .
               ." D=" D @ . ." Q=" Q @ . CR
              C @ 1 + C !
            THEN
            LOOP
         LOOP
      LOOP
   5 +LOOP
CR C @ . ." WAYS TO MAKE $1.00"
CR ;

In order to get it to fit on one screen of 16 lines, I needed to use multiple commands per line, but I printed it out here as clearly as I can, for ease of reading.

When I run this program in F83, it takes about 5 seconds. You may recall that on my system at 16 MHz, the Tiny BASIC took about 1:04 and the CP/M BASIC took about 2:04. This puts F83 at about 12-13 times faster than the Tiny BASIC version (and ~25 times faster than the CP/M BASIC). If you don't need floating point arithmetic, F83 seems to be an excellent alternative programming language.

smp

[Updated on: Wed, 07 February 2018 11:58]

Report message to a moderator

Re: Newbie with Tiny68K [message #4313 is a reply to message #4312] Wed, 07 February 2018 13:51 Go to previous messageGo to next message
smp is currently offline  smp
Messages: 49
Registered: January 2018
Location: Bedford, NH, USA
Member
Here is the Sieve of Eratosthenes for F83:
Scr # 2         B:SMP.BLK 
  0 \ Sieve of Eratosthenes                               07FEB18smp
  1 : prime? ( n -- ? ) here + c@ 0= ;
  2 : composite! ( n -- ) here + 1 swap c! ;
  3 : sieve ( n -- )
  4 here over erase 2
  5 begin
  6 2dup dup * >
  7   while
  8     dup prime?
  9     if
 10       2dup dup * do i composite! dup +loop
 11     then
 12     1+
 13   repeat
 14 drop cr
 15 ." Primes: " 2 do i prime? if i . then loop ;

The largest integer it will handle is 32100. Anything larger than that and funny things start to happen. I assume that the size of the stack that it builds gets large enough to interfere with something else in memory.

smp

[Updated on: Wed, 07 February 2018 13:55]

Report message to a moderator

Re: Newbie with Tiny68K [message #4314 is a reply to message #4312] Thu, 08 February 2018 04:38 Go to previous messageGo to next message
adx is currently offline  adx
Messages: 22
Registered: October 2015
Junior Member
Quote:
When I run this program in F83, it takes about 5 seconds. You may recall that on my system at 16 MHz, the Tiny BASIC took about 1:04 and the CP/M BASIC took about 2:04. This puts F83 at about 12-13 times faster than the Tiny BASIC version (and ~25 times faster than the CP/M BASIC). If you don't need floating point arithmetic, F83 seems to be an excellent alternative programming language.

The wonderful thing about Forth is that entire program is going to be ran as a bunch of machine coded moves, jumps, adds, and muls basically inline with how you've coded it. Depending on the implementation you're not even having the overhead of using bsr calls. I'm willing to bet that most of the time in your code is being spent in the CP/M I/O output routines.
Re: Newbie with Tiny68K [message #4328 is a reply to message #4314] Sun, 11 February 2018 11:15 Go to previous messageGo to next message
etchedpixels is currently offline  etchedpixels
Messages: 333
Registered: October 2015
Senior Member
31000 sounds a bit close to 32767 which is the 16bit max integer - is your forth using 16bit maths, if so you just need to write/find a bignum library
Re: Newbie with Tiny68K [message #4330 is a reply to message #4328] Sun, 11 February 2018 11:38 Go to previous messageGo to next message
smp is currently offline  smp
Messages: 49
Registered: January 2018
Location: Bedford, NH, USA
Member
Yes, F83 is doing 16 bit integer math. You're correct, 32767 is the maximum positive signed integer.

Since the SIEVE returns what appears to be a rational list for 30099, and starts to fail somewhere near but above that number, I figured that there may be some collision in memory where the list the the SIEVE builds grows to collide with something else.

Thanks for your thoughts.

smp

[Updated on: Sun, 11 February 2018 11:38]

Report message to a moderator

Re: Newbie with Tiny68K [message #4331 is a reply to message #4330] Sun, 11 February 2018 16:00 Go to previous messageGo to next message
UhClem is currently offline  UhClem
Messages: 19
Registered: November 2015
Junior Member
F83 is a 16 bit Forth which limits its address space. There are a couple of ways to handle the addresses:

1) Use the feature of the 68000 where loading a 16 bit value into an address register triggers an automatic sign extension. This is fast but limits you to using the 32K at the bottom of the address space and 32K at the top. Assuming you have RAM at the top.

2) Load the 16 bit address into a data register and then do something to bypass the sign extension. In KERNEL68.BLK NEXT is defined as:
LABEL >NEXT    
    IP )+ D7 MOVE       LONG 0 D7 BP DI) W LEA
    WORD W )+ D7 MOVE   LONG 0 D7 BP DI) JMP 


Either way, F83 is limited to 64KB. You can use the rest of the address space in other ways but the F83 kernel and code don't know about it.


Re: Newbie with Tiny68K [message #10812 is a reply to message #4177] Tue, 09 July 2024 21:32 Go to previous messageGo to next message
newjes250 is currently offline  newjes250
Messages: 14
Registered: May 2020
Junior Member
To Plasmo:

I saw you describe a version of Tiny68k using PLCC 68HC000, with two CPLDs.
Have you posted anywhere about this specific version?

Always interested in your many projects.

Jesse (newjes250)
Re: Newbie with Tiny68K [message #10813 is a reply to message #10812] Wed, 10 July 2024 12:48 Go to previous message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
Thanks for the reminder; I've actually forgotten about rev3 of Tiny68K which used PLCC 68000 and 2 CPLD on 100x100mm 2-layer pc board. Adding to existing Tiny68K, I wanted to have Ethernet (ENC28J60) and fast parallel USB interface with FT245. The board worked, but was unstable. I think it is because it was 2-layer PCB with circuitous routing and poor grounding. I have not pursued it further. If I were to do it again, I'd go with 4-layer pc board.
Bill
/forum/index.php?t=getfile&id=3081&private=0
Previous Topic: Small 68020
Next Topic: SDC68020


Current Time: Sat Feb 08 22:01:15 PST 2025

Total time taken to generate the page: 0.00856 seconds