From 0be63b75c29306ecf70eb8024a6a3b1711f4a225 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sun, 7 Feb 2021 22:42:33 -0800 Subject: [PATCH] 7697 --- baremetal/501draw-text.mu | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/baremetal/501draw-text.mu b/baremetal/501draw-text.mu index 0d0d1ce8..395aff0b 100644 --- a/baremetal/501draw-text.mu +++ b/baremetal/501draw-text.mu @@ -17,11 +17,12 @@ fn cursor-right screen: (addr screen) { var _width/eax: int <- copy 0 var dummy/ecx: int <- copy 0 _width, dummy <- screen-size screen - var width/edx: int <- copy _width + var limit/edx: int <- copy _width + limit <- decrement var cursor-x/eax: int <- copy 0 var cursor-y/ecx: int <- copy 0 cursor-x, cursor-y <- cursor-position screen - compare cursor-x, width + compare cursor-x, limit { break-if-< return @@ -47,11 +48,12 @@ fn cursor-down screen: (addr screen) { var dummy/eax: int <- copy 0 var _height/ecx: int <- copy 0 dummy, _height <- screen-size screen - var height/edx: int <- copy _height + var limit/edx: int <- copy _height + limit <- decrement var cursor-x/eax: int <- copy 0 var cursor-y/ecx: int <- copy 0 cursor-x, cursor-y <- cursor-position screen - compare cursor-y, height + compare cursor-y, limit { break-if-< return