UK Vintage Radio Repair and Restoration Powered By Google Custom Search Vintage Radio and TV Service Data

Go Back   UK Vintage Radio Repair and Restoration Discussion Forum > Specific Vintage Equipment > Vintage Computers

Notices

Vintage Computers Any vintage computer systems, calculators, video games etc., but with an emphasis on 1980s and earlier equipment.

Closed Thread
 
Thread Tools
Old 30th May 2017, 12:38 am   #21
arjoll
Dekatron
 
arjoll's Avatar
 
Join Date: May 2006
Location: Invercargill, New Zealand
Posts: 3,440
Default Re: Sinclair ZX81

Quote:
Originally Posted by Trevor View Post
Poke and peek 32767 comes to mind
The main thing I seem to remember for some reason is RAND USR 836 to load a program without running it
arjoll is offline  
Old 26th Jul 2017, 3:21 am   #22
Graham G3ZVT
Dekatron
 
Graham G3ZVT's Avatar
 
Join Date: May 2010
Location: Greater Manchester, UK.
Posts: 18,675
Default Re: Sinclair ZX81

And "RAND USR 16514" of course.

Graham.
G3ZVT
Graham G3ZVT is offline  
Old 26th Jul 2017, 7:52 pm   #23
mole42uk
Nonode
 
mole42uk's Avatar
 
Join Date: Aug 2010
Location: Resolfen, Wales; and Bristol, England
Posts: 2,588
Default Re: Sinclair ZX81

For those of us who thankfully avoided Mr. Sinclair's offerings for home computer users, what is the significance of RAND USR 16514?
__________________
Richard

Index:
recursive loop: see recursive loop
mole42uk is online now  
Old 26th Jul 2017, 9:31 pm   #24
cmjones01
Nonode
 
Join Date: Oct 2008
Location: Warsaw, Poland and Cambridge, UK
Posts: 2,669
Default Re: Sinclair ZX81

Quote:
Originally Posted by mole42uk View Post
what is the significance of RAND USR 16514?
The ZX81 was designed to be programmed by the user in BASIC, and could only easily save and load BASIC programs to and from tape. If you wanted to program the ZX81 in machine code rather than BASIC, you had to somehow conceal your machine code in a BASIC program. The common way to do this was to start your program with a REM statement containing as many characters as your machine code needed. The machine code would then be painstakingly POKEed in to memory at that location by manually entering numbers. The REM statement did nothing when the program was run, since it was just a comment, but was obediently saved and loaded to and from tape by the standard SAVE and LOAD commands.

The memory layout of the ZX81 meant that the first character of that REM statement on the first line of a BASIC program was at location 16514. The USR function in BASIC calls a machine code routine at the address it's given. USR returns a value (I can't remember what it meant - something to do with register contents, probably) so has to be given as a parameter to something else. It was common to use RAND for this because its only side effect was seeding the random number generator, which didn't usually disturb anything.

So the command RAND USR 16514 was the most common way of running a machine code program on the ZX81.

Afterthought: my memory is a bit rusty, so it may be that the first line of the program was actually RAND USR 16514 and the second line contained the REM statement, so that running the BASIC program would start the machine code running. You'd have to consult the ZX81 memory map to work it out.

Chris
__________________
What's going on in the workshop? http://martin-jones.com/
cmjones01 is offline  
Old 26th Jul 2017, 10:07 pm   #25
cmjones01
Nonode
 
Join Date: Oct 2008
Location: Warsaw, Poland and Cambridge, UK
Posts: 2,669
Default Re: Sinclair ZX81

Update to my own post: I've just checked with the excellent JtyOne online ZX81 emulator:

http://www.zx81stuff.org.uk/zx81/jtyone.html

Location 16514 is indeed that of the first character of a REM statement in the first line of a BASIC program. Memory wasn't so rusty after all!

Chris
__________________
What's going on in the workshop? http://martin-jones.com/
cmjones01 is offline  
Old 27th Jul 2017, 3:59 pm   #26
mole42uk
Nonode
 
mole42uk's Avatar
 
Join Date: Aug 2010
Location: Resolfen, Wales; and Bristol, England
Posts: 2,588
Default Re: Sinclair ZX81

Thank you Chris! I didn't know that the Sinclair machines preferred BASIC to machine code, that's an interesting snippet of information.
__________________
Richard

Index:
recursive loop: see recursive loop
mole42uk is online now  
Old 27th Jul 2017, 4:11 pm   #27
MrBungle
Dekatron
 
MrBungle's Avatar
 
Join Date: Jun 2016
Location: London, UK.
Posts: 3,687
Default Re: Sinclair ZX81

Tripped over this the other day which may be of interest.

Build your own ZX80 / ZX81 from scratch! http://searle.hostei.com/grant/zx80/zx80.html
MrBungle is offline  
Old 30th Jul 2017, 5:04 pm   #28
IanBland
Hexode
 
Join Date: May 2015
Location: Northampton, Northants, UK.
Posts: 380
Default Re: Sinclair ZX81

The USR function returns the contents of the BC register pair. It was a useful if crude means of communicating a result back from a machine code routine to BASIC.
IanBland is offline  
Old 31st Jul 2017, 9:42 pm   #29
Ken
Hexode
 
Ken's Avatar
 
Join Date: Oct 2003
Location: Near Glasgow, UK.
Posts: 309
Default Re: Sinclair ZX81

Well all this talk of the ZX81 prompted me to go and find mine which I put away when I found the two keyboard connectors had cracked. Mine was a kit at £49.99. I also found the building instructions. The pcb has "issue one" printed on it.
The case has red raised lettering. I took it apart. Found most of the plastic offsets, which are part of the case, had cracked. Have repaired this using a combination of super glue and heat shrink sleeving. I have carefully removed the original keyboard, as I have read a couple of methods of repairing them but I have also sent for a replacement. Have checked pcb and on visual inspection it looks quite good. I am hoping there are no electrical problems but there seems to be quite a lot on the web on repairing them.

Regards,

Ken.
Ken is offline  
Old 1st Aug 2017, 6:36 pm   #30
IanBland
Hexode
 
Join Date: May 2015
Location: Northampton, Northants, UK.
Posts: 380
Default Re: Sinclair ZX81

Ken, a ZX81 ought to boot (if you can dignify it with that term) without the keyboard since it's just a switch matrix connected to a Z80 port. You should be able to get it to the K cursor. One problem these days is getting a compatible television since the '81's output signal is what one might call an approximation of a monochrome TV signal. As I understand it, modern LCD TVs with a PAL input normally struggle. Hopefully though that's not such a problem for someone on this forum
IanBland is offline  
Old 1st Aug 2017, 7:38 pm   #31
Ken
Hexode
 
Ken's Avatar
 
Join Date: Oct 2003
Location: Near Glasgow, UK.
Posts: 309
Default Re: Sinclair ZX81

Hello Ian
The last time I tried it booted to the cursor. I did not try it before I dismantled it to remove the keyboard. I have read a little about other failures that they suffer from but there seems to be repairs for many of these. As the keyboard was not expensive I decided I would go ahead and fit one and go on from there. I have one of those small 6 inch monochrome CRT TVs that I can use for testing. I also think I have the 14 inch monochrome TV, in the loft, that I used with it when I first had it but can't remember the last time it was used. It's a cassette tape player I am worried about. As I remember they were a bit sensitive about these. I think they also like mono best. I think I have the one I used with it somewhere but I suspect that the belt/s and perhaps other rubber have given up by now.
I'll report on how it goes.

Regards,

Ken.
Ken is offline  
Old 2nd Aug 2017, 10:24 pm   #32
IanBland
Hexode
 
Join Date: May 2015
Location: Northampton, Northants, UK.
Posts: 380
Default Re: Sinclair ZX81

Hello Ken

Well the good thing about the simple design of the 81 is there's not actually much to go wrong, and what does go wrong can be fixed usually. Obviously the custom ULA is a bit of a problem if that's zapped

I shouldn't worry about cassette players. Nowadays you can just use a PC sound input/output for save and load. Or probably even a smartphone.

Talking of cassettes, I am still scarred by the memories of saving hours of work (often in machine code) onto a cassette and then finding it wouldn't load back in.
IanBland is offline  
Old 2nd Aug 2017, 11:05 pm   #33
radiotechnician
Pentode
 
Join Date: Jan 2013
Location: Powell River, British Columbia, Canada.
Posts: 217
Default Re: Sinclair ZX81

Fond memories. A few of us were watch electricians. We had ZX 81 computers
to play with, on our desk, in the night, awaiting calls. Tiny TV set and all.

When we attached the memory pack, the system would wipe out our VHF radio.

We solved it by wrapping the pack in tin foil.
__________________
Steve Dow
VE7ASO
radiotechnician is offline  
Old 2nd Aug 2017, 11:10 pm   #34
julie_m
Dekatron
 
Join Date: May 2008
Location: Derby, UK.
Posts: 7,735
Default Re: Sinclair ZX81

The ZX81 keyboard was always made down to a price. There's being original, and there's masochism!

I would be tempted to get fifty or so large "tact" switches and assemble a "proper" -- well, more proper than the original, anyway -- keyboard using copper strip breadboard or just plain matrix board with point-to-point wiring.

The ZX keyboard is split into eight half-rows (space, ., M, N, B; newline, L, K, J,H; P, O, I, U, Y; 0, 9, 8, 7, 6; 1, 2, 3, 4, 5; Q, W, E, R, T; A, S, D, F, G; shift, Z, X, C, V) each with five keys. Each of the common connections of each half-row is grounded in turn, and any input connected to a key within that group which is being depressed will read "0".

The extra keys can be used for refinements such as a right-hand SHIFT key and a "space bar" with a suitably-sized piece of plastic bridging across multiple key switches.
__________________
If I have seen further than others, it is because I was standing on a pile of failed experiments.
julie_m is offline  
Old 2nd Aug 2017, 11:40 pm   #35
IanBland
Hexode
 
Join Date: May 2015
Location: Northampton, Northants, UK.
Posts: 380
Default Re: Sinclair ZX81

radiotechnican-

Tiny screens? I had a massive 12" monitor for mine. Well, a black and white portable from Rumbelows, anyway. It was a massive investment for teenage me, £49.99, but necessary as I soon discovered like I suspect most similar users did, that the rest of the family are not overly keen on sacrificing watching the living room telly so that one of the family could join the white heat of the information technology revolution.

julie_m

We must remember that whatever the quality of the keyboard, typing on it is painful slow. It sometimes feels like the designers went out of their way to hobble the machine (not really fair of course, it was a bit of a miracle of design); part of the reason for the slowness other than the CPU running at less than 1/4 speed was that any modification to the length of the BASIC program area (i.e. typing another character) meant moving the memory map above it, including the variables area and the display file, every time. IIRC, you could actually make typing a bit faster by CLEARing the variable before editing the program, if there was a significant amount of them (e.g. long strings).

Even so, I always edited in FAST mode. Which was somewhat migraine inducing as the screen flashed and fizzled. It's a wonder it didn't fry the TV!

Talking of which, that little portable was a good investment. It was often my main TV as I moved around various rented flats and rooms in my 20s.
IanBland is offline  
Old 3rd Aug 2017, 12:23 am   #36
MrBungle
Dekatron
 
MrBungle's Avatar
 
Join Date: Jun 2016
Location: London, UK.
Posts: 3,687
Default Re: Sinclair ZX81

Quote:
Originally Posted by julie_m View Post
The ZX81 keyboard was always made down to a price. There's being original, and there's masochism!
This was Sinclair's only selling point for their products. Cheaper than the others.

(also more likely to catch on fire or have to be returned)
MrBungle is offline  
Old 3rd Aug 2017, 12:35 am   #37
IanBland
Hexode
 
Join Date: May 2015
Location: Northampton, Northants, UK.
Posts: 380
Default Re: Sinclair ZX81

Yes, but cheap is good. Cheap things can be enjoyed by more people. I never could have afforded a BBC or C64 at the time. I think people overlook that Britain at that time was actually rather impoverished (some may argue that we still are) and electronics items were expensive. Colour tellies and video recorders were not affordable for many people (we'd only just got a colour TV and never had a video recorder).

So Sinclair building the thing down to a price (largely due to Jim Westwood's legendary capacity for lateral thinking a quart out of a pint pot) really did start a computer revolution for millions of us. The BBC for instance was all very well with its rich feature set, but was basically bought by the middle class. The rest of us had ZX81s and Spectrums, and just for me I think it's kind of cool I'm still using the hardcore assembler fangling I learned in order to just get something reasonable out of a ZX81 on microcontroller programming today.

Ten minutes with the PIC risc instruction set and you yearn for a Z80. Even one on a machine whose RAM tends to wobble off the back!
IanBland is offline  
Old 3rd Aug 2017, 8:56 am   #38
Scimitar
Heptode
 
Scimitar's Avatar
 
Join Date: Oct 2015
Location: Gloucestershire, UK.
Posts: 719
Default Re: Sinclair ZX81

Quote:
Originally Posted by IanBland View Post

Ten minutes with the PIC risc instruction set and you yearn for a Z80. Even one on a machine whose RAM tends to wobble off the back!
I had a ZX81 for a while and found it utterly infuriating to do anything on. However, when I started PIC programming, I was surprised at just how straight forward it was to do. Personally I like RISC programming and since trying a BBC, I have never looked back. I run and always have run RISC computers in my business. I have a physical RISC PC which acts as a server for my network CID system and VirtualRPC on the Microsoft machine. I tend to use the best platform for the particular job, rather than make do with the yank's idea of what I need. ;-)
Scimitar is offline  
Old 3rd Aug 2017, 9:10 am   #39
Andrew2
Nonode
 
Andrew2's Avatar
 
Join Date: Mar 2010
Location: Dukinfield, Cheshire, UK.
Posts: 2,034
Default Re: Sinclair ZX81

The ZX81 was my first computer and I fell in love with the little beast despite it's awkward keyboard and slow responses. I recall that most if not all BASIC commands (such as LET, FOR, TO, THEN etc) were entered as 'tokens', which speeded up entry a bit.
Then when I moved up to a BBC-B I was initially horrified to find I had to type the whole words in! Soon got used to that though, and the BBC was a speed-monster compared to the Sinclair.
__________________
Andy G1HBE.
Andrew2 is offline  
Old 3rd Aug 2017, 9:36 am   #40
acollins22
Pentode
 
Join Date: Oct 2010
Location: Melton Mowbray, Leicestershire, UK.
Posts: 156
Default Re: Sinclair ZX81

Quote:
Originally Posted by julie_m View Post
The ZX81 keyboard was always made down to a price. There's being original, and there's masochism!

I would be tempted to get fifty or so large "tact" switches and assemble a "proper" -- well, more proper than the original, anyway -- keyboard using copper strip breadboard or just plain matrix board with point-to-point wiring.
You could always try this keyboard from the RC2014 project... http://rc2014.co.uk/modules/universal-micro-keyboard/


Cheers,

Andy.
acollins22 is offline  
Closed Thread

Thread Tools



All times are GMT +1. The time now is 5:49 pm.


All information and advice on this forum is subject to the WARNING AND DISCLAIMER located at https://www.vintage-radio.net/rules.html.
Failure to heed this warning may result in death or serious injury to yourself and/or others.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright ©2002 - 2023, Paul Stenning.