From a6cf05c1ff6b3b4ab1bb37c732875e8e54e60583 Mon Sep 17 00:00:00 2001 From: shikhin Date: Sun, 19 Mar 2023 16:02:49 +0530 Subject: [PATCH] Minor optimizations in drawing rects --- ponydos.asm | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/ponydos.asm b/ponydos.asm index 269a168..4a9c574 100644 --- a/ponydos.asm +++ b/ponydos.asm @@ -156,26 +156,20 @@ draw_rect: shl cx, 1 .loop: - ; Any rows left to copy? - cmp dx, 0 - je .end - dec dx - ; Copy a row - push cx + pusha rep movsb - pop cx + popa ; Move to the next row in the input buffer add si, bx - sub si, cx ; Move to the next row in the screen buffer add di, 2*COLUMNS - sub di, cx - jmp .loop - .end: + dec dx + ; Any rows left to copy? + jnz .loop pop es popa