瀏覽代碼

why did i call print and exit after storing terminal size? oh segfault - i see

Phil 4 年之前
父節點
當前提交
2479943bd7
共有 1 個文件被更改,包括 17 次插入4 次删除
  1. 17 4
      dino.asm

+ 17 - 4
dino.asm

@@ -94,17 +94,15 @@ _start:
 	mov [srow], al
 	mov al, [sz+2]
 	mov [scol], al
-	call print
-	jmp exit
 
 	;calc offset
 	;top	
 	mov ax, [srow]
-	sub ax, [gh]
+	sub ax, [gh]		;rows - geameheight
 	mov cl, [0x2]
 	div cl
 	mov [tof], al
-
+;
 	;left
 	mov ax, [scol]
 	sub ax, [gw]
@@ -115,7 +113,22 @@ _start:
 	;print terminal
 print:
 
+emptyterminal:
+	mov eax, SYS_WRITE
+	mov ebx, STDOUT
+	mov ecx, lb
+	mov edx, 1
+	;int 0x80
+
+	inc byte [rcount]
+	mov al, [rcount]
+	;cmp [srow], al
+	cmp al, [srow]
+	jl emptyterminal
+
 topoffset:
+	mov [rcount], byte 0x0	
+
 	mov eax, SYS_WRITE
 	mov ebx, STDOUT
 	mov ecx, lb