[Coco] Assembler question

Robert Gault robert.gault at att.net
Sun Aug 28 09:01:41 EDT 2011


Helio Emery Jr. wrote:
>
> Hey guys, me again.
>
> In the process of re-learning OS9 L1, I was abble to create some graphics programs in C that works quite well.
> And them I moved to try recreating the same programs in Assembler, just for fun.
>
> While in C I learned that, to change OS9 to graphics screen is just a matter of sending some characters to the terminal screen (more preciselly the Hex codes 0F 00 00).
> But there is a trick, the STDOUT is buffered, so one should call the function fflush() to actually change the screen to graphics mode.
> In Assembler I don't know how to do this...
> I've read all the technical manuals I could get my hands on, but none of them is of much help.
> I've tryied to sent the characters to STDERR (path number 2) instead, but no go.
>
> Anyone knows how to flush the stdout in Assembly, or any other way to change to graphics in OS9?
>
> Thanks,
> Helio 		 	   		
>

First, it is not necessary to use fflush in all cases. I've written graphic 
routines in C that don't require that. It probably depends on the method used to 
create, map, and write to the graphic screen.
Second, assembly and C programs are very different animals. You probably will 
not want to convert a C program to assembly if what you mean by that is an exact 
duplicate. There are much more efficient ways to write assembly programs and you 
can take complete control of the system. STDOUT could be buffered in C but when 
using assembly, you don't need nor have a buffer unless you created one.

Actually you need to be more specific with your question. What is your Coco, a 
1, 2, or 3? What type of graphics screen do you want to use? Post the code you 
are trying to use to mimic the OS-9 command
display 0f 00 0f
if that is the screen and color set you wanted.

Personally, I would just take direct control of the hardware after turning off 
interrupts. You can restart OS-9 after you program is finished.




More information about the Coco mailing list