;---------------------------------------------------------------------- ; Print the Current Line (18_Sept_84) ;------------------------------------ ; 1) This routine prints a line. The line format is the same as ; a Bdos console input routine, that is, one byte that's the ; maximum line length, followed by one byte that's the current ; line length followed by the line. ; 2) The Unused part of the line is printed as blanks ; 3) Register Usage: ; BC -> Used to hold the Max and Crnt line lengths ; HL -> Enter Pointing to the Start of the Line Structure ; Print_Line: ld c,(hl) ;C:= Maximum Line Length inc hl ;HL:= Pointer to Current Line Length ld a,(hl) ;If (Line Length is 0) or a ret z ; Return ld b,a ;B:= Current Line Length push bc inc hl ;HL:= Pointer to 1st char of Line PlLp1: push hl ;Repeat push bc ld c,(hl) ; C:= Current Character call System_ConOut ; Print the Character pop bc pop hl inc hl ; Increment Line Pointer djnz PlLp1 ;Until (Line Length - 1 eq 0) pop bc ;B:= Current Line Length ld a,c ;A:= Maximum Line Length sub b ;If (We're Not at the end of the line) jr z,PlSk1 PlLp2: ld c,' ' ; Repeat C:= Space push bc call System_ConOut ; Print a Space pop bc djnz PlLp2 ; Until (Count - 1 eq 0) PlSk1: ld c,Cr call System_ConOut ;Return Cursor to Start of Line ld a,(Current_Cursor) ;If (Cursor's at the start of the line) or a ret z ; Return ld b,a ;Else B:= Cursor offset PlLp3: push bc ; Repeat ld c,Cursor_Right ; C:= Move Cursor Rel. Right call System_ConOut ; Move Cursor pop bc djnz PlLp3 ; Until (Count - 1 eq 0) ret ; Return page