Hallo, guten Tag.
Wie kann man "invoke LineTo,para1,x,y" in Inline-ASM unterbringen?
Danke.
Gruss
Inline ASM und "invoke LineTo,para1,x,y"
- NicTheQuick
- Ein Admin
- Beiträge: 8837
- Registriert: 29.08.2004 20:20
- Computerausstattung: Ryzen 7 5800X, 64 GB DDR4-3200
Ubuntu 24.04.2 LTS
GeForce RTX 3080 Ti - Wohnort: Saarbrücken
Re: Inline ASM und "invoke LineTo,para1,x,y"
Was erwartest du jetzt von uns? Vielleicht solltest du erst mal erklären, was "invoke LineTo,para1,x,y" sein soll.
Re: Inline ASM und "invoke LineTo,para1,x,y"
Code: Alles auswählen
; ASM: invoke LineTo,para1,x,y
; PB: LineTo_(para1,x,y)
PUSH y
PUSH x
PUSH para1
CALL _LineTo@12 ; LineTo_Kann auch etwa so sein:
Code: Alles auswählen
!PUSH dword [p.y]Schau Dir mal die Commented-Ausgabe von "LineTo_(para1,x,y)" an, oder nimm
es direkt, anstatt das als InlineASM zu machen.
cya,
...Danilo
"Ein Genie besteht zu 10% aus Inspiration und zu 90% aus Transpiration" - Max Planck
...Danilo
"Ein Genie besteht zu 10% aus Inspiration und zu 90% aus Transpiration" - Max Planck
Re: Inline ASM und "invoke LineTo,para1,x,y"
PB /Windows, x86
Code: Alles auswählen
!Extrn _MoveToEx@16
!Extrn _LineTo@12
If OpenWindow(0, 0, 0, 220, 220, "CanvasGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
CanvasGadget(0, 10, 10, 200, 200)
Repeat
Event = WaitWindowEvent()
If Event = #PB_Event_Gadget And EventGadget() = 0
If EventType() = #PB_EventType_LeftButtonDown Or (EventType() = #PB_EventType_MouseMove And GetGadgetAttribute(0, #PB_Canvas_Buttons) & #PB_Canvas_LeftButton)
hDC = StartDrawing(CanvasOutput(0))
If hDC
old_x=x
old_y=y
x = GetGadgetAttribute(0, #PB_Canvas_MouseX)
y = GetGadgetAttribute(0, #PB_Canvas_MouseY)
EnableASM
PUSH 0
PUSH old_y
PUSH old_x
PUSH hDC
CALL _MoveToEx@16
PUSH y
PUSH x
PUSH hDC
CALL _LineTo@12
DisableASM
StopDrawing()
EndIf
EndIf
EndIf
Until Event = #PB_Event_CloseWindow
EndIfcya,
...Danilo
"Ein Genie besteht zu 10% aus Inspiration und zu 90% aus Transpiration" - Max Planck
...Danilo
"Ein Genie besteht zu 10% aus Inspiration und zu 90% aus Transpiration" - Max Planck
Re: Inline ASM und "invoke LineTo,para1,x,y"
Jup, danke.
Danilo, dein Beispiel spiegelt diese Routine wieder in Purebasic.
Gibt es für Purebasic eigentlich eine Auflistung dieser API Routinen?
Danke.
Gruss
Danilo, dein Beispiel spiegelt diese Routine wieder in Purebasic.
Gibt es für Purebasic eigentlich eine Auflistung dieser API Routinen?
Danke.
Gruss
Re: Inline ASM und "invoke LineTo,para1,x,y"
APIFunctionsListing.txt / apifunctions.txt im PB-Compiler-Verzeichnis sollte alle automatisch importierten API-Funktionen enthalten.
Hilfe zu den Funktionen findet man in der jeweiligen Platform-API-Dokumentation (MSDN Library, Mac Developer Library, GTK+ Docs).
Hilfe zu den Funktionen findet man in der jeweiligen Platform-API-Dokumentation (MSDN Library, Mac Developer Library, GTK+ Docs).
cya,
...Danilo
"Ein Genie besteht zu 10% aus Inspiration und zu 90% aus Transpiration" - Max Planck
...Danilo
"Ein Genie besteht zu 10% aus Inspiration und zu 90% aus Transpiration" - Max Planck