This is the source of a FASM file containing one font blitting routine I made. The idea is to assemble this source and then link the routine together with a FreeBasic program I made. Some time ago, I wrote this routine in 32bit code with the FreeBasic inline assembly and it was working just fine. I can't do the same thing in 64bit, because of some problem between FreeBasic and GAS, so I rewrote the routine for 64bit using Flat Assembler. Anyway, when I trying to FASM it, I get:
Ha, ha! Found it! I thought "dp" was the size of a pointer, that is, either 32 or 64 bit depending on the architecture, but it's 48 bit (16 bit for a segment and 32 bit for a 32 bit offset). I replaced it with dq and it works fine, except that there's a one pixel offset I still don't know why, but I guess I'm about to figure out. Anyway, comments are appreciated!
SeproMan. If I just say "thank you", you won't get the idea of how much I appreciate your comments.
Before I came back here, I did figure out that I was moving a whole quad instead of the 32 bits of colour data, which caused the last pixel to show up as a vertical line to the right of my characters. I had made this error because, as I said before, I translated this routine from one I had made for 32 bits before, so I instinctively changed all 32bit regs to 64bit regs. I do see how significant it is that you have noticed this error quickly too, considering that you're not seeing my program running and that this is the very first time you read my code!
About optimisations, while it's true that today's computers are really fast and have tons of memory and disk space and small changes are probably come unnoticed on these systems, I will be glad to implement these. Having to rely on a high level language most of the time is not something I enjoy and I long for the times when we had to be careful about our use of resources, because that made us better programmers. I want to continue to practise that, whether it will be noticed or not. By the way, I'd like to program for some more low-level platform than the PC.... I'll write another post on that. Cheers, mate!
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum