Assembler Interrupt Examples Wanted
Bruce Smith (1838) 31 posts |
I am currently working on the second book in Assembly Language Programming on the Raspberry Pi, viz Advanced (www.brucesmith.info for more details). These books have a distinct RISC OS flavour although the Advanced volume will push the boat out a bit further. I am looking for some good program examples on the use of interrupts (as many flavours as possible) under RISC OS on the RPi. Ideally I would like examples that are illustrative (to get the point across) and some that are more practical in conception. Just wonder if anyone has one or more of the above that I could consider for use in the book? All would be acknowledged of course and there may be the opportunity to contribute more on further discussion. By definition the examples would need to be in BBC BASIC Assembler. |
Martin Bazley (331) 379 posts |
I have an interrupt-driven music player, which is an interesting curiosity but not all that much use without the relevant music files. |
Tim Rowledge (1742) 170 posts |
For a larger but still understandable example, consider the SharedSoundBuffer/StreamManager modules that John Duffel wrote. Once you’ve explained a basic set of rules and techniques a substantial working example is a great way to build something that works. Making noises is always popular. I used John’s code to provide general sound output for Squeak but an example app that can load some form of sound file and play it. or even generate simple tones and play them, shouldn’t be too hard. Generating tones has the virtue of not needing any file-reading code or indeed, files. Any of the skilled BASIC programmers hanging around here would be able to make a simple WIMP app that has a few buttons to start, stop, pick a tone, that passes the data to theSSB and responds to interrupts to refill buffers. If I can get it to work in C, they can do it. |
Bruce Smith (1838) 31 posts |
Martin: Interesting as you say. Does it accept MP3 files (or similar) – most people have these? Would be possible to create some ‘sound’ files using SOUND/VOICE commands? Tim: As you say, making noise captures peoples attention. I will have a look into your suggestion. Meanwhile if anyone has written something similar to the WIMP App you suggest I would be very interested |
Rebecca (1663) 107 posts |
I bought the first book. It’s very good. |
Craig Bamford (1950) 1 post |
I have written sound code that works directly with the hardware on the pi, it written to run bare metal, but by using OS_Memory to map the address, it would run on riscos, with very little modding. |
Bruce Smith (1838) 31 posts |
Thank you Rebecca – would be great and I would appreciate it, if you could write a review on Amazon :-) |
Bruce Smith (1838) 31 posts |
Craig: I would be interested to see both versions if that is possible. I would like to include a chunk of hardware specific coding both in RISC OS and bare metal. email: (email [at] brucesmith [dot] info) or via www.brucesmith.info |
Martin Bazley (331) 379 posts |
No, it does not, with particular emphasis on the (or similar) part. I don’t think the format’s editor has survived either. Like I said, it isn’t very useful. |