Re: New Board Development - SBC6120-RBC Edition [message #4004 is a reply to message #4003] |
Sat, 23 December 2017 09:27   |
 |
will
Messages: 213 Registered: October 2015
|
Senior Member |
|
|
Hehehe. Haven't written a BASIC program for years!
LIST
GUESS BA 5B
10 LET N=1
20 LET X=10000
30 LET C=0
35 PRINT "CHOOSE A NUMBER FROM";N;"TO";X;"AND I WILL TRY TO GUESS IT."
40 IF N=X THEN 300
42 LET G=INT(N+(X-N)/2)
44 LET C=C+1
50 PRINT "IS YOUR NUMBER BIGGER THAN";G;"(Y/N)";
60 INPUT A$
70 IF A$="Y" THEN 100
80 IF A$="N" THEN 200
90 GOTO 50
100 LET N=1+G
110 GOTO 40
200 LET X=G
210 GOTO 40
300 PRINT "YOUR NUMBER IS"; N
310 PRINT "IT TOOK ME";C;"QUESTIONS."
320 END
READY
RUN
GUESS BA 5B
CHOOSE A NUMBER FROM 1 TO 10000 AND I WILL TRY TO GUESS IT.
IS YOUR NUMBER BIGGER THAN 5000 (Y/N)?N
IS YOUR NUMBER BIGGER THAN 2500 (Y/N)?N
IS YOUR NUMBER BIGGER THAN 1250 (Y/N)?N
IS YOUR NUMBER BIGGER THAN 625 (Y/N)?N
IS YOUR NUMBER BIGGER THAN 313 (Y/N)?N
IS YOUR NUMBER BIGGER THAN 157 (Y/N)?N
IS YOUR NUMBER BIGGER THAN 79 (Y/N)?N
IS YOUR NUMBER BIGGER THAN 40 (Y/N)?N
IS YOUR NUMBER BIGGER THAN 20 (Y/N)?N
IS YOUR NUMBER BIGGER THAN 10 (Y/N)?Y
IS YOUR NUMBER BIGGER THAN 15 (Y/N)?N
IS YOUR NUMBER BIGGER THAN 13 (Y/N)?Y
IS YOUR NUMBER BIGGER THAN 14 (Y/N)?N
YOUR NUMBER IS 14
IT TOOK ME 13 QUESTIONS.
READY
[Updated on: Tue, 26 December 2017 12:17] Report message to a moderator
|
|
|
Re: New Board Development - SBC6120-RBC Edition [message #4011 is a reply to message #4004] |
Tue, 26 December 2017 10:58   |
 |
will
Messages: 213 Registered: October 2015
|
Senior Member |
|
|
Just in case this proves useful to anyone:
I got rather tired of lugging a USB RS232 adapter, RS232 null modem cable, and a 5V power supply around in order to use my SBC6120. I've been mainly working with it on my laptop in various places around the house, but our house has a real dearth of power sockets (several times I've ended up running a mains extension lead halfway across the room).
I measured the power consumption of my SBC6120, including IDE to CF adapter and CF card, as about 200mA. USB can easily deliver this. I decided to implement a simple mod to give the board a USB interface to deliver both power and data. I'm using an FTDI232RL breakout board (search ebay for "mini FTDI232"; it's the same part John's 4UART ECB board uses).
I removed the MAX232CPE chip (U17) leaving an empty socket. I then stacked a second 16-pin dual-wipe socket on top of this socket, and soldered short wires into the sockets for pins 10, 12, 15 and 16. I then connected those to RX, TX, GND and VCC (respectively) on the FTDI board. Finally I glued the FTDI board on top of the molex power socket with a bit of hot snot.
Only been using it for a short while, but it seems to work well. I now have just a single USB lead running to my laptop. The mod is easily reversible, just pop out the stacked socket and replace the MAX232 to restore the original functionality.
One minor caveat: This mod bypasses the 500mA fuse at F1.
|
|
|
|
|
Re: New Board Development - SBC6120-RBC Edition [message #4024 is a reply to message #454] |
Wed, 27 December 2017 15:35   |
 |
will
Messages: 213 Registered: October 2015
|
Senior Member |
|
|
I am working on producing new disk images for OS/8 on SBC-6120 (mainly as an excuse to learn more about this machine).
The easiest way to create a bootable OS/8 image seems to be to run OS/8 itself inside a simulator and get it to build the disk image itself. However the SIMH simulator does not support the IDE interface that SBC-6120 uses, so we can't attach the disk, the OS/8 ID01 handler cannot run, and so we can't create a bootable disk image. There's another simulator (WinEight) which does support everything required, I believe this is what was used to create the current disk images, however WinEight is not easily scriptable and it's win32 software. Note that WinEight will run under Linux using wine (Yo dawg I heard you like simulation, so I put an simulator in your simulator so you can simulate while you simulate...)
I have therefore extended SIMH to support the ID01 disks and the BTS6120 "panel request" IOTs used for IDE disk transfers. The attached patch implements this functionality. It is only very lightly tested but it works well enough to boot up OS/8 from the SBC6120 disk images, so we're on the right path at least. It could be easily extended to implement other functionality eg the VM01 SRAM disk, etc.
Next I'm going to work on doing an installation by hand to learn what needs to be done to build the ID01 handler and integrate it with OS/8, and then getting the PiDP/8 "mkos8" script to work so that we can benefit from the work being done on that project to build OS/8 disk images from the distribution tapes.
In the course of writing this I discovered that the BTS6120 source code is really quite excellently documented. Hats off. I would have given up long ago without that documentation.
[Updated on: Wed, 27 December 2017 15:46] Report message to a moderator
|
|
|
Re: New Board Development - SBC6120-RBC Edition [message #4028 is a reply to message #4024] |
Thu, 28 December 2017 15:40   |
 |
will
Messages: 213 Registered: October 2015
|
Senior Member |
|
|
I've prepared updated disk images based on the PiDP/8I project. These have a good selection of software including ADVENT (to run it - "R FRTS <enter> ADVENT <escape>", be warned it takes a minute or two while it starts up). They also include the full source code for the OS and utilities. Note that the OS/8 image includes the ID01 handler (for IDE disks) but not the VM01 hander (for SRAM disk).
I suggest you write all four images to the IDE disk (in linux do "cat *.img | sudo dd bs=1M of=<device>"). This will give you four drives in OS/8 named SYS:, IDA1:, IDA2: and IDA3:.
I had a minor problem working with the PiDP/8 disks -- in particular the DIR command outputs a form-feed character (ASCII 12) after completing its work. This is a pain on a video terminal as it erases the screen!
I assembled DIRECT.PA, examined the listing and figured out which two instructions to convert to NOPs to stop this behaviour. The patched version is on these disks.
There's also a C compiler on here, not tried it yet.
Disk images are attached to this post.
[Updated on: Thu, 28 December 2017 15:53] Report message to a moderator
|
|
|
|
Re: New Board Development - SBC6120-RBC Edition [message #4036 is a reply to message #4028] |
Mon, 01 January 2018 12:43   |
 |
will
Messages: 213 Registered: October 2015
|
Senior Member |
|
|
My first PDP-8 assembler program. Designed to solve Project Euler problem 2: "By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms."
The obvious difficulty here is that 4,000,000 is a lot more than 4,096 so I had to learn how to use multiple precision arithmetic. The other difficulty is converting multiple precision numbers to decimal -- I decided to punt that one to another day and work entirely in octal instead.
*200
START, CLL CLA / CLEAR LINK, ACCUMULATOR
TLS / OUTPUT NUL TO TERMINAL
NEXTFIB,JMS CALCFIB / CALC NEXT FIB SEQ NO
TAD (DWB) / PRINT NEXT FIB NO
JMS PRINTD
JMS CRLF
JMS CHKDONE / COMPARE DWB TO TARGET
SZL / CHKDONE RETURNS LINK SET IF OVER TARGET
JMP RESULT / PRINT RESULT AND QUIT
/ TEST IF FIB NO IN DWB IS EVEN
CLA IAC / AC = 1
AND DWB+1 / AC = LSB OF DWB
SZA / SKIP NEXT IF EVEN
JMP NEXTFIB / IT'S ODD - NEXT FIB
/ UPDATE SUM: CALCULATE SUM=SUM+DWB
CLL CLA
TAD SUM+1
TAD DWB+1
DCA SUM+1
RAL / CARRY
TAD SUM
TAD DWB
DCA SUM / SUM UPDATED
JMP NEXTFIB
TARG, 1720 / TARGET: 4,000,000 (DEC)
4400
DWA, 0
1
DWB, 0 / FIB SEQ NO STORED HERE
0
SUM, 0
0
DWT, 0
0
/ PRINT RESULT AND TERMINATE CLEANLY
RESULT, JMS CRLF
CLL CLA
TAD (SUM)
JMS PRINTD
JMS CRLF
JMP 7600 / RETURN TO OS/8 MONITOR
/ CHECK IF DWB > TARG
CHKDONE,0
CLL CLA
/ COMPUTE DWT=TARG-DWB
TAD DWB+1
CLL CMA CML IAC / FORM 13-BIT NEGATIVE (NO PREV BORROW)
TAD TARG+1
DCA DWT+1
RAL / PROPAGATE COMPLEMENTED BORROW
TAD DWB
CMA CML IAC / FORM 13-BIT NEGATIVE (WITH PREV BORROW)
TAD TARG
DCA DWT
/ LINK IS NOW SET IF RESULT WAS NEGATIVE
JMP I CHKDONE
/ CALCULATE NEXT NUMBER IN FIB SEQUENCE
CALCFIB,0 / RETURN ADDRESS
CLL CLA
/ COMPUTE DWT=DWA+DWB
TAD DWA+1
TAD DWB+1
DCA DWT+1
RAL
TAD DWA
TAD DWB
DCA DWT
CLL CLA
/ DWA=DWB
TAD DWB+1
DCA DWA+1
TAD DWB
DCA DWA
/ DWB=DWT
TAD DWT+1
DCA DWB+1
TAD DWT
DCA DWB
/ NEXT FIB SEQUENCE NO IS NOW IN DWB
JMP I CALCFIB
PAGE
/ PRINT CR+LF (NEWLINE)
CRLF, 0
CLL CLA
TAD (215)
TSF
JMP .-1
TLS
CLL CLA
TAD (212)
TSF
JMP .-1
TLS
JMP I CRLF
/ PRINTD - PRINT A DOUBLE WORD AS 8 OCTAL DIGITS
/ ENTER WITH ADDRESS OF DOUBLE WORD IN AC
PRINTD, 0 / RETURN ADDRESS
DCA DWADDR / SAVE ADDRESS OF DWORD
TAD I DWADDR / LOAD FIRST WORD
JMS PRINTO / PRINT 4 DIGITS
ISZ DWADDR / INCR ADDRESS
CLL CLA / CLEAR ACCUMULATOR AND LINK
TAD I DWADDR / LOAD SECOND WORD
JMS PRINTO / PRINT 4 DIGITS
JMP I PRINTD / RETURN
DWADDR, 0 / STORAGE OF DWORD ADDR
/ PRINTO - PRINT A WORD (IN AC) AS 4 OCTAL DIGITS
PRINTO, 0 / RETURN ADDRESS
DCA WORD
TAD (-4) / NUM ITERATIONS
DCA DIGITS / SAVE DIGIT COUNT
PRINT1, CLL CLA / CLEAN UP
TAD WORD / GET REMAINING BITS
CLL RTL / SHIFT LEFT 2 BITS
RTL / THEN 2 MORE (REMEMBER LINK)
DCA SAVCHR
TAD SAVCHR
RAR / RECOVER LINK BIT
DCA WORD / REMEMBER IT
TAD SAVCHR / GET DIGIT BACK
AND (7) / JUST 1 DIGIT PLZ
TAD ("0) / CONVERT TO ASCII
TSF / CHECK TERM READY
JMP .-1 / LOOP IF NOT
TLS / OUTPUT CHAR TO TERM
/ GET READY FOR NEXT DIGIT
ISZ DIGITS / ENOUGH YET?
JMP PRINT1 / NO; DO ANOTHER!
JMP I PRINTO / YES; RETURN
DIGITS, 0
SAVCHR, 0
WORD, 0
Here's the output from running the program:
.PAL PE2
ERRORS DETECTED: 0
LINKS GENERATED: 6
.LOAD PE2
.START
00000001
00000001
00000002
00000003
00000005
00000010
00000015
00000025
00000042
00000067
00000131
00000220
00000351
00000571
00001142
00001733
00003075
00005030
00010125
00015155
00025302
00042457
00067761
00132440
00222421
00355061
00577502
01154563
01754265
03131050
05105335
10236405
15343742
25602347
21463144
.
21463144 octal = 4613732 decimal. I believe this is the correct answer!
Took less than 5 minutes to solve this problem in Python on a modern machine. Took the better part of a day to write this on the SBC6120; a lot of that time was spent learning to apply the machine's instruction set, battling with EDIT.SV (not the worst editor I've ever used, but close), and debugging with ODT (which sorely lacks a "single step" command -- unless I've missed it?)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: New Board Development - SBC6120-RBC Edition [message #5233 is a reply to message #5229] |
Fri, 28 September 2018 23:32   |
 |
Andrew B
Messages: 467 Registered: October 2015 Location: Near Redmond, WA
|
Senior Member Administrator |
|
|
That's a shame about the non-working chips.
I will take a look with one of my chips and see if there is some kind of an alive-ness check people can do. I think that if you feed it a clock, hold /RESET low for ~50 clock cycles and then let it go high, /LXMAR should immediately go low as it tries to latch the memory address registers. That would at least indicate that it is trying to load an instruction from RAM. /OUT, /MEMSEL, and /IFETCH should do some things a clock or two later as well.
Would an alive-ness test with a standard 5V Arduino Uno board be sufficient for most people?
[Updated on: Fri, 28 September 2018 23:36] Report message to a moderator
|
|
|
|