Go to advanced search

by BMardle
Sat Aug 25, 2018 4:08 pm
Forum: Troubleshooting
Topic: lxterm unreadable after upgrading Jessie to Stretch
Replies: 1
Views: 71

Re: lxterm unreadable after upgrading Jessie to Stretch

Oh... Emacs looks the same as it did under Jessie, if that helps narrow things down.
by BMardle
Sat Aug 25, 2018 4:07 pm
Forum: Troubleshooting
Topic: lxterm unreadable after upgrading Jessie to Stretch
Replies: 1
Views: 71

lxterm unreadable after upgrading Jessie to Stretch

Hi, everyone. I recently upgrading from Jessie to Stretch on my Pi 2. Now I can't read what lxterm says. At first I thought it was displaying text in a constant grey on a white background. After zooming in, I can see that it's using lots of different shades of grey and even the occasional black pixe...
by BMardle
Fri May 11, 2018 5:16 pm
Forum: C/C++
Topic: CPU load on computer
Replies: 9
Views: 1923

Re: CPU load on computer

Very useful thread! I'm trying much the same thing (displaying processor load on an LED bargraph). At the moment I'm reading /proc/stat once a second and displaying the change in (system time + user time)/CLK_TCK. I'm not sure that's actually right... but it does seem to bear some resemblance to wha...
by BMardle
Wed Feb 28, 2018 1:15 pm
Forum: The MagPi
Topic: MagPi67: Pi in Spectrum case: diodes on 'address' lines
Replies: 9
Views: 1817

Re: MagPi67: Pi in Spectrum case: diodes on 'address' lines

The diodes are needed, as noted, if the rows are always driven high and low, are a necessity to avoid damage, and I think that's why they are there. Looking at the source code will show how the author implemented their scan routine, whether it mandates diodes or not. Indeed. My first paying job was...
by BMardle
Mon Feb 26, 2018 9:26 am
Forum: The MagPi
Topic: MagPi67: Pi in Spectrum case: diodes on 'address' lines
Replies: 9
Views: 1817

Re: MagPi67: Pi in Spectrum case: diodes on 'address' lines

Although... with the keyboard plugged in, if you press 2 keys on the same address line at the same time, that shorts together 2 of the 'data' GPIOs. So, by the same logic, you should have diodes on those lines too ;)
by BMardle
Mon Feb 26, 2018 9:04 am
Forum: The MagPi
Topic: MagPi67: Pi in Spectrum case: diodes on 'address' lines
Replies: 9
Views: 1817

Re: MagPi67: Pi in Spectrum case: diodes on 'address' lines

PiGraham wrote:
Mon Feb 26, 2018 7:59 am
The diodes are not essential but they seem to me to be a reasonable safety measure.
OK. You've convinced me. :D
by BMardle
Sun Feb 25, 2018 9:57 pm
Forum: The MagPi
Topic: MagPi67: Pi in Spectrum case: diodes on 'address' lines
Replies: 9
Views: 1817

Re: MagPi67: Pi in Spectrum case: diodes on 'address' lines

Are the diodes you mention a legacy of the Spectrum or part of the Pi interface? Part of the Pi interface. Effectively they're converting totem-pole outputs to open-drain ones... but you can effectively program the GPIOs to be open-drain outputs. Admittedly, adding the diode removes the possibility...
by BMardle
Sun Feb 25, 2018 6:44 pm
Forum: The MagPi
Topic: MagPi67: Pi in Spectrum case: diodes on 'address' lines
Replies: 9
Views: 1817

MagPi67: Pi in Spectrum case: diodes on 'address' lines

Hi, all. The project in MagPi 67 to put a Pi in a ZX Spectrum case sounds fun. (Unfortunately, the keyboard is the only part of my venerable Speccy that doesn't work; though my Interface 1 is duff too :roll: ) I'm a little baffled as to why there are diodes on the 'address' lines connected to the ke...
by BMardle
Wed Feb 14, 2018 12:42 pm
Forum: Troubleshooting
Topic: Synaptic Package Manager - no background
Replies: 4
Views: 820

Re: Synaptic Package Manager - no background

Ah-ha! Problem solved. I've give y'all the long version, since I'm not sure which bits of my solution are necessary. I went to Start menu -> Preferences -> Appearance Settings -> Menu Bar, changed the foreground colour to red, clicked 'OK'. Nothing happened. Clicked 'Defaults'. Again, nothing seemed...
by BMardle
Sun Feb 11, 2018 5:42 pm
Forum: Troubleshooting
Topic: Synaptic Package Manager - no background
Replies: 4
Views: 820

Re: Synaptic Package Manager - no background

I've got the same(?) problem as Mojorizing. Tried deleting /root/.synaptic and rebooting. The only noticeable effect was to change the size of the synaptic window. The colours were the same (barely useable). Any other suggestions apart from re-installing the OS? (For what it's worth, some of the thi...
by BMardle
Sat Oct 07, 2017 3:04 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: GY-521 I2C not detected on Pi
Replies: 15
Views: 3471

Re: GY-521 I2C not detected on Pi

It's a combination of luck and tolerances. The Slice of PI/O has a jumper that selects 3.3V or 5V for its MCP23017's Vdd, and the I2C lines are connected straight to the Pi's. Oh, well. There must be a lot of luck about :D My PIC is now running off 3.3V (despite being connected to a 5V LCD, which s...
by BMardle
Wed Oct 04, 2017 6:45 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: GY-521 I2C not detected on Pi
Replies: 15
Views: 3471

Re: GY-521 I2C not detected on Pi

So why do my MCP23017s running with Vcc @ 5V work OK? That's a good question, since the MCP23017 data sheet says SCL and SDA in, high, has to be at least 0.8*Vdd! I use a couple of them at 5V in a memory-programmer connected to my Pi 1B. (I'm planning to get my Pi Zero talking to a PIC soon. I know...
by BMardle
Fri Aug 11, 2017 10:47 am
Forum: Off topic discussion
Topic: armsvc.exe :-)
Replies: 4
Views: 1224

Re: armsvc.exe :-)

rpiboy wrote:
Fri Aug 11, 2017 1:24 am
It's a virus. :shock:
https://forums.adobe.com/thread/2311615
I think that page says AVG was erroneously claiming it as a virus.
by BMardle
Thu Aug 10, 2017 1:24 pm
Forum: Off topic discussion
Topic: armsvc.exe :-)
Replies: 4
Views: 1224

armsvc.exe :-)

Just spotted a program called 'armsvc' running on this Windows 7 PC.
It sounds like something that should be on the Pi!
:D
by BMardle
Sat Aug 05, 2017 1:17 pm
Forum: Other programming languages
Topic: Register allocation (assembly language)
Replies: 32
Views: 5388

Language features

BMardle, while (({int i; scanf("%d", &i) && i!=42;})); : Could someone please tell me what possible use nested functions are in C? : I was just pondering this further. Strangely enough, compound expressions containing declarations (and/or void statements) and local functions would both be ways of s...
by BMardle
Sat Aug 05, 2017 9:00 am
Forum: Other programming languages
Topic: Register allocation (assembly language)
Replies: 32
Views: 5388

Language features

BMardle, while (({int i; scanf("%d", &i) && i!=42;})); What you say may be useful. But most places I have worked would fire you if you insisted on writing such inscrutable code. It's hard for humans to parse and it's unnecessary. I think it's largely a matter of what you're used to. Algol 68 doesn'...
by BMardle
Fri Aug 04, 2017 10:35 pm
Forum: Other programming languages
Topic: Register allocation (assembly language)
Replies: 32
Views: 5388

Re: Shortcomings of C

An old friend of mine used to code in BCPL. He said he wrote a program which called `random` a lot but, having programmed a lot in Algol68, he'd forgotten that you have to put '()' after the name of a parameterless procedure to call it. Figuring he'd consistently got it wrong he did a global replace...
by BMardle
Fri Aug 04, 2017 9:05 pm
Forum: Other programming languages
Topic: Register allocation (assembly language)
Replies: 32
Views: 5388

Shortcomings of C

<ramble> I was browsing through the gcc documentation recently and found that gcc had an extension that addresses another thing I regard as a shortcoming of C: the lack of compound expressions containing declarations. E.G., in gcc you can write while (({int i; scanf("%d", &i) && i!=42;})); which wil...
by BMardle
Fri Aug 04, 2017 8:31 pm
Forum: Other programming languages
Topic: Register allocation (assembly language)
Replies: 32
Views: 5388

Re: Register allocation (assembly language)

A basic block is a set of instructions such that if 1 is executed then all are. Pretty easy to generate: The first instruction is the start of a basic block. Any labelled instruction is the start of a basic block (preferably a label that's actually used!) A branch is the end of a basic block. Thanks...
by BMardle
Fri Aug 04, 2017 2:32 pm
Forum: Other programming languages
Topic: Register allocation (assembly language)
Replies: 32
Views: 5388

Re: Register allocation (assembly language)

Thanks for the replies, timrowledge and jahboater. I can well believe it took 20 years to write the register allocator for GCC. I suspect it'd take me 20 years to understand it too! I've got 4 books on compiler constructions on my shelves, but I don't think any of them is less than 20 or 30 years ol...
by BMardle
Thu Aug 03, 2017 7:32 am
Forum: Other programming languages
Topic: Register allocation (assembly language)
Replies: 32
Views: 5388

Re: Register allocation (assembly language)

Are you interested in performance? If so you also need to worry about avoiding dependencies and allowing multiple issue and so on. Some ARM cpu's with out-of-order execution can deal with dependencies to a degree, but the Pi cpu's are low power, or old designs, so cannot. Moderately intersted! As l...
by BMardle
Wed Aug 02, 2017 5:52 pm
Forum: Other programming languages
Topic: Register allocation (assembly language)
Replies: 32
Views: 5388

Re: Register allocation (assembly language)

PS: Thanks for not trying to talk me out of it, Paeryn!
by BMardle
Wed Aug 02, 2017 5:45 pm
Forum: Other programming languages
Topic: Register allocation (assembly language)
Replies: 32
Views: 5388

Re: Register allocation (assembly language)

It gets easier as you get used to it, you can always sprinkle comments in your code to remind you what you moved into which register (and what offsets from the stack you use for local variables when you run out of free registers). Well, I'm writing a C program that generates the assembler, so I'm n...
by BMardle
Wed Aug 02, 2017 5:24 pm
Forum: Other programming languages
Topic: Register allocation (assembly language)
Replies: 32
Views: 5388

Re: Register allocation (assembly language)

You need to understand which variables are volatile and which are not. You didn't provide any context, so my answer doesn't make sense to you. If you're working with nested calls, then register allocation becomes more complicated. Are you calling C functions from asm code? Are you calling someone e...
by BMardle
Wed Aug 02, 2017 5:08 pm
Forum: Other programming languages
Topic: Register allocation (assembly language)
Replies: 32
Views: 5388

Re: Register allocation (assembly language)

Part of the 'art' of writing assembly language is making those choices. I choose a register for each variable in my algorithm starting with r0-r3. Hmm, but the first BL to, say, a libc function can potentionally stomp on all of R0-R3, in which case wouldn't it have been better to allocate any varia...

Go to advanced search