0 Replies - 1062 Views - Last Post: 24 April 2018 - 08:23 AM

#1 Tomer_1998   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 20-April 18

i am trying to understand the random mythed

Posted 24 April 2018 - 08:23 AM

i have a problam in assembly about the random mythed, i tryed to crate a program that picks a random spot on the monitor and puts a "*" there. there were no warnings in dosbox.
IDEAL
MODEL small
STACK 100h
DATASEG
	
	Clock equ es:6Ch
	x db 0
	y db 0
	
CODESEG
proc Clean
	mov cx,25*160
	mov ah,0
	mov al,' '
	mov bx,0
	
CleanLoop:
	mov [es:bx],ax
	add bx,2
	loop CleanLoop
ret
endp Clean
start:
	mov ax, @data
    mov ds, ax
	mov ax,0B800h
	mov es,ax
	
	call Clean
	
	mov ax,40h
	mov es,ax
	mov bx,0
	
	mov ax,[clock]
	mov ah,[byte cs:bx]
	xor al,ah
	and al,01010000b
	mov [y],al
	inc bx
	mov ax,[clock]
	mov ah,[byte cs:bx]
	xor al,ah
	and al,00011001b
	
	mov [x],al
	mov al,[y]
	mul [x]
	add ax,ax
	mov bx,ax
	mov al,'*'
	mov ah,04
	mov[es:bx],ax

exit:
	mov ax, 4c00h
	int 21h
END start



Is This A Good Question/Topic? 0
  • +

Page 1 of 1