Quellcode durchsuchen

able to print to

Phil vor 5 Jahren
Ursprung
Commit
782d138d92
1 geänderte Dateien mit 57 neuen und 12 gelöschten Zeilen
  1. 57 12
      dino.asm

+ 57 - 12
dino.asm

@@ -21,11 +21,12 @@ section .data
 	gw db 102;	; game width
 	scrst db 'Score: 000'	; score string
 	scrstln equ $ - scrst	; sore string length
-	tlc db 0xda		; top left corner
-	trc db 0xbf		; top right corner
-	llc db 0xd9		; lower left corner
-	lrc db 0xbe		; lower right corner
-
+	scrlof equ 5		;score lfet offset
+	scrfll equ 85		;score lfet offset
+	pls db 0x2b		;plus for corner
+	hl db 0x2d		;horizontal line |
+	vl db 0x7c		;vertical line -
+	
 	
 section .text
 	global _start
@@ -51,14 +52,16 @@ _start:
 	;calc offset
 	;top	
 	mov ax, [srow]
-	sub ax, gh
-	div 2
+	sub ax, [gh]
+	mov cl, [0x2]
+	div cl
 	mov [tof], al
 
 	;left
 	mov ax, [scol]
-	sub ax, gh
-	div 2
+	sub ax, [gw]
+	mov bl, 0x2
+	div bl
 	mov [lof], al
 
 	;print terminal
@@ -77,17 +80,59 @@ topoffset:
 	jl topoffset
 
 toprow:	 
+tlcorner:
+	mov eax, SYS_WRITE
+	mov ebx, STDOUT
+	mov ecx, pls
+	mov edx, 1
+	int 0x80
+
+tr_start:
 	mov eax, SYS_WRITE
 	mov ebx, STDOUT
-	mov ecx,  
+	mov ecx, hl
 	mov edx, 1
 	int 0x80
 
 	inc byte [rcount]
 	mov al, [rcount]
-	cmp al, [tof]
-	jl toprow
+	cmp al, scrlof
+	jl tr_start
+	mov al, 0
+	mov [rcount], al
 	
+tr_score:
+	mov eax, SYS_WRITE
+	mov ebx, STDOUT
+	mov ecx, scrst
+	mov edx, scrstln
+	int 0x80
+
+tr_fill:
+	mov eax, SYS_WRITE
+	mov ebx, STDOUT
+	mov ecx, hl
+	mov edx, 1
+	int 0x80
+
+	inc byte [rcount]
+	mov al, [rcount]
+	cmp al, scrfll
+	jl tr_fill
+
+trcorner:
+	mov eax, SYS_WRITE
+	mov ebx, STDOUT
+	mov ecx, pls 
+	mov edx, 1
+	int 0x80
+
+linebreak:
+	mov eax, SYS_WRITE
+	mov ebx, STDOUT
+	mov ecx, lb 
+	mov edx, 1
+	int 0x80
 
 exit:
 	;exit