M EQU Byte Ptr 0[BX] TITLE 'Output Graphics Line' DGROUP GROUP DATA ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; ; ; GSCAN : SCAN and discard trailing blanks in a output image line, ; ; ; before output the non-blank data bytes to printer ; ; ; for Diablo C150 color printer, 8 dots per data byte ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; Revision : Jan. 12, 1984 File "ZSCANDIA.A86" GSX-86 V1.3 1-0 ; ; ; ; GSCAN (Bytptr, Bytcount) ; ; ; ; Function : SCAN and discard any trailing blanks in an output buffer, ; ; before sending the non-blank data bytes to the printer ; ; ; ; while byte = 0 ; Starting from the last byte ; ; decrement bytptr ; Update byte pointer ; ; byte = byte [bytptr] ; get next byte ; ; decrement byte count ; ; ; end while ; ; call gcode ; Convert byte count to ascii bytes ; ; call genter ; Enter graphics mode ; ; call bytout ; Output image to printer ; ; ; ; Input : XW - No. of bytes per print line ; ; ISTBYT - Address pointer to the first byte ; ; ; ; Output : BWIDE - No. of Non-blank Bytes ; ; ; ; Calls : GCODE - Convert graphics data byte count to ascii bytes ; ; GENTER - Enter graphics mode ; ; BYTOUT - Scan and output image bytes to through LST: device ; ; ; ;----------------------------------------------------------------------------; ; CALL GSCAN ; ISTBYT = Address pointer of first byte in buffer ; XW = No. of Bytes in print line to check ; RET ; PUBLIC GSCAN, BYTOUT Extrn GENTER:near, GCODE:near, POUT:NEAR dseg EXTRN XW:word, BWIDE:word, CCODE:byte, ISTBYT:word cseg GSCAN: ; ISTBYT = first byte address in bitmap to start scanning bit pattern Mov Bx, Word Ptr ISTBYT MOV Ax, Word Ptr XW ; No. of Data bytes per Line ; Initialize byte count and byte pointer ; Start checking from the end of line Add Bx, Ax Inc Ax ; for j = XW to 1 ckloop: Dec Bx ; Next byte Dec Ax ; Decrement byte count Jz nobyte ; byte count = zero, output no data byte Cmp Es:Byte Ptr [Bx], 0 Je ckloop ; AX = byte count Mov Word ptr BWIDE, Ax Call GCODE ; Convert byte count into ASCII bytes Call GENTER ; Graphics Command uses byte count in ; Ascii byte format ; BWIDE = No. of non-blank bytes in this single pixel Print Line MOV Dx, Word Ptr BWIDE ; ISTBYT = first byte address in bitmap to start scanning bit pattern Mov Bx, Word ptr ISTBYT ; for i = 1 to byte count Call BYTOUT ; Output this line nobyte: ; Update address pointer to First byte of next line Mov Bx, Word Ptr XW Sub Word Ptr ISTBYT, Bx RET ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; ; ; BYTOUT : SCAN OUTPUT XW bytes from BITMAP to PRINTER ; ; ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; bytout (nbyt) ; ; ; ; Function : SCAN and OUTPUT XW Bytes from BITMAP to PRINTER ; ; ; ; Mask out PIXL bytes of bit pattern from BITMAP (starting ; ; at NBYT) into graphic byte format befor output to printer ; ; ; ; PIXL = No. of bits printed in each graphic byte ; ; PHILIPS Prints 6 bits per byte ; ; DIABLO Prints 8 bits per byte ; ; for i= 1 to xw ; ; output byte ; ; ; ; Input : NBYT - Starting byte position in BITMAP buffer ; ; ; ;----------------------------------------------------------------------------; ; ; CALL BYTOUT ; Bx = Xw, No. of Bytes to Output ; Dx = NBYT, start address in BITMAP ; RET BYTOUT: PUSH Dx ; Save counters Mov DL,Es:M ; Get next byte from BITMAP Inc BX ; Update Byte Pointer Push Bx Push Es Call Pout ; BDOS List Output function Pop Es Pop Bx POP Dx ; Decrement counter Dec Dx Jnz BYTOUT RET END