80-Bus News

  

July–October 1982, Volume 1, Issue 3











Page 39 of 51











39

OUT (CENPAC),A bit 1 is the STROBE (output), the rest are inputs

3 LD A, OFFH ; Tell port B it will use the bidirectional/control mode OUT (CENPBC),A XOR A 3; Send the mask to say which bits are in and which are out OUT (CENPBC),A 3; all bits are set to output. RET 3; Exit from the initialization routine.

So the ports have been set up. The U command in NAS-SYS, or the LST vector in RP/M should be set to point to the output routine, and study of the manuals should reveal what is required to be done. Like the serial routine the first thing that happens is that the character to be printed is PUSHed on the stack whilst the BUSY line is examined until it is free. The character is then POPped back and sent to the data port. Bit one is then toggled to cause a strobe pulse thus latching the data into the printer.

PUSH AF ; Push the character out of the way

; Examine the BUSY line until free

LOOP: IN A, (CENPAD) ; Get port A into the accumulator RRA 3; Rotate the byte, shifting bit O into the Carry JR C,LOOP ; If the C flag is now set, the printer is BUSY

s The printer is now free, send the character

POP AF ; Get the character back

PUSH AF ; Save it from being corrupted by the strobe pulse OUT (CENPBD),A ; Send the byte to the printer

NOP 3; Wait for the data to settle

LD A,0FH 3; Send a strobe pulse by toggling bit 1 OUT (CENPAD),A

NOP 3; Wait for the strobe pulse to settle LD A, OFFH ; Take the strobe pulse away again

OUT (CENPAD),a

POP AF 3; Get the character back

RET 3; Exit from the routine

And that is all there is to it. Of course, there will be problems with both the serial and the parallel routines, but ‘thinking down’ to the bit level where it is all happening will help. I can offer little practical advise at this stage. Playing around with software is fun, and if you don’t have a glimmer of insight after all I’ve written, I’m afraid you will be forever doomed to high level languages and their restrictions. Playing at the very heart of the machine is my idea of fun. But of course it requires a thorough working knowledge of both the hardware and the affects of the software.

In drawing this series to an end, I like to think I’ve helped someone along the way. I know what I have written is incomplete and inaccurate in places but that is probably not so important as the overview of systems I have presented. To encapsulate all that should be written on the subject would require several very fat books, and falls into the province of the professional writer. Unfortunately the most prolific writers do not necessarily have a deep understanding of what it is they are trying to convey. They are quite adapt at disguising this fact, usually with jargon, and the indadequacies of this sort of book is often overlooked. There is nothing to beat hands on experience.

Thank you for reading this series I hope you found it useful. D. R. Hunt.


This is an OCR’d version of the scanned page and likely contains recognition errors.











Page 39 of 51