Jump to content

Hello world/Line printer: Difference between revisions

Line 284:
\ memory mapped I/O addresses for the printer port
HEX
B02E CONSTANTconstant SCSRscsr \ serial control status register
B02F CONSTANTconstant SCDRscdr \ serial control data register
DECIMAL
 
: printer-emit ( char -- ) \ output 'char' to the printer serial port
BEGINbegin SCSRscsr C@ 80 ANDand UNTILuntil \ loop until the port shows a ready bit
SCDRscdr C! \ C! (char store) writes a byte to an address
20 ms ; \ delay to prevent over-runs
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.