[MMT] [HTML 2.0 Checked!]

2.4.7 Instruction Types: Input/Output

[image]

Inputting data from the keyboard and outputting results to the screen are handled by Monitor Systems Calls written in by the programmer. They are made by executing a "trap #11" instruction and a .byte word indicating the call. The full list of system calls can be found in the Flight-68k Users Manual but some of the most useful ones will be looked at in this section.

The call:

		
		trap	#11
		.byte	0,0
has the effect of ending the users program and returns control to the monitor. It is usually at the end of all assembly programs.

There are a number of calls that concern output to the screen:

To input a value, the code used is:
		trap	#11
		.byte	0,19
which reads a string of hex characters into d1.l, inserting any leading zeroes in necessary.The string is stopped after a non-hex character is input or eight characters have been input. The register d2.l holds the number of hex characters input and d0.b holds the non- hex terminating character so information previously held in these registers is lost.

A useful system call is:

		trap	#11
		.byte	0,12
which starts a new line on the screen.
[back][contents]