浏览代码

found that bug causing floatingpoint error

Phil 4 年之前
父节点
当前提交
e8b230df4e
共有 1 个文件被更改,包括 11 次插入5 次删除
  1. 11 5
      dino.asm

+ 11 - 5
dino.asm

@@ -13,6 +13,8 @@ section .bss
 	srow resb 1;
 	scol resb 1;
 
+	tmp resb 4
+
 section .data
 	;num to ascii variables
 	ha db 0 ;hundreds
@@ -97,12 +99,16 @@ _start:
 
 	;calc offset
 	;top	
+	xor eax, eax
+	xor bl, bl
 	mov ax, [srow]
-	sub ax, [gh]		;rows - geameheight
-	mov cl, [0x2]
-	div cl
-	mov [tof], al
-;
+	and ax, 0x0F		; bitmask so that only srow (1byte) is inside ax (2byte) else it is scol+srow
+	;sub ax, [gh]		;screenrows - geameheight
+	mov bl, 2
+	div bl
+	;mov [tof], al
+	jmp exit
+
 	;left
 	mov ax, [scol]
 	sub ax, [gw]