;---------------------------------------------------------------- ; This is a module for PL/I-80 ; ; This module allows you to read and write directly to ; system ports. ; ; INPUT from a port. ; ; EXAMPLE: ; temp = portin('88'b4); /* read a port, temp bit(8) */ ; ;---------------------------------------------------------------- ; name 'port' public portin,portout extrn getp1 ; maclib z80 ; portin: call getp1 mov c,e ; load port number from E inp a mov h,a ; copy to H, top bits ret ; ;---------------------------------------------------------------- ; Output to a port ; ; EXAMPLE: ; call portout('88'b4,'55'b4); /* send a 'U' to port 88 h */ ; ;---------------------------------------------------------------- ; portout: call getp1 ; port number mov c,e ; get value now mov a,m ; Get data outp a ret end