quelles sont les directives en assembleur que purbasic accepte.
je n arrive pas a reserver une zone memoire.
rb 200 , resb 200 ou autre ne sont pas pris en compte.

merci
Code : Tout sélectionner
InitSprite()
InitKeyboard()
InitMouse()
OpenScreen(1024,768, 32, "")
StartDrawing(ScreenOutput())
addecr0 = DrawingBuffer()
StopDrawing()
FlipBuffers()
StartDrawing(ScreenOutput())
addecr1= DrawingBuffer()
StopDrawing()
addecr=addecr1
addd=?dat
addd1=?dat1
x1.f
z.l
coo.l
emp=1 ;amplitude de depart
negampli=-140 ;amplitude inferieur
posampli=140 ;amplitude superieur
decomp=0 ;vitesse
z=0
b=100
prem=0
posi=1
limite =posi*160
pause=1
zoom=10
ris=0
sauvss=0
deb1:
prem=0
x=150
y=500
a=0
x1=-150
y1=-150
effac:
MOV eax,00h
MOV ebx,00h
MOV edx,addecr
MOV ecx,170ffh
eff:
MOV [edx+ebx],eax
MOV [edx+ebx+4],eax
MOV [edx+ebx+8],eax
MOV [edx+ebx+12],eax
MOV [edx+ebx+16],eax
MOV [edx+ebx+20],eax
MOV [edx+ebx+24],eax
MOV [edx+ebx+28],eax
ADD ebx,32
LOOP l_eff
MOV eax,addd
MOV ecx,1500
MOV edx,0ffffffffh
zero1:
MOV [eax],edx
ADD eax,4
LOOP l_zero1
MOV eax,addd1
MOV ecx,1500
MOV edx,0h
zero2:
MOV [eax],edx
ADD eax,4
LOOP l_zero2
JMP l_dessin
top:
MOV eax,y
ADD eax,z
MOV coo,eax
MOV eax,x
ROL eax,2
MOV ris,eax
MOV eax,addd
ADD eax,ris
MOV edx,coo
CMP [eax],edx
JB l_pasaff1
JMP l_affplot0
pasaff1:
MOV eax,addd1
ADD eax,ris
MOV edx,coo
CMP [eax],edx
JA l_pasaff
affplot0:
MOV eax,addd1
ADD eax,ris
MOV edx,coo
CMP [eax],edx
JA l_affplot
MOV [eax],edx
affplot:
MOV eax,x
ROL eax,2
MOV edx,coo
ROL edx,8
ROL edx,4
ADD eax,edx
MOV esi,addecr
ADD esi,eax
MOV eax,000ff00h
MOV [esi],eax
pasaff:
CMP prem,0
JNE l_pasa0
MOV eax,addd1
ADD eax,ris
MOV edx,coo
MOV [eax],edx
pasa0:
MOV eax,addd
ADD eax,ris
MOV edx,coo
CMP [eax],edx
JB l_dessin
MOV [eax],edx
dessin:
x1=x1+0.5
z=((Sin(Sqr((x1*x1)+(y1*y1))/zoom)))*emp
INC x
MOV eax,760
ADD eax,a
CMP x,eax
JLE l_top
MOV b,0
MOV prem,1
MOV x,150
MOV eax,a
ADD eax,posi
MOV a,eax
SUB y,1
x1=-150
ADD y1,2
MOV eax,x
ADD eax,a
MOV x,eax
MOV eax,a
CMP eax,limite
JLE l_dessin
FlipBuffers()
MOV eax,addecr
CMP eax,addecr1
JNE l_flip
MOV eax,addecr0
MOV addecr,eax
JMP l_finflip
flip:
MOV eax,addecr1
MOV addecr,eax
finflip:
stopit:
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Left)
posampli=posampli+1
negampli=negampli-1
emp=emp+1
EndIf
If KeyboardPushed(#PB_Key_Right)
posampli=posampli-1
negampli=negampli+1
emp=emp-1
EndIf
If KeyboardPushed(#PB_Key_Up)
zoom=zoom+1
EndIf
If KeyboardPushed(#PB_Key_Down)
zoom=zoom-1
EndIf
If KeyboardPushed(#PB_Key_Escape)
StopDrawing()
End
EndIf
If KeyboardPushed(#pb_key_a)
Goto stopit
EndIf
Goto deb1
!section '.data' Data readable writeable
dat:
! rd 1500
dat1:
! rd 1500
End
Code : Tout sélectionner
Goto deb1
!section '.data' Data readable writeable
dat:
! rd 2800
dat1:
! rd 2800
Code : Tout sélectionner
InitSprite()
InitKeyboard()
InitMouse()
OpenScreen(1024,768, 32, "")
If StartDrawing(ScreenOutput())
addecr0 = DrawingBuffer()
StopDrawing()
EndIf
FlipBuffers()
If StartDrawing(ScreenOutput())
addecr1= DrawingBuffer()
StopDrawing()
EndIf
soyez indulgentDr. Dri a écrit :Merci les plantages
attention au startdrawing...Code : Tout sélectionner
InitSprite() InitKeyboard() InitMouse() OpenScreen(1024,768, 32, "") If StartDrawing(ScreenOutput()) addecr0 = DrawingBuffer() StopDrawing() EndIf FlipBuffers() If StartDrawing(ScreenOutput()) addecr1= DrawingBuffer() StopDrawing() EndIf
Dri
Code : Tout sélectionner
InitSprite()
InitKeyboard()
InitMouse()
OpenScreen(1024,768, 32, "")
Dim tableau(1500)
Dim tableau2(1500)
x1.f
y1.f
posi.f
a.f
emp=-100 ;amplitude de depart
negampli=-140 ;amplitude inferieur
posampli=140 ;amplitude superieur
decomp=0 ;vitesse
z=0
b=100
prem=0
posi=1
limite =posi*80
pause=1
zoom=200
deb1:
prem=0
x=150
y=500
a=0
x1=-150
y1=-150
emp=emp+decomp
If emp>posampli
decomp=-decomp
EndIf
If emp<negampli
decomp=-decomp
EndIf
For i =1 To 1000
tableau(i)=1000
Next
For i =1 To 1000
tableau2(i)=000
Next
StartDrawing(ScreenOutput())
Goto dessin
top:
If (y+z)>=tableau(x)
If (y+z)<=tableau2(x)
Goto pasaff
EndIf
EndIf
If tableau2(x)<(y+z)
tableau2(x)=(y+z)
EndIf
Plot(x,y+z,RGB(0,255,0))
coox=x
cooy=(y+z)
pasaff:
If prem=0
tableau2(x)=(y+z)
EndIf
If tableau(x)>=(y+z)
tableau(x)=(y+z)
EndIf
dessin:
INC x
x1=x1+0.5
z1=(Cos((Sqr((x1*x1)/zoom+(y1*y1)/zoom))))*emp
z=z1
If x<760+a
Goto top
EndIf
b=0
prem=1
x=150
x1=-150
y1=y1+3.8
a=a+posi
SUB y,2
x=x+a
If a <limite
Goto dessin
EndIf
FlipBuffers()
ClearScreen(0,0,0)
StopDrawing()
stopit:
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Left)
posampli=posampli+1
negampli=negampli-1
emp=emp+1
EndIf
If KeyboardPushed(#PB_Key_Right)
posampli=posampli-1
negampli=negampli+1
emp=emp-1
EndIf
If KeyboardPushed(#PB_Key_Up)
zoom=zoom+1
EndIf
If KeyboardPushed(#PB_Key_Down)
zoom=zoom-1
EndIf
If KeyboardPushed(#PB_Key_Escape)
StopDrawing()
End
EndIf
If KeyboardPushed(#pb_key_a)
Goto stopit
EndIf
Goto deb1
End
Code : Tout sélectionner
[code]
Code : Tout sélectionner
InitSprite()
InitKeyboard()
InitMouse()
OpenScreen(1024, 600, 32, "")
Dim tableau(1500)
Dim tableau2(1500)
x1.f
y1.f
posi.f
a.f
emp = -100 ; amplitude de depart
negampli = -140 ; amplitude inferieur
posampli = 140 ; amplitude superieur
decomp = 0 ; vitesse
z = 0
b = 100
prem = 0
posi = 1
limite = posi * 80
pause = 1
zoom = 200
deb1 :
prem = 0
x = 150
y = 500
a = 0
x1 = -150
y1 = -150
emp = emp + decomp
If emp > posampli
decomp = -decomp
EndIf
If emp < negampli
decomp = -decomp
EndIf
For i = 1 To 1000
tableau(i) = 1000
Next
For i = 1 To 1000
tableau2(i) = 000
Next
StartDrawing(ScreenOutput())
Goto dessin
top :
If (y + z) >= tableau(x)
If (y + z) <= tableau2(x)
Goto pasaff
EndIf
EndIf
If tableau2(x) < (y + z)
tableau2(x) = (y + z)
EndIf
Plot(x, y + z, RGB(0, 255, 0))
coox = x
cooy = (y + z)
pasaff :
If prem = 0
tableau2(x) = (y + z)
EndIf
If tableau(x) >= (y + z)
tableau(x) = (y + z)
EndIf
dessin :
INC x
x1 = x1 + 0.5
z1 = (Cos((Sqr((x1 * x1) / zoom + (y1 * y1) / zoom)))) * emp
z = z1
If x < 760 + a
Goto top
EndIf
b = 0
prem = 1
x = 150
x1 = -150
y1 = y1 + 3.8
a = a + posi
SUB y, 2
x = x + a
If a < limite
Goto dessin
EndIf
StopDrawing()
FlipBuffers()
ClearScreen(RGB(0, 0, 0))
stopit :
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Left)
posampli = posampli + 1
negampli = negampli - 1
emp = emp + 1
EndIf
If KeyboardPushed(#PB_Key_Right)
posampli = posampli - 1
negampli = negampli + 1
emp = emp - 1
EndIf
If KeyboardPushed(#PB_Key_Up)
zoom = zoom + 1
EndIf
If KeyboardPushed(#PB_Key_Down)
zoom = zoom - 1
EndIf
If KeyboardPushed(#PB_Key_Escape)
End
EndIf
Goto deb1