tag:blogger.com,1999:blog-32140835015141291212023-11-16T11:36:23.157+00:00My Wallpaper ComputerRecreating the computer I designed when I was a teenager. Paul Robsonhttp://www.blogger.com/profile/12278875872815047472noreply@blogger.comBlogger45125tag:blogger.com,1999:blog-3214083501514129121.post-39717091823843193852016-01-29T15:28:00.000+00:002016-01-29T15:30:12.286+00:00Demo video<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/s_vi/LN-g7FSKU6c/default.jpg?sqp=CKCGrrUF&rs=AOn4CLANPxodGqbPbD6Fij2UefinRWKudA" frameborder="0" height="266" src="https://www.youtube.com/embed/LN-g7FSKU6c?feature=player_embedded" width="320"></iframe></div>
<div style="text-align: left;">
So, here is the video of the emulator running. I start it up, it boots straight into MINOL (it autodetects the ROM image and boots there).</div>
<br />
<br />
I then immediately exit, disassemble and list some memory to show the monitor ROM, and boot MINOL back with G 9000.<br />
<br />
Then the Star Trek program is listed and run - it does take a few seconds to create the galaxy, and then I fly about a bit, shoot up some Klingons and exit to the MINOL command line.<br />
<br />
All very primitive :)<br />
<br />Paul Robsonhttp://www.blogger.com/profile/12278875872815047472noreply@blogger.com0tag:blogger.com,1999:blog-3214083501514129121.post-42991364725857825642016-01-29T15:07:00.001+00:002016-01-29T15:07:28.880+00:00Executable rebuilt, RC/2016 pretty much done.<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZs-z_fak7XQ7HGHQHVNvKJ60vfMcx3rgE2irPSACCO4Tm0omPxB6KX2AWVASMsm9nES0-z9hzgggfLqwOV18OnRrzllbBT-k-mO4SCZOagNLxPXAyjE7NHkbUxqpSLX3-KQ6xXZ8eK-aF/s1600/IMG_20160129_150219.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="330" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZs-z_fak7XQ7HGHQHVNvKJ60vfMcx3rgE2irPSACCO4Tm0omPxB6KX2AWVASMsm9nES0-z9hzgggfLqwOV18OnRrzllbBT-k-mO4SCZOagNLxPXAyjE7NHkbUxqpSLX3-KQ6xXZ8eK-aF/s400/IMG_20160129_150219.jpg" width="400" /></a>In what will probably the final thing I do for Retrochallenge 2016/1 ,<br />
<br />
I've rebuilt the executables and the hardware version so that Star Trek will run automatically, e.g. it is loaded into memory.<br />
<br />
All you have to do is run the executable, press F5 to run it, and type RUN and it should start. Slowly :)<br />
<br />
I might put a screengrab/video up a bit later on.<br />
<br />
This is a picture of Star Trek just having started and being run on the hardware "replica".Paul Robsonhttp://www.blogger.com/profile/12278875872815047472noreply@blogger.com0tag:blogger.com,1999:blog-3214083501514129121.post-49356323456766207182016-01-29T09:42:00.000+00:002016-01-29T09:42:17.057+00:00Trek complete<a href="http://vignette2.wikia.nocookie.net/memoryalpha/images/a/a9/Journeys_End-The_Saga_of_ST-TNG_video_cover.jpg/revision/latest?cb=20070210035823&path-prefix=en" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="http://vignette2.wikia.nocookie.net/memoryalpha/images/a/a9/Journeys_End-The_Saga_of_ST-TNG_video_cover.jpg/revision/latest?cb=20070210035823&path-prefix=en" style="-webkit-user-select: none;" /></a>Yes, it's finished and working, coming in at 3,227 bytes.<br />
<br />
This is the (probably) final listing. The next (and probably last) thing I will do is rig the emulator up so this is loaded by default.<br />
<br />
I didn't actually write this ; it's pretty incomprehensible. The commented version with full variable names, which is about 5 times as long is on github.<br />
<br />
A peculiarity of the original MINOL is you have to write it like this (except you can have comments) - most of the time the interpreter does not allow spaces so you can't write "PR C" it has to be "PRC". I removed the spaces in the preprocessor primarily to save space.<br />
<br />
Though I have just noticed it has the superfluous 'A' command which invites the Klingons to attack you (which was for debugging). Still, maybe a Ferengi will play the game, it might be useful ?<br />
<div>
<br /></div>
The main thing that is missing that I might add, but probably won't as it's nearly time out and the weekend, is the phaser damage does not take distance into account.<br />
<br />
But overall I'm quite pleased with it. It does have most of the proper features of Star Trek BASIC, which the other tiny versions (<4k) I have seen don't.<br />
<br />
It may be technically wrong. The original MINOL claims a line length of 70 odd characters max but this is more to do with the keyboard buffer than internal structure. With 700 bytes left, I could stretch it out so no line is more than 70 characters long, but I won't :)<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"> 2 (14,254)=12:(14,255)=0:PR$(14,254),"STAR TREK V1.0":PR"(C) PSR 2016":PR:(14,240)=0:(14,241)=7:(14,242)=8</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 3 (14,243)=9:(14,244)=255:(14,245)=0:(14,246)=1:(14,247)=0-9:(14,248)=0-8:(14,249)=0-7</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 4 PR"SKILL 1-9 ?";:IND:IFD=0;D=5:K=0:I=0</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 5 N=0:IF!<2*D+35;N=N+!/80+1:K=K+N:IF!<16;N=N+100:(14,I)=!/50+1*10+N:I=I+1:IFI<64;GOTO5</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 6 E=250:T=4:Q=!/4:(14,Q)=163:PRK,"KLINGONS"</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 10 I=64:PR"IN QUADRANT ";:N=Q/8*8:(14,254)=Q-N+48:PR$(14,254),",";:(14,254)=Q/8+48:PR$(14,254)</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 11 (14,I)=0:I=I+1:IFI#128;GOTO11:N=(14,Q):J=1:O=0:(14,J+151)=255:(14,J+152)=255:(14,J+153)=255:(14,J+154)=255</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 12 IFN/10*10=N;GOTO14</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 13 I=!/4+64:IF(14,I)#0;GOTO13:(14,I)=J:N=N-1:IF9<J;GOTO12:(14,J+150)=I-64:(14,J+160)=!/10+12:J=J+1:O=O+1:GOTO12</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 14 N=N/10:J=J+1:IFJ<9;J=10:IFN#0;GOTO12</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 15 S=!/4:IF(14,S+64)#0;GOTO15:(14,S+64)=12</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 20 IFK=0;GOTO245:I=(12,128):PR" ",E;:(12,128)=I:PR"E:";:(12,128)=I+5:(14,254)=T+'0';:PR" T:",$(14,254),">";:INI</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 21 IFI='A';GOTO200</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 22 IFI<33;GOTO30:IFI='S';GOTO30:IFI='L';GOTO40:IFI='W';GOTO50:IFI='M';GOTO60:IFI='Q';GOTO70:IFI='T';GOTO80:IFI='P';GOTO90</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 23 PR"CMD: SLWMPTQ":GOTO20</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 30 (14,254)=12:PR$(14,254):I=0</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 31 N=(14,I+64):IFN=0;GOTO34:IFN<9;N=9:N=N-9*2+224:(0,I*2)=N:(0,I*2+1)=N+1</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 34 I=I+1:IFI#64;GOTO31:CALL(0,5):PR$(14,254);:GOTO20</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 40 I=7</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 41 J=0:PR" ";</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 42 N=I+J:N=(14,240+N):N=N+Q</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 43 IFN<64;GOTO44:N=N-64:GOTO43</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 44 N=(14,N):M=N/100*100:N=N-M:PRN;:(12,128)=(12,128)-4</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 45 (14,254)=M/100+'0':PR$(14,254);:(12,128)=(12,128)+2:IFJ#2;PR"!";:J=J+1:IFJ#3;GOTO42</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 46 I=I-3:PR:IFI<7;PR" ---+---+---":IFI<7;GOTO41:GOTO20</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 50 IFE-1<8;GOTO53:PR"DIR:";:INI:IF9<I;GOTO20:Q=Q+(14,240+I):E=E-8</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 51 IFQ<64;GOTO52:Q=Q-64:GOTO51</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 52 GOTO10</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 53 PR"ENERGY!":GOTO20</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 60 PR"DIR : ";:INI:IF9<I;GOTO20:I=(14,240+I):IFI=0;GOTO20:PR"WARP: ";:INJ:IF8<J;GOTO20:(14,S+64)=0</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 61 IFJ=0;GOTO65:IFE-1<2;GOTO65:J=J-1:E=E-2:S=S+I</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 62 IFS<64;GOTO63:S=S-64:GOTO62</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 63 N=(14,S+64):IFN=0;GOTO61:IFN<10;GOTO240:IFN=10;GOTO241:PR"STARBASE DOCK":E=250:T=4:(14,Q)=(14,Q)-100</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 65 (14,S+64)=12:GOTO200</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 70 PR"SURE ?";:INI:IFI='Y';GOTO242:GOTO20</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 80 IFT=0;GOTO20:PR"DIR : ";:INI:IF9<I;GOTO20:I=(14,240+I):IFI=0;GOTO20:J=7:N=S:T=T-1</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 81 IFJ=0;GOTO200:J=J-1:N=N+I</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 82 IFN<64;GOTO83:N=N-64:GOTO82</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 83 M=(14,64+N):IFM=0;GOTO81:IFM=10;GOTO200:IFM=11;GOTO243:IFM=12;END:I=M:GOTO120</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 90 IFO=0;GOTO20:PR"LVL : ";:INI:IFI=0;GOTO20:IFE-1<I;GOTO20:E=E-I:N=I/O+3:N=N-D+5:IF200<N;N=0:I=1</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 91 IF(14,150+I)=255;GOTO94:J=(14,160+I)-N:(14,160+I)=J:IF200<J;GOTO120</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 94 I=I+1:IFI#5;GOTO91:GOTO200</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 120 PR"KLINGON DOWN !":J=(14,I+150):IFJ=255;END:N=(14,J+64):IFN#I;END:K=K-1:PRK,"LEFT"</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 121 O=O-1:(14,J+64)=0:(14,I+150)=255:(14,Q)=(14,Q)-1:IFK=0;GOTO245:GOTO200</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 200 IFO=0;GOTO20:I=0:PR"KLINGONS ATTACK"</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 201 I=I+1:IFI=5;GOTO20:IF(14,I+150)=255;GOTO201:GOTO220</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 210 N=!/32+1:IFN=6;N=9:N=(14,N+240):J=(14,I+150)+N:IF(14,(14,I+150)+64)#I;END</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 211 IFJ<64;GOTO212:J=J-64:GOTO211</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 212 IF(14,J+64)#0;GOTO201:(14,(14,I+150)+64)=0:(14,I+150)=J:(14,J+64)=I:GOTO201</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 220 N=(14,I+160):N=N+D-5:M=!/64+1:N=N*M/4:IFN=0;GOTO201:IFE<N;N=E</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 221 E=E-N:PRN,"DAMAGE":IFE=0;GOTO244</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 222 M=(14,I+160):N=N/3:IFM-1<N;N=M-1:(14,I+160)=M-N:GOTO201</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 240 PR"YOU HAVE COLLIDED WITH A KLINGON.":END</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 241 PR"YOU HAVE BURNED UP IN A STAR.":END</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 242 PR"YOU HAVE RESIGNED FROM STARFLEET.":END</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 243 PR"YOU HAVE DESTROYED A STARBASE AND BEEN ARRESTED.":END</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 244 PR"A KLINGON SHIP DESTROYED YOU":END</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 245 PR"CONGRATS - YOU WON !":END</span><br />
<div>
<br /></div>
.Paul Robsonhttp://www.blogger.com/profile/12278875872815047472noreply@blogger.com0tag:blogger.com,1999:blog-3214083501514129121.post-85503966713623642212016-01-27T17:40:00.001+00:002016-01-27T17:40:28.929+00:00And more commands<a href="http://wiki.bravofleet.com/OLD/images/f/f4/Photon_casing.gif" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="http://wiki.bravofleet.com/OLD/images/f/f4/Photon_casing.gif" style="-webkit-user-select: none;" /></a>Well, the program is now up to 2,338 bytes - I can scrape back a few if necessary - and it's mostly, not entirely there.<br />
<br />
The two outstanding parts are firing phasers, and the Klingons firing (and , if I have space, I might make them move as well)<br />
<br />
So today I have added the in-quadrant movement, and torpedo firing - but this also includes a lot of the code to 'clear up' dead Klingons, so it really should fit in the 1700 odd bytes remaining.<br />
<br />
The actual source code - the stuff with all the macros and comments - is about 14k, so the output code does look rather like it went through one of those programs that compressed BASIC that used to be available.Paul Robsonhttp://www.blogger.com/profile/12278875872815047472noreply@blogger.com0tag:blogger.com,1999:blog-3214083501514129121.post-70436728952023212142016-01-26T22:18:00.002+00:002016-01-26T22:18:46.492+00:00More Commands<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEMMUFPFgpvn_y-9uyR2zKTLKaCLz4elUp_cv_dJcmSlcDeuptNoq62sPtcZcOW7IaHgfD8l2nMWYhJB78Lp0HdLVR9gwyHWqdg0VtyP4siMK2H3nu9YjomWhVzKJSOOSUEw_aXm9uAC8c/s1600/Capture.PNG" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="205" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEMMUFPFgpvn_y-9uyR2zKTLKaCLz4elUp_cv_dJcmSlcDeuptNoq62sPtcZcOW7IaHgfD8l2nMWYhJB78Lp0HdLVR9gwyHWqdg0VtyP4siMK2H3nu9YjomWhVzKJSOOSUEw_aXm9uAC8c/s320/Capture.PNG" width="320" /></a>Well, I'm a bit more optimistic than yesterday about program size, at present it is 1,336 bytes and since yesterday I've added the long range scan - this is messier because MINOL doesn't really handle the requirement to print 42 as 042 well, and the annoying printing of spaces before and after (I didn't write its spec) which you can't suppress. You can see the long range scan on the right. (It shows the contents of adjacent quadrants).<br />
<br />
I've also added the warp command - this Trek has two moves, one in a quadrant, and one between quadrants. It just warps to an adjacent quadrant using the directional aspect of a PC numeric keypad.<br />
<br />
So that leaves Move, Firing Phasers and Torpedoes, getting the Klingons to fire back, and end game stuff. I'm reasonably confident of getting that into 2.5k or so.<br />
<br />
Out of interest, I ran it in normal speed - I've been developing in a version of the emulator that runs flat out - and it is actually not so bad. It takes maybe 3 seconds to create the galaxy, and a couple of seconds to create a quadrant. Short and Long range scans take a second or two. It's a bit slow, but playable - it's actually reminiscent of playing it on a teleprinter, or a machine like an Apple 1 or a similar TV Typewriter device.<br />
<br />
Or over a modem. Which reminds me.<br />
<br />
I used to work in Halifax (its in Yorkshire), for a company making vertical market software for property management. We wanted to set up a machine in Edinburgh , a unix box. We had an old audio coupler modem - one of those things you plugged the old phones into physically, which was supposed, I think to run at 300 baud. (This was in the late 1980s)<br />
<br />
It was <i>rubbish</i>. I couldn't even type ls<return> half the time, and when I did I just got gobbledegook back. Nothing we did made it better. We were part of a big<br />
<br />
On the upside, I did get sent up there with a box of backup tapes and did it the hard way. Well actually I spent most of a couple of days waiting for the compiler. So a free holiday. Unfortunately it chucked it down every night, so I didn't see much of Edinburgh.<br />
<br />
Halifax is a wierd place. It's a small Yorkshire town. Well actually it's really dull .... except if you approach it from Leeds.<br />
<br />
Then your first view is this ridiculously futuristic road layout with overpasses and all sorts of wierd junctions. It completely threw me the first time, it's like finding a motorway built in someone's back garden. Apparently, in the 1970s they had this idea for this super-duper ultra-modern town road system, but it ran out of money half way through - so getting out of the south end of town was (and apparently still is) dreadful.<br />
<br />
More <a href="http://www.cbrd.co.uk/articles/burdock-way/">here</a>Paul Robsonhttp://www.blogger.com/profile/12278875872815047472noreply@blogger.com2tag:blogger.com,1999:blog-3214083501514129121.post-69356817770676321712016-01-25T22:15:00.000+00:002016-01-25T22:15:26.380+00:00Short range scanner<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIaoNlVZuUmO8SLyU8gj8ZuZ2xfLvgz81N2cOkOwTRtHfLhSk4wRfrnwgWwrLCR8Ky514rYfc57x9e9XCOmcU558gPeaEcURGj0UHSE_J8HKucp9sLPwCvGknCSippk12ddmRReRwwBdL-/s1600/Capture.PNG" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiY1awlXkR7vUUccW1WRq_ZPKEPwKcr8rXYwmMw9KVrIcIFIU_djzTW1AyTCtXci-CvzNWd5Sa2V_Uy8lyIAWGFMf18tCEjt9jXdE34cQiycGKRkRKJcgt6aDQ5lmH67bXBzYmmm_cL6WSE/s1600/Capture.PNG" imageanchor="1"><img border="0" height="196" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiY1awlXkR7vUUccW1WRq_ZPKEPwKcr8rXYwmMw9KVrIcIFIU_djzTW1AyTCtXci-CvzNWd5Sa2V_Uy8lyIAWGFMf18tCEjt9jXdE34cQiycGKRkRKJcgt6aDQ5lmH67bXBzYmmm_cL6WSE/s320/Capture.PNG" width="320" /></a><br />Having had a little time to tinker with it, I now have a working short range scanner.<br />
<br />
The * are stars, the +++ are Klingons (this is TOS Star Trek .....), >!< are starbases and <*> is the Enterprise.<br />
<br />
I hope it's going to fit ; so far this occupies 899 bytes of program memory. This is a little unnerving as I only have 4096 bytes, slightly over 20% used.<br />
<br />
If it doesn't fit ; I'll implement "Hunt the Wumpus" instead :)Paul Robsonhttp://www.blogger.com/profile/12278875872815047472noreply@blogger.com0tag:blogger.com,1999:blog-3214083501514129121.post-91781895425120647052016-01-25T18:58:00.000+00:002016-01-25T18:58:00.274+00:00Building a galaxy, one atom at a time.<br />
<div style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;">
</div>
<div style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em; text-align: left;">
<a href="http://i.dailymail.co.uk/i/pix/2012/05/14/article-0-1315245A000005DC-247_634x318.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="160" src="http://i.dailymail.co.uk/i/pix/2012/05/14/article-0-1315245A000005DC-247_634x318.jpg" style="-webkit-user-select: none;" width="320" /></a>Primarily for reasons of space , I'm not going to directly port Tiny BASIC Trek. I had a look at various small Treks and concluded they were all too big, so I decided to write it from scratch and use the Computing Today as a base for ideas.</div>
<a href="http://i.dailymail.co.uk/i/pix/2012/05/14/article-0-1315245A000005DC-247_634x318.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><br /></a><br />
<div style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em; text-align: left;">
Minol isn't very compact - it doesn't have any tokenising so keywords like PRINT, which is stored in one byte in most BASIC interpreters, is stored in 2 (it is PR). It doesn't sound like much but over time it does get a bit cramped.</div>
<div style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em; text-align: left;">
I think though that I will get most of the features in - it might be a bit rough and ready, but it will work. So far, I've done all the set up - the creation of the initial galaxy, and the creation of the new 'quadrant' from that galaxy data, which means I can start to work on the movement routines next.</div>
Paul Robsonhttp://www.blogger.com/profile/12278875872815047472noreply@blogger.com0tag:blogger.com,1999:blog-3214083501514129121.post-67593028429731234042016-01-21T14:15:00.003+00:002016-01-21T14:15:36.736+00:00Adding some preprocessor stuff<a href="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcRJj2_JN7hG9hlJpr8dDRePRetjKEiIKX6Ji-r-rNi0ycExX0HBkA" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img alt="Image result for macros" border="0" class="rg_i" data-src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcRJj2_JN7hG9hlJpr8dDRePRetjKEiIKX6Ji-r-rNi0ycExX0HBkA" data-sz="f" jsaction="load:str.tbn" name="dm479UPpu6203M:" src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcRJj2_JN7hG9hlJpr8dDRePRetjKEiIKX6Ji-r-rNi0ycExX0HBkA" style="height: 202px; margin-top: 0px; width: 202px;" /></a>Having done a bit of testing, I've decided to add a sort of very basic Macro processor for writing MINOL code.<br />
<br />
Instead of everything being upper case, which I always think is horribly unreadable, I've made everything lower case.<br />
<br />
Anything in upper case is a macro, which has a straight text substitution.<br />
<br />
This allows me to write code like<br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">:Energy e</span><br />
<br />
To define a macro which is a variable, and then write<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">Energy = Energy + 1</span><br />
<br />
which the system converts into e = e + 1 automatically. This should improve readability no-end, even though it is very primitive.<br />
<br />
For development, I'm also going to cheat slightly and speed the emulated CPU up a lot, just to make running it quicker. The first thing the program does is to set up the quadrants and so on, which would take long enough to be annoying each time I run it.Paul Robsonhttp://www.blogger.com/profile/12278875872815047472noreply@blogger.com0tag:blogger.com,1999:blog-3214083501514129121.post-8149923576787725702016-01-19T15:58:00.001+00:002016-01-19T15:58:55.517+00:00Font changes for Trek<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEid3yQ_d_GhaGJSdzDMUlI8uOShJj3ctZzh54KUuXXievSRjpRY21zEguTaFzTCRZl-tNmm46jJ1yDszh2szg7MYft98YBsUGH_nCbLvrO8Q5pT5PuXaIxaPoEaAFV73FFCOFecy7W8Ddsx/s1600/Capture.PNG" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="191" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEid3yQ_d_GhaGJSdzDMUlI8uOShJj3ctZzh54KUuXXievSRjpRY21zEguTaFzTCRZl-tNmm46jJ1yDszh2szg7MYft98YBsUGH_nCbLvrO8Q5pT5PuXaIxaPoEaAFV73FFCOFecy7W8Ddsx/s320/Capture.PNG" width="320" /></a>Over the years, there has arisen a standard set of graphics for text star trek, derived from David Ahl's version.<br />
<br />
These are things like +++ for Klingons and <*> for the Enterprise.<br />
<br />
To keep these (the Tiny Basic Trek actually has slightly different ones, but I prefer the classics) I've made some amendment to the font, adding eight font characters, 2 per graphic.<br />
<br />
I have to do this because at some point I will show the short range scan which is an 8 x 8 grid. On a 16 x 8 screen, this gives (obviously) 2 characters per 'cell', and the graphics are three characters per cell.<br />
<br />
So as you can see (in the top left of the snap) I have "Poked" 224 and 225 into the first two bytes of display memory, and it shows a <*> which will be the Enterprise.<br />
<br />Paul Robsonhttp://www.blogger.com/profile/12278875872815047472noreply@blogger.com0tag:blogger.com,1999:blog-3214083501514129121.post-77358315131992158632016-01-19T14:10:00.001+00:002016-01-19T14:10:09.964+00:00Release 2<a href="http://coolrom.com/screenshots/atari2600/Basic%20Programming.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="http://coolrom.com/screenshots/atari2600/Basic%20Programming.jpg" style="-webkit-user-select: none;" /></a><br />
Well, sort of. The current release is the one with 2 2k ROMs in it (effectively) which boots into MINOL (you can access the monitor via the OS command, and return using G 9000). The zip contains the executable and the SDL DLL if you don't have it.<div>
<br /></div>
<div>
The hardware version is updated to match ; both should be version 0.94</div>
<div>
<br /></div>
<div>
<br /></div>
Paul Robsonhttp://www.blogger.com/profile/12278875872815047472noreply@blogger.com0tag:blogger.com,1999:blog-3214083501514129121.post-60883745467823432612016-01-19T13:59:00.000+00:002016-01-19T13:59:08.267+00:00Of ROMs, PROMs and EPROMs....<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi65DRIEcgCbhrNGFMpGMpKitnfA4w-453bAlbbsFh_cs2EoVYbdx4fb1eIoFG82W7VQFeZmFR3aEXgMO07Wi38PrmiSpdoJU7xctp8GxjS-cfN5TX08-pyCLk9tIrtGkcRkfvk2xjn-F3U/s1600/x.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi65DRIEcgCbhrNGFMpGMpKitnfA4w-453bAlbbsFh_cs2EoVYbdx4fb1eIoFG82W7VQFeZmFR3aEXgMO07Wi38PrmiSpdoJU7xctp8GxjS-cfN5TX08-pyCLk9tIrtGkcRkfvk2xjn-F3U/s400/x.jpg" /></a>So…. Looking at the resulting MINOL ROM, it’s about 2,500 bytes or thereabouts in total.<br />
<br />
Thinking in hardware terms, how you would actually put this on a machine - this isn’t good. I’m wasting 1/2k of ROM here – now, that isn’t much in 2016 terms, but in 1975 terms it is a heck of a lot.<br />
<br />
So I have decided on some reorganisation.<br />
<br />
Out from the monitor ROM go the Mathematics routines – which now aren’t used by anything – and into the monitor ROM goes the scrolling screen handler.<br />
<br />
I’ve tweaked it a bit so there are vectors at 3 (Print Char/String) 5 (Get Char) 7 (Get String) and obviously changed MINOL so it calls these routines directly. This is also handy in that I can call these routines from MINOL if required.<br />
<br />
The monitor ROM now has two sets of screen drivers – the roll to the top and the scrolling version. It also has two keyboard input routines, but this isn’t really worth fixing.<br />
<br />
There’s one problem ; I fixed up the integer printer so when it is left it sets P3 to the Print routine, so this can’t happen any more – the Print routine is elsewhere – so this is set up manually after the three calls to this routine.<br />
<br />
It works quite nicely, and each ROM image (both 2 x 1k ROMs) has about 128 bytes of free program space, which is handy if there are any messy bugs.<br />
<div>
<br /></div>
Paul Robsonhttp://www.blogger.com/profile/12278875872815047472noreply@blogger.com0tag:blogger.com,1999:blog-3214083501514129121.post-30122031391435240422016-01-19T09:55:00.000+00:002016-01-19T09:55:05.133+00:00Minol Completed<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzeH2KjlUtQ2uDPq0QiqfpqN8S0GTMblxMSc-jS5VBbp4Wk1DeSPDJn9DFtDB1GpSzS1zmfSy3gFBA49EGEJrmGi3l711BwBrWZFfv98sAeyMD1YV2sKueSgGpxCQfxZ1r6wVlxNyOXfBk/s1600/x.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="255" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzeH2KjlUtQ2uDPq0QiqfpqN8S0GTMblxMSc-jS5VBbp4Wk1DeSPDJn9DFtDB1GpSzS1zmfSy3gFBA49EGEJrmGi3l711BwBrWZFfv98sAeyMD1YV2sKueSgGpxCQfxZ1r6wVlxNyOXfBk/s320/x.jpg" width="320" /></a><br />
Well, it’s sort of finished and working, probably. I added the final bits this morning.<br />
<br />
<ol>
<li>I added a marker in RAM (a 32 bit value) that if present indicated memory already had a MINOL program in there – if this isn’t present it does a NEW on start, otherwise it leaves it alone. You can switch back and forth from MINOL and the Monitor at will. </li>
<li>Ctrl+C now interrupts at Print statements. 10 PR "HELLO WORLD":GOTO 10 previously could only be got out of using the RESET button.</li>
<li>It looks for the stack top rather than assuming it’s there (it was previously hard coded to $0FF8). It should run with only 2 x 6810 RAM chips (e.g. $C00-$CFF) in the main board, except that a long typed in instruction won't work (the keyboard buffer and stack will collide). It really needs at least three ($C00-$D7F)</li>
<li>The current line number is cleared when you type in a keyboard command. (this was a bug), meant that if you typed PR 1/0 in the command line the number given was the last line number executed.</li>
</ol>
<br />
I will update the released version so it has both ROM images in it sometime soon, e.g. it boots into MINOL, you can type MINOL programs into it and so on. It's not bad, the original code was 1.75k this is about 2.5k but most of the difference is because of the screen driver.<br />
<br />
The next bit is to write the code to translate a text file to MINOL format – may do something automatic with line numbers ? – and get that loading in. You <i>can</i> type in programs like we used to with C64 and Speccys, it does work, but it's not a good idea on a beta langiage. I remember writing about my experiences with such earlier.<br />
<br />
Then, once that’s done, look at Star Trek. I think there are <i>three</i> Star Trek related retrochallenges this half-year :)<br />
<br />
<br />
<div>
<br /></div>
Paul Robsonhttp://www.blogger.com/profile/12278875872815047472noreply@blogger.com0tag:blogger.com,1999:blog-3214083501514129121.post-87988276774171393512016-01-18T18:41:00.002+00:002016-01-18T18:41:13.934+00:00Benchmarking an interpreter<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyYgFoZaLLWfH8HdaLVwg2Bah_nd1YeeN81qi2tq4wXzQs90Bf_ZyawCyagr3ylM_zkr26O42IS3lV6D3GqFQLR-b_y59SzGkHS1MC2vVU_mO_hn3hF1c6WsNQLTp2ygSwB_khKEeusB3i/s1600/x.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyYgFoZaLLWfH8HdaLVwg2Bah_nd1YeeN81qi2tq4wXzQs90Bf_ZyawCyagr3ylM_zkr26O42IS3lV6D3GqFQLR-b_y59SzGkHS1MC2vVU_mO_hn3hF1c6WsNQLTp2ygSwB_khKEeusB3i/s400/x.jpg" /></a>Back in the dim and distant past, the first thing that magazines would do with the latest home computer is benchmark its internal ROM BASIC.<br />
<br />
Virtually every machine released over a period of about 1978-1988 ish had a built in ROM BASIC, with a few exceptions – I owned a Sharp MZ-80K where it had to be loaded in from tape, and the Jupiter Ace had FORTH – but most had BASIC.<br />
<br />
When the machines arrived that had floppy disks as standard – primarily the Amiga and Atari ST – the BASIC interpreter became something provided on a floppy disk.<br />
<br />
The UK magazine Personal Computer World had its own set of benchmarks, which were BASIC programs that were run and measured to see how long they took. The simplest one was this :<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">100 FOR I = 1 TO 1000</span><br />
<span style="font-family: Courier New, Courier, monospace;">110 NEXT I</span><br />
<br />
I’ve actually found them here <a href="http://www.geocities.ws/peterochocki/computers/pcwbm.html">http://www.geocities.ws/peterochocki/computers/pcwbm.html </a><br />
<br />
To give some idea ; a ZX81 4.5s, a Speccy 4.4s, a C64 1.2s,a BBC Micro 0.8s. The slowest machine would be a ZX81 in slow mode which would be about 18s or so (estimate).<br />
<br />
The variation is quite surprising. The first thing on the list is a 68000 at 8Mhz (HP Integral PC) which takes 1.9s ; it is quite remarkable that the BBC Micro (6502 at 2Mhz) should be over twice as fast given that both are operating in floating point. The ZX Spectrum BASIC is based on Nine Tiles original ZX80 BASIC which is designed to operate with 1k of RAM and doesn’t care about speed – a typical Z80 machine of the time clocked at 3.5-4Mhz would probably run the first benchmark in about a second.<br />
<br />
So, I have benchmarked it. I can’t actually run Benchmark 1 – no FOR/NEXT loop, but I can run Benchmark 2, which is the same thing with an IF … GOTO instead , in MINOL, if I reduce the count to 250.<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">100 LET A = 0</span><br />
<span style="font-family: Courier New, Courier, monospace;">110 LET A = A + 1</span><br />
<span style="font-family: Courier New, Courier, monospace;">120 IF A#250; GOTO 110</span><br />
<br />
Which runs in about 19 seconds (when wrapped in a loop running it four times).<br />
This isn’t bad, really – it’s a slow processor, it’s running at a quarter of its actual speed anyway (just sticking an SC/MP 2 in and clocking it up to 4Mhz will get that down to 5 seconds) and it’s not written for efficiency by any means, it’s written more with clarity in mind (honest – an optimised one would look like spaghetti – and it wouldn’t be that much quicker anyway).<br />
<br />
By comparison : ZX81 6.9s, Speccy 8.2s, C64 9.3s, Atari 800 7.3s<br />
<br />
So not too bad really. If I conveniently forget they are all doing it in floating point and I’m doing it in 8 bit integer<br />
<br />
The SC/MP is a notoriously slow processor though – having attempted to emulate processors on an Arduino, it can cope with 4004/4040/8008, the RCA1802 and the SC/MP and that’s about it. I wrote an Apple 1 emulator (more as a protest than anything else) and it ran at about 15-20% of the speed of the real thing (which didn’t matter in most cases because of the slooooow TV Typewriter output).<br />
<br />
For depressing comparison ; 2400Mhz Celeron, running QBASIC, 0.011s. I have reduced this PC to a wreck of its original finery.<br />
<br />Paul Robsonhttp://www.blogger.com/profile/12278875872815047472noreply@blogger.com0tag:blogger.com,1999:blog-3214083501514129121.post-15014640026641167932016-01-18T17:02:00.000+00:002016-01-18T17:02:00.373+00:00MINOL on Hardware<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2qjF5B_blum9WPsrLhbwjCGrFeCXL9V4Raw6-gDGovxSRVxf5XLOcT_CssXn03d1hDLy2V4s0-5x0eEVRyWcQG5fVOPioT71OoKu7WhbK-IJ792oNzR050LJZt00LtQ5dI6AWKTW0hlD4/s1600/x.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="222" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2qjF5B_blum9WPsrLhbwjCGrFeCXL9V4Raw6-gDGovxSRVxf5XLOcT_CssXn03d1hDLy2V4s0-5x0eEVRyWcQG5fVOPioT71OoKu7WhbK-IJ792oNzR050LJZt00LtQ5dI6AWKTW0hlD4/s320/x.png" width="320" /></a></div>
So, this is a sort of actually working BASIC program here.<br />
<br />
Okay, so it’s not exactly the most complex code ever written, but it is working as it should, and it picks up errors a bit better than the original<br />
<div>
<br /></div>
Paul Robsonhttp://www.blogger.com/profile/12278875872815047472noreply@blogger.com0tag:blogger.com,1999:blog-3214083501514129121.post-85935363849432184112016-01-17T16:19:00.001+00:002016-01-17T16:19:22.687+00:00Running programs, after a fashion ....<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHbo8dvFUgIK00iUYvJQuDXKMJkQGB8wf16Rbkze4lm2QQKedRzlFqvsHPYmfe2TmFxzJE4iICzqxG_EQpnahvd72a30Bo_bEfI34sE9wZp6vmv3B3NXBsGty1ZEZ0MkU3QUOGF4yB4BM5/s1600/x.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHbo8dvFUgIK00iUYvJQuDXKMJkQGB8wf16Rbkze4lm2QQKedRzlFqvsHPYmfe2TmFxzJE4iICzqxG_EQpnahvd72a30Bo_bEfI34sE9wZp6vmv3B3NXBsGty1ZEZ0MkU3QUOGF4yB4BM5/s400/x.png" /></a>Well, we sort of have it running MINOL. Very shoddily, but it does work, and as defined by the document from DDJ.<br />
<br />
Admittedly you do have to type it into the assembler directly , well, with a macro anyway – but it does sort of work and seem to do what it’s supposed to. It's junk code, just testing various things.<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"> 1 "START:CLEAR:INA:PR A,A,A,A:GOTO240</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 10 HELLO WORLD</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 20 GOTO 20</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 30 LETB=69:LETA=42:C=A+B:END</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 120 D=D+1:(0,4)=D:(12,130)=69:GOTO120</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 130 A=!:B='@':C=42:D=0-1:GOTO130</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 140 IF1#255;A=A+1:B=B+1</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 150 IF255#255;C=C+1:D=D+1</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 200 LETA=0</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 210 LETA=A+1:IFA#250;GOTO210</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 240 PR42,69,Y</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 241 PR "A:",A,"STAR TREK"</span><br />
<span style="font-family: Courier New, Courier, monospace;"> 242 PR "(",$(144,33),")"</span><br />
<br />
Next up, the console stuff – editing programs, running commands from the keyboard and so on.<br />
<div>
<br /></div>
Paul Robsonhttp://www.blogger.com/profile/12278875872815047472noreply@blogger.com0tag:blogger.com,1999:blog-3214083501514129121.post-30551077989408403332016-01-17T07:45:00.004+00:002016-01-17T07:45:44.928+00:00MINOL Commands<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCaB9OYMoZgLT2zfDGIeImAZAK12JiJA8vgqGrG4jOkHD_PRkS3JP1IMXjO0aYA0I_kQezv2WpzJapCIrj4DY-3QvOQrKNHBWC-OwwXfpuUGGo5WjIwyNdSis7TsruecpjL0jvQ8KHek7I/s1600/x.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCaB9OYMoZgLT2zfDGIeImAZAK12JiJA8vgqGrG4jOkHD_PRkS3JP1IMXjO0aYA0I_kQezv2WpzJapCIrj4DY-3QvOQrKNHBWC-OwwXfpuUGGo5WjIwyNdSis7TsruecpjL0jvQ8KHek7I/s400/x.jpg" /></a>I seem to have written a lot since the last post in terms of the project moving forward. It is now executing code, albeit not in an interactive environment, and the GOTO RUN NEW CLEAR END OS CALL LET and IF commands are coded, leaving PR, IN and LIST. <br />
<br />
Then I have to write the code so you can actually edit programs using the keyboard. At present the “program” is put in using Assembler Macros which works fine for testing but isn’t any good for the final thing.<br />
<br />
I have also written a separate integer printing routine, so actually none of the math routines are now used that I wrote ages ago (well a few days ago anyway).<br />
<br />
Part of the reason is this is a bit of a swine in SC/MP. You have four pointer registers. One is the program counter, one is used for subroutines (P3) and one for the stack (P2) – this is just convention.<br />
This leaves you with one pointer register, P1. In this code it is normally pointing at the program code.<br />
<br />
My original integer to ASCII routine (a 16 bit one) used this as a pointer to memory to store the result in. In the end I decided it was simpler just to write a simple byte only one that used subtraction not division – it only does decimal, and 0-255, but that doesn’t actually matter, and it is simpler to use – it just prints the number in ‘E’.<br />
<div>
<br /></div>
Paul Robsonhttp://www.blogger.com/profile/12278875872815047472noreply@blogger.com0tag:blogger.com,1999:blog-3214083501514129121.post-83475574977567914522016-01-16T09:50:00.001+00:002016-01-16T09:50:37.679+00:00Half time - state of playWell, so far, I'm quite pleased with progress. I have:<div>
<a href="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRyL_mDQhzHVK_TVaueLcluy9oGgrClJf1ThaXe6KmFpUPL0QO9" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img alt="Related image" border="0" src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRyL_mDQhzHVK_TVaueLcluy9oGgrClJf1ThaXe6KmFpUPL0QO9" /></a></div>
<div>
<ol>
<li>Digitised the circuit diagrams</li>
<li>Written an Emulator, running on the PC and "replica" hardware.</li>
<li>Debugged the original monitor</li>
<li>Written a Machine code monitor with a simple assembler</li>
<li>Written a fair chunk of a "High Level" language</li>
</ol>
</div>
<div>
<br />
<div style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;">
</div>
</div>
<div>
<br /></div>
<div>
to finish ....</div>
<div>
<br /></div>
<div>
<ol>
<li>complete the Language and test it a bit.</li>
<li>write some sort of text -> MINOL translator - I whilst I could physically type the code into the emulator, well, that's the plan any way, it would be much easier to have it as a text file and convert it into MINOL format and load it straight in.</li>
<li>write Star Trek - and testing the language</li>
</ol>
</div>
<div>
The Star Trek I was going to base it on was the one by Ian Powell published in Computing Today (a UK Magazine) in 1979 ; the reason is I have already ported this (it's for an obscure machine, the Transam Triton) to whatever computer I had at the time (Sharp MZ80K I think ....), so it seems appropriate.</div>
<div>
<br /></div>
<div>
Writing a program in a partly tested language is no fun. I've actually done it before, professionally, it was a BASIC owned by a Dutch company (but written by an Englishman). It was, well, interesting. You would enter GOSUB 3000 and it didn't. Variables would occasionally disappear or the program would crash altogether. I don't know what happened to that project (Hotel Management package) but it had disaster written all over it.... I did my best. On the up side, I did get to spend several months in Dordrecht in the Netherlands, which was fun. Even if all the girls (bar one) were taller than me. In fact everyone was taller than me. Even the five year olds.</div>
<div>
<br /></div>
<div>
<br /></div>
Paul Robsonhttp://www.blogger.com/profile/12278875872815047472noreply@blogger.com0tag:blogger.com,1999:blog-3214083501514129121.post-9442091069970410242016-01-16T09:34:00.002+00:002016-01-16T09:34:32.536+00:00Expressions in MINOL<div class="MsoNormal">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyx-os9d2IjzEiZ8yfG-iYnhGuLm_Jk5OPDchzWGn4QT0XOTowbiHLTOEjyv6vgV_nNk9hYePFFbT7sH-wO14vnOy8h1vAWZgXnwmY0czYwi1jqSXJ_T75EDkg1y3NBfd5XdSqfP8tb29l/s1600/x.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="318" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyx-os9d2IjzEiZ8yfG-iYnhGuLm_Jk5OPDchzWGn4QT0XOTowbiHLTOEjyv6vgV_nNk9hYePFFbT7sH-wO14vnOy8h1vAWZgXnwmY0czYwi1jqSXJ_T75EDkg1y3NBfd5XdSqfP8tb29l/s320/x.jpg" width="320" /></a>So, having been tinkering for a bit, I’ve written the
functions to calculate expressions for MINOL. </div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
This is considerably simpler than
BASIC , because there is no order of precedence, and only five possible terms:</div>
<div class="MsoNormal">
</div>
<ul>
<li>integer constant</li>
<li>variable A-Z</li>
<li>a random number - ! (e.g. !*2)</li>
<li>quoted character value (‘a’) </li>
<li>memory access (4,1) (which reads $0401). </li>
</ul>
<br />
<div class="MsoNormal">
Plus, they are all one byte which
means I can return them easily in E rather than use the stack.<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<br />
<div class="MsoNormal">
The code is actually just the expression and the test code,
which is python generated expressions which are then run and compared with the
calculated answer – this kind of thing for example </div>
<div class="MsoNormal">
<i><br /></i></div>
<div class="MsoNormal">
<i>(4,(2,(((7,'O'),Z),70)))-6-90+D-4/50+D</i> </div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
which is, incidentally, 23
(on the current version of the monitor, which is used for memory reads).<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Obviously I don't use random numbers in a unit test but this is the Galoisian LFSR again, which is quite a decent random number generator.</div>
<div class="MsoNormal">
<br /></div>
Paul Robsonhttp://www.blogger.com/profile/12278875872815047472noreply@blogger.com0tag:blogger.com,1999:blog-3214083501514129121.post-1862585336598122552016-01-15T19:21:00.003+00:002016-01-15T19:21:44.288+00:00MINOL<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkI3JqE5SxBrOjIi4kdX5REabscW3yPnM3A1-U85qOstcNakvgt6E8YsZ9204b1yQLi8cejWP7MRR2WanXxKuU-8nlIB7l-v_XczFWvKR5d9nzbnOaHOSDdgjgKhvI1uv8rhQbWvIELEA6/s1600/x.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkI3JqE5SxBrOjIi4kdX5REabscW3yPnM3A1-U85qOstcNakvgt6E8YsZ9204b1yQLi8cejWP7MRR2WanXxKuU-8nlIB7l-v_XczFWvKR5d9nzbnOaHOSDdgjgKhvI1uv8rhQbWvIELEA6/s320/x.jpg" width="240" /></a>I was originally going to use VTL-2 as my High Level Language, but I discovered this Tiny BASIC ish language while poking around, it was published in an old edition of Dr Dobbs Journal.<br />
<br />
I’d already written the screen driver (see previous post) and some evaluation stuff for VTL-2 but this looked more interesting to program in.<br />
<br />
In some ways it’s appropriate. It was designed by someone in their “Third year of High School” (Erik Mueller, who I think is the guy pictured – not aged 13) in 1976, which means he is about the same age as me plus or minus a year.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPsJnTW7HKJpz7hTUz4N5eE8HW8DpqdevosEPCLjbfd-VSyyC1Yz6lTUz0QXf_O_xtfSQeyJJSGttAY-ZCYNn4iWu0RfQchYeHanCOTcQz2PuXBiMU07cAEUIeBcxgBrhU5qyiHD0vwFtr/s1600/2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPsJnTW7HKJpz7hTUz4N5eE8HW8DpqdevosEPCLjbfd-VSyyC1Yz6lTUz0QXf_O_xtfSQeyJJSGttAY-ZCYNn4iWu0RfQchYeHanCOTcQz2PuXBiMU07cAEUIeBcxgBrhU5qyiHD0vwFtr/s400/2.jpg" width="242" /></a>It’s slightly odd as Tiny BASICs go ; for a start it has 1 byte values, both variables and line numbers – this means that my work on 2 byte maths routines is pretty much to pot. It does support strings, sort of and it also supports direct access to memory both for data and code.<br />
<br />
It’s pretty impressive for a 13/14 year old and fits in under 2k of memory. This is what the code looks like :-<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">10 " *** NUMBER- A NUMBER GUESSING GAME (NUM05) </span><br />
<span style="font-family: Courier New, Courier, monospace;">20 PR:PR" WHAT IS YOUR NAME";:IN$(14,1) </span><br />
<span style="font-family: Courier New, Courier, monospace;">30 X=!:S=0:PR"HI, " ;$(14,1);" . WELCOME TO THE GAME OF NUMBER" </span><br />
<span style="font-family: Courier New, Courier, monospace;">40 PR" I'M THINKING OF A NUMBER FROM 0 TO 255" </span><br />
<span style="font-family: Courier New, Courier, monospace;">50 PR" GUESS MY NUMBER !!" </span><br />
<span style="font-family: Courier New, Courier, monospace;">60 PR: PR "YOUR GUESS": ING: S=S+1 </span><br />
<span style="font-family: Courier New, Courier, monospace;">65 IFG=X; GOTO90 </span><br />
<span style="font-family: Courier New, Courier, monospace;">70 IFG<X; PR" TOO SMALL. TRY A BIGGER NUMBER." </span><br />
<span style="font-family: Courier New, Courier, monospace;">80 IFX<G; PR"TOO BIG. TRY A SMALLER NUMBER." </span><br />
<span style="font-family: Courier New, Courier, monospace;">85 GOTO60 </span><br />
<span style="font-family: Courier New, Courier, monospace;">90 PR " THAT’S RIGHT, ";$(14,1);" I ! YOU GOT IT IN";S; "GUESSES" </span><br />
<span style="font-family: Courier New, Courier, monospace;">100 PR" PLAY AGAIN" ; : INA: IFA=’Y';GOTO30 </span><br />
<span style="font-family: Courier New, Courier, monospace;">110 PR " OK HOPE YOU HAD FUN . " : END </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
This is (of course) the very common Hi Lo game.<br />
<br />
<ul>
<li>$(14,1) is the string at H = 14, L = 1 e.g. $0E01, </li>
<li>! is a random number from 0-255. </li>
<li>Lines beginning with a “ are comments (e.g. 10)</li>
</ul>
<br />
Other than that it should be fairly clear. I will probably be a bit more syntactically friendly, skipping spaces and so on - looking at the original code (8080 assembler) it could get a bit confused running program if you aren't fairly straight with syntax - so mine will support IF G=X ; GOTO 90 rather than IFG=X; GOTO90<br />
<div>
<br /></div>
Paul Robsonhttp://www.blogger.com/profile/12278875872815047472noreply@blogger.com0tag:blogger.com,1999:blog-3214083501514129121.post-12078949280762866702016-01-14T20:11:00.000+00:002016-01-14T20:11:34.028+00:00New Screen Driver<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjU7-nDhb47hLIleo_YTLezShXQ_BUzRf54sf-VJdVmxuu02au1Pf4-JFeOTwXHwndFCq8Mm8_829_k0nRge46EDeULIQXdxcGYO2gw3eJ9bLJ90S_YMvrdmiMVS-IP36JygojgwxKXxIAH/s1600/x.gif" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="230" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjU7-nDhb47hLIleo_YTLezShXQ_BUzRf54sf-VJdVmxuu02au1Pf4-JFeOTwXHwndFCq8Mm8_829_k0nRge46EDeULIQXdxcGYO2gw3eJ9bLJ90S_YMvrdmiMVS-IP36JygojgwxKXxIAH/s320/x.gif" width="320" /></a>The picture is a thing called Curses. It was (or is) a sort of terminal driver / text ui library that allowed the use of completely different terminals with the same code, it worked with termcap or terminfo to provide device independence.<br />
<br />
I used to work at a place that used it ; it was a really cheap place to work. Not only did we use a version of curses we typed in ourselves from a book – wrongly, which we didn’t know until I tried to do a vertical menu with it and it crashed all the time. When allocating memory for the window we’d used w * w rather than h * w, which worked fine provided w was greater than h, which it isn’t in some drop down menus.<br />
<br />
The hardware we developed on was on loan from someone or other – a huge 386 box about the size of a fridge. We kept having to concoct reasons why we were still ”testing” this gear …… this company was a subset of a big commercial organisation too. If the owners had wanted it back we would have been stuffed….. we were running Xenix/386 on it and we wouldn’t have had a machine to develop on.<br />
<br />
I also worked at a place where I was given an original IBM PC to work on, the 4.77Mhz one, with a specialised BASIC interpreter. I got an upgrade when I pointed out the machine could not keep up with my typing – type LIST and it took about 5 seconds to appear. Not awfully good for productivity (this same place I was ridiculed for suggesting DBASE III type screen painters …. this was in the late 1980s ….)<br />
<br />
Anyway, the point of this is I have released, hopefully, a new screen driver for the HLL – this one does proper scrolling unlike the rolling of the monitor, which means it needs 128 bytes of RAM all to itself – because the design does not allow you to read video ram, you have to keep a shadow copy of everything. I wanted the Monitor ROM to be able to operate in one 128 x 8 RAM.<br />
<br />
It’s about 400 bytes and provides string and character input and output. There’s a program testing it that just inputs a line and echos it again.<br />
<br />
<div>
<br /></div>
Paul Robsonhttp://www.blogger.com/profile/12278875872815047472noreply@blogger.com0tag:blogger.com,1999:blog-3214083501514129121.post-50427983381020052242016-01-13T15:13:00.003+00:002016-01-13T15:13:41.904+00:00Working ReleaseSomething actually downloadable and runnable, at last :)<br />
<a href="https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcQhZfMvFBU-KZkBQyYmylCAubbFF7E6VFQXFt3l9xwUZt_sl1xJvw" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img alt="Image result for release software" border="0" class="rg_i" data-src="https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcQhZfMvFBU-KZkBQyYmylCAubbFF7E6VFQXFt3l9xwUZt_sl1xJvw" data-sz="f" height="400" jsaction="load:str.tbn" name="sQcl2hSqhuQHkM:" src="https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcQhZfMvFBU-KZkBQyYmylCAubbFF7E6VFQXFt3l9xwUZt_sl1xJvw" style="height: 215px; margin-top: -7px; width: 215px;" width="400" /></a><br />
I've added a link to the release directory, which contains a zip with two further files (click on the file then RAW to open it.... I think) one of which is SDL.dll, the SDL dynamic link library, and the other is the emulator.<br />
<br />
All you can do is run it at the moment.<br />
<br />
The commands are (apart from assembler ones)<br />
<br />
<br />
<ul>
<li>A [aaaa] set current address</li>
<li>B [bb] [bb] [bb] ... enter bytes at current address</li>
<li>C clear screen</li>
<li>D [aaaa] disassemble from current address</li>
<li>G aaaa run program</li>
<li>GET [aaaa] read tape to addresss aaaa</li>
<li>L nn set label nn to current address</li>
<li>M [aaaa] memory dump</li>
<li>PUT [nnnn] write nnnn bytes from current address to tape I/O</li>
</ul>
<br />
<br />
All the source and so on should be up to date ; also the hardware version source is released, this requires platformio to build it.<br />
<br />
<br />
<br />Paul Robsonhttp://www.blogger.com/profile/12278875872815047472noreply@blogger.com0tag:blogger.com,1999:blog-3214083501514129121.post-72323553532127234752016-01-13T08:41:00.002+00:002016-01-13T08:41:58.323+00:00Britain's Dumbest Coder Episode 94Confession time.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAldmVNo62pjrVJZe089rRTtgY-PpuB43gANBpS_H8NqkBN5i6kYqlMFU10AjFV6LaJaA3ZS4qe6XcQgl_EJzBJoKlR1ZdLW3glHopBRTRUJkVhY6FCa30qmHbH6AWa86pVWPUWqGVcCN5/s1600/x.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAldmVNo62pjrVJZe089rRTtgY-PpuB43gANBpS_H8NqkBN5i6kYqlMFU10AjFV6LaJaA3ZS4qe6XcQgl_EJzBJoKlR1ZdLW3glHopBRTRUJkVhY6FCa30qmHbH6AWa86pVWPUWqGVcCN5/s320/x.jpg" width="320" /></a>I spent about 20 minutes finding a bug this morning. For a complex bug, that’s not so terrible, but this wasn’t a complex one.<br />
<br />
The emulator uses different storage for the Windows version (RAM arrays) and the Arduino version (Flash memory) because the 2650 just doesn’t have very much RAM memory, so the ROM images are permanent in Flash.<br />
<br />
So I wrote some Macros in ‘C’ to create and access these.<br />
<br />
When I added support for ROM at $9000-$9FFF into the emulator, this involved putting these macros in and amending the Read() inline function to cope with reading from this space.<br />
Worked perfectly in the emulator version, didn’t work at all on the Arduino one.<br />
<br />
Lots of headscratching.<br />
<br />
Eventually it dawned on me that I’d written something like :<br />
<br />
<b>MB = extendedROMMemory[MA-0x9000]</b><br />
<br />
on the Read inline function.<br />
<br />
This is why it didn’t work ; I was always using the static RAM access in either version, whereas to access Arduino flash you have to use a function pgm_read_byte_far() or something like that.<br />
<br />
This was despite writing a Macro to do this automatically (so you just put in ROM(extendedROMMemory,MA-0x9000) and it did the work for you) and having an example immediately above (reading from the Monitor ROM space) to copy.<br />
<br />
I felt very dim when I realised it…..<br />
<br />
<u>Answer to the question in the last post:</u><br />
<br />
VTL-2 allows punctuation to be used for variables, including ‘=’ so ===== becomes, if we replace the = that refers to the variable '=' with 'E' it becomes<br />
<br />
E = E = E<br />
<br />
E = E as an expression is 1 (VTL's "True") so it becomes<br />
<br />
E = 1<br />
<br />
<br />Paul Robsonhttp://www.blogger.com/profile/12278875872815047472noreply@blogger.com0tag:blogger.com,1999:blog-3214083501514129121.post-90783266717816639332016-01-12T16:56:00.004+00:002016-01-12T16:59:00.004+00:00Monitor Complete (again)<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo2HtjNpObElf-WFuqaEL9DQLrpuB9_qeCsltK8GGd_t9VW_0ZqBTzxG0_kUoTkS6jLgX6mLJFU_I9CiqIU31QsAeTL8OIqxdfUsVvPGe9tnuPOb1Gdqf_-Ov3rH9GM03-5acSVZcLZq6n/s1600/x.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img alt="" border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo2HtjNpObElf-WFuqaEL9DQLrpuB9_qeCsltK8GGd_t9VW_0ZqBTzxG0_kUoTkS6jLgX6mLJFU_I9CiqIU31QsAeTL8OIqxdfUsVvPGe9tnuPOb1Gdqf_-Ov3rH9GM03-5acSVZcLZq6n/s400/x.jpg" title="Why does Google Images return this for VTL-2 ? What is it ?" width="255" /></a>Well, pretty much. Should now be version 0.92. I’m hoping this is a fairly stable version now.<br />
<br />
This one no longer has a random number generator, but has an integer to ASCII routine, which appears to work fine.<br />
<br />
So I will upload this to github and sometime tomorrow upload the emulator and hardware source, so people can actually run this if they are so inclined.<br />
<br />
After that, think through VTL-2 and get used to the language. It puts me in mind of APL a bit.<br />
<br />
Actually what it is really is a sort of transport triggered architecture BASIC, where moving something from one place to another does something. There’s only one instruction (assignment statement), but if you assign to ? it prints the number, if you assign to $ it prints the character and so on. You “GOTO” (boo !) by assigning to #. Editing is done a la BASIC (e.g. line numbers) and you can execute from the command line like you do in BASIC.<br />
<br />
It gives it a 87”*&£(*!”&(&(!*”&£( sort of look, which isn’t helped by the use of the 6 bit ASCII character set as variables, so you can use = as a variable, an operator, and an assignment.<br />
<br />
So in VTL-2 you can write, as an instruction.<br />
<br />
<div style="text-align: center;">
=====</div>
<br />
Quiz of the day : what does this do ?<br />
<br />
<br />
<div>
<br /></div>
Paul Robsonhttp://www.blogger.com/profile/12278875872815047472noreply@blogger.com0tag:blogger.com,1999:blog-3214083501514129121.post-70952051822727599442016-01-12T12:40:00.002+00:002016-01-12T12:40:26.960+00:00I was thinking about the implementation of VTL-2.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgFStGSAVOCzLELoSSQdWxxsjhZ8c_po9QVFx82A6byqbR_4-aMNPqOJO-lrH8Bm9vUkSlg44y46ZLmO6WPMUY64215qQYZBN1Nq6Qf8QD6MpIEPidoZN_2S77YKjkTKlakod_sxjtPJ3G/s1600/x.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgFStGSAVOCzLELoSSQdWxxsjhZ8c_po9QVFx82A6byqbR_4-aMNPqOJO-lrH8Bm9vUkSlg44y46ZLmO6WPMUY64215qQYZBN1Nq6Qf8QD6MpIEPidoZN_2S77YKjkTKlakod_sxjtPJ3G/s400/x.jpg" width="355" /></a><br />
<br />
One thing that dawned on me was that the monitor and VTL-2 won’t share much code , except the Maths routines – VTL-2 will have its own i/o routines with proper scrolling rather than the rolly-to-the-top thing I have now.<br />
<br />
VTL-2 will not have the requirement to operate with 128 bytes of RAM minimum (as the Monitor uses about 60 bytes, and the stack probably 20 or so , this doesn’t leave a huge amount of memory).<br />
<br />
This is a problem for the random number generator ; out of all the routines, this is the only one that uses a fixed memory slot, 2 bytes (at $C1E) which is the current seed, the only static value in the mathematics routines. If I use this, I am beholden to the memory layout in the monitor.<br />
<br />
So, I’ve decided to simply cut the routine altogether and replace it with an Integer -> ASCII routine which won’t have that problem – like the other routines it communicates via the stack and P1.<br />
<br />
I could’ve passed a pointer to the seed in, but that just seems messy.<br />
<br />
This might mean I have to lose the beep on start up, or the text message ; I can live without those .... just. Surely a beep is mandatory in a retrocomputer.Paul Robsonhttp://www.blogger.com/profile/12278875872815047472noreply@blogger.com0tag:blogger.com,1999:blog-3214083501514129121.post-33322746904095161332016-01-12T12:00:00.000+00:002016-01-12T12:41:16.492+00:00A bug, after a fashion.<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhB3Y8srdEq17os80dEFXtYq2da0u0qVhfY6dcg0ABbSz3c1wKb-6KoyBwm1fUSCtvcN02jYNbMpseTdbBfzdI1hjgKnJx7pkFc5uX_lMGzakJ1o3-21v8jQBNGPF_Ry_kZeFa7d309nkx9/s1600/x.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhB3Y8srdEq17os80dEFXtYq2da0u0qVhfY6dcg0ABbSz3c1wKb-6KoyBwm1fUSCtvcN02jYNbMpseTdbBfzdI1hjgKnJx7pkFc5uX_lMGzakJ1o3-21v8jQBNGPF_Ry_kZeFa7d309nkx9/s320/x.jpg" width="320" /></a>Well, a bug popped up. Sort of.<br />
<br />
When reading through the VTL-2 stuff I noticed it uses positive integers only 0-65535. The problem is my arithmetic routines only do -32768..32767.<br />
<br />
So I sacrificed my in ROM message to have two divisions – forward slash (signed) and backward slash (unsigned). Multiply works for both.<br />
<br />
Retesting revealed a bug in going from 15 to 16 bit division, checking the result sign rather than the Carry flag when doing the test subtraction, so I replaced that. It almost doesn’t really count as a bug, because originally values were only going to be 15 bit.<br />
<br />
But anyway, that one is fixed.<br />
<br />
I’ve added, for no reason at all other than I can, a booting beep to the machine. It reminds me of my days with the BBC Micro, where it used to boot up with duuuuu--beep.<br />
<div>
<br /></div>
Paul Robsonhttp://www.blogger.com/profile/12278875872815047472noreply@blogger.com0