462 | | CALL PRINT | ; PRINT IT |
463 | | INC IY | ; NEXT CHARACTER |
464 | | DJNZ PRLIN1 | ; LOOP FOR 16 CHARACTERS |
465 | | CALL GAP | ; PRINT 4 SPACES |
466 | | LD B, 16 | ; NOW DO 16 ASCII CHARACTERS |
467 | | LD IY, LINBUF | ; START OF BUFFER |
468 | PRLIN2 | LD A, (IY) | ; GET CHARACTER |
469 | | CP 20H | ; IS IT A CONTROL CHAR.? |
470 | | JP M, DOT | ; IF SO, PRINT A DOT |
471 | | CP 7BH | ; IS IT GREATER THAN z? |
472 | | JP P, DOT | ; IF SO, PRINT A DOT |
473 | | JR DOT1 | |
474 | DOT | LD A, "." | |
475 | DOT1 | CALL PRINT | ; PRINT IT |
476 | | INC IY | ; NEXT CHARACTER |
477 | | DJNZ PRLIN2 | ; LOOP UNTIL 16 DONE |
478 | | LD A, CR | ; PRINT CARRIAGE RETURN |
479 | | CALL PRINT | |
480 | | LD A, LF | ; AND LINE FEED |
481 | | CALL PRINT | |
482 | | RET | |
483 | ; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
486 | ; ROUTINE TO O/P CHARACTER TO PRINTER |
487 | ; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
488 | PRINT | PUSH AF | ; SAVE CHARACTER |
489 | PR1 | IN A, (HSHAKE) | ; HANDSHAKE, BIT 7 PORT 0 |
490 | | AND 80H | |
491 | | JR Z, PR1 | |
491 | | POP AF | ; RECOVER CHARACTER |
492 | | DEFB SCAL, SRLX | ; NAS-SYS SERIAL O/P |
493 | | RET | |
494 | ; * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
496 | ; SUBROUTINE FOR 4 SPACE GAP |
497 | ; * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
498 | GAP | LD B, 4 | ; NUMBER OF SPACES |
499 | | LD A, 20H | ; SPACE CHARACTER |
500 | GAP1 | CALL PRINT | ; PRINT |
501 | | DJNZ GAP1 | ; LOOP UNTIL DONE |
502 | | RET | |
503 | ; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
504 | ; PRINT HEX CDE AS TWO ASCII CHARS. |
505 | ; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
506 | PRTHEX | PUSH AF | ; SAVE CHARACTER |
507 | | AND 0F0H | ; GET TOP 4 BITS |
508 | | RRCA | ; SHIFT TO BOTTOM 4 BITS |
509 | | RRCA | |
510 | | RRCA | |
511 | | RRCA | |
512 | | CP 0AH | ; IS IT MORE THAN 10 |
513 | | JP P, ADD37A | ; IF SO, JUMP |
514 | | ADD A, 30H | ; CONVERT TO ASCII 0 – 9 |
515 | PRTH1 | CALL PRINT | ; PRINT IT |
516 | | POP AF | ; RECOVER CHARACTER |
517 | | AND 0FH | ; GET BOTTOM 4 BITS |
518 | | CP 0AH | ; MORE THAN 10? |
519 | | JP P, ADD37B | ; IF SO, JUMP |
520 | | ADD A, 30H | ; CONVERT TO ASCII 0 – 9 |
521 | PRTH2 | CALL PRINT | ; PRINT IT |