![]() |
ZX Assembler Inline Basic - Printable Version +- Forum (https://www.boriel.com/forum) +-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11) +---- Forum: How-To & Tutorials (https://www.boriel.com/forum/forumdisplay.php?fid=13) +---- Thread: ZX Assembler Inline Basic (/showthread.php?tid=171) |
ZX Assembler Inline Basic - britlion - 03-04-2010 ZXB allows you to do stuff that's pretty crazy. I had a fancy cls routine - that didn't actually clear the screen, just ran a attribute bar over the screen, and then of course you do a CLS from basic afterwards. The effect is the same, but it looks cool. It wouldn't compile right - the call to the ZX ROM sound routine kept corrupting things. Probably messing with IX and IY registers in naughty ways. Then it occurred to me.... just compile a beep into the middle. :-) Look: Code: sub clearscreen() How beautiful is that? So long as I stack the registers I need (in this case DE), I can find them again when I come back. In a way, it's inline basic in the middle of assembler :-) Anyway, that's my silliness for the day. Also: This makes for a nice clear screen subroutine. Change the bar colour and the final colour where indicated (and remember, ink and paper should be the same, so it does 'clear' it by hiding any characters on the screen until the CLS. It's also pretty easy to change the sound (or remove it altogether - but you need something there to slow it down, or you don't see the effect. A busy loop or a pause would work too). |