Let's figure out what instructions we need. I'll start vague, and we can get more specific as we decide what's important and what's not.
- Load immediate - Add - Subtract - Shift - Read memory - Write memory - AND - OR - XOR - move - unconditional branch - conditional branch I think the conditional branch need only be based on whether the last result was zero or nonzero. Here's a little more specific pseudocode for doing the character translation: ; We've already read a character and its color data ; Char is in R0, color is in R1 ; Also, we've already computed the address of the upper left pixel in R5 Load immediate 0x80 into R2 R2 = R2 & R1 ; insert code to deal with blink-off case Load immediate 0x0f into R2 R2 = R2 & R1 R2 = R2 + color table base address R2 = memory[R2] ; R2 now has foreground color Load immediate 0x70 into R3 R3 = R3 & R1 right shift R3 by 4 R3 = R3 + color table base address R3 = memory[R3] ; R3 now has background color R0 = R0 << 4; R0 = R0 + font base address ; now, we render the character outer char loop: R1 = memory[R0] R0++ inner char loop: R4 = R1 R1 = R1 >> 1 R4 = R4 & 1 ; if (R4), R4 = R2; else R4 = R3 memory[R5] = R4 R5++ ; continue with inner char loop R5 = R5 + (line length - 8) ; continue with outer char loop ; go back to top and get next char You get the idea. _______________________________________________ Open-graphics mailing list [email protected] http://lists.duskglow.com/mailman/listinfo/open-graphics List service provided by Duskglow Consulting, LLC (www.duskglow.com)
