-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCOS_WAVE.asm
73 lines (58 loc) · 1.29 KB
/
COS_WAVE.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
;working
.model small
.stack 100
.data
msg db 10,13,'this is cos wave$'
x dd 0.0
xad dd 5.0
one80 dd 180.0
thirty dd 30.0
fifty dd 50.0
;row db 00
;col db 00
;xcursor dd 00
ycursor dt 00
count dw 360
x1 dw 0
.code
.386
main: mov ax,@data
mov ds,ax
mov ah,00 ;set video mode
mov al,6
int 10h
up1:finit
fldpi
fdiv one80
fmul x
fcos
fld thirty
fmul
fld fifty
fsub st,st(1) ;=100-60 sin((pi/180))*x
fbstp ycursor
;lea esi,ycursor
mov si,offset ycursor
mov ah,0ch ;write graphics pixel
mov al,01h
mov bh,0h
mov cx,x1
mov dx,[si]
int 10h
inc x1
fld x
fadd xad
fst x
dec count
jnz up1
mov ah,09h ; display message
lea dx,msg
int 21h
;mount c dire
;c:
;tasm filename.asm
;tlink filename
;filename
mov ah,4ch
int 21h
end main