NO

Recent Posts

Pages: 1 ... 8 9 [10]
91
need a sample for x86 assembly file and compile and linking syntax..Appriciated

e.g.
<------------------------------------>
.386
.model flat, stdcall
option casemap : none
.code
start:
    ;write your code here
    xor eax, eax
    mov eax,6H
    ret
    end start
<------------------------------------------->
above  file is for masm x86 and compile syntax is as follows ,remove square brackets please.

ml.exe /nologo /Sn /Sa /c /coff /Fo[PROGRAM_NAME.OBJ] /Fl[LSTOUTPUT_NAME.LST] [PROGRAM_NAME.ASM]

and linking is as follows  ,remove square brackets please.

link.exe /SUBSYSTEM:CONSOLE /OPT:NOREF /NOLOGO /OUT:[PROGRAM_NAME.EXE] [PROGRAM_NAME.OBJ]

thanks in advance.

92
Beginner questions / Re: Select text for clipboard
« Last post by DonnyDave on August 06, 2024, 05:38:02 PM »
I didn't specify the problem correctly !
I'm OK with adding a text buffer to the clipboard and pasting it to another app,
I can't workout how to select some part of the text from the (screen) buffer using the mouse.
93
Assembly discussions / Exported functions and aliases
« Last post by Vortex on August 02, 2024, 09:27:03 PM »
Hello,

Here is an example of exported functions with aliases.

ConsFuncs.def :

Code: [Select]
LIBRARY ConsFuncs
EXPORTS

"cls"=_ClearScreen@0
"WriteConsole"=_StdOut@4
StrLen
locate

Example code calling the functions :

Code: [Select]
.386
.model flat, stdcall
option casemap :none

ExitProcess PROTO :DWORD

includelib \PellesC\lib\Win\kernel32.lib
includelib ConsFuncs.lib

cls PROTO
WriteConsole    PROTO :DWORD
StrLen          PROTO :DWORD
locate          PROTO :DWORD,:DWORD

.data

message         db 'Hello world!',13,10
                db 'This is a console application.',13,10,0

.code

start:

    invoke  StrLen,ADDR message ; just for testing
    invoke  cls
    invoke  WriteConsole,ADDR message                                               
    invoke  ExitProcess,0

END start
94
IDE for Assembler and C / Re: CoderStudio (under development).
« Last post by John Z on July 29, 2024, 11:24:02 PM »
Hi Vortex,

Oh - so sorry to hear the sad news.

Also a reminder to us all to leave plans for our digital legacy.

I hope if it all works out Pelles will be one of the places it is posted.

Thanks for the update,

John Z

Maybe Pelle will let it be posted at http://www.smorgasbordet.com/pellesc/ because I'm sure it is more than a 1Meg :) If not I guess on MASM
95
IDE for Assembler and C / Re: CoderStudio (under development).
« Last post by Vortex on July 29, 2024, 08:32:27 PM »
Hi John,

Sadly, the author of CoderStudio, Mr. Manos passed away. I am cooperating with his son to release a zip file containing all the development tools of Manos.
96
IDE for Assembler and C / Re: CoderStudio (under development).
« Last post by John Z on July 28, 2024, 11:03:20 PM »
Is this still a 'thing'?  Thought I'd give it a try as we all await the next Pelles Release  ;D

I know - 10 years old. Anyway I'm trying to get it to run under Windows 11.
the program itself runs but the test project doesn't build and there are no error
messages.  I edited the ini file manually to point to PellesC directories because
the Customize GUI didn't accept the directory paths.  I'm attaching it.
No help file is included....

Everything appears OK but no build/assemble or compile appears to work yet READY shows
after trying it.

The GUI does look nice and visually like VC from MS.

John Z

97
Beginner questions / Re: Run Google Earth
« Last post by John Z on July 03, 2024, 10:44:54 AM »
Thanks TimoVJL!

I had forgotten webview and all the work you and frankie did getting it functional.

John Z
98
Assembly discussions / String with random characters
« Last post by Vortex on July 02, 2024, 09:02:13 PM »
Simple random character generator using cryptographic functions.

Code: [Select]
.386
.model flat,stdcall
option casemap:none

include RandString.inc

.data?

buffer      db 64 dup(?)

.code

start:

    call    main
    invoke  ExitProcess,0

main PROC uses esi edi ebx

LOCAL counter:DWORD

    invoke  RandomBytes,64,ADDR buffer

    mov     esi,OFFSET buffer
    mov     edi,26
    mov     counter,64
    mov     ebx,1
@@:
    movzx   eax,BYTE PTR [esi]
    xor     edx,edx
    div     edi
    and     eax,ebx
    shl     eax,5
    lea     edx,[edx+eax+65]
    mov     BYTE PTR [esi],dl
    add     esi,ebx 
    sub     counter,ebx
    jnz     @b
    invoke  printf,ADDR buffer
    ret

main ENDP

RandomBytes PROC dwLength:DWORD,pBuffer:DWORD

LOCAL hProvider:DWORD

    xor     eax,eax
    invoke  CryptAcquireContext,ADDR hProvider,eax,eax,\
            PROV_RSA_FULL,CRYPT_VERIFYCONTEXT or CRYPT_SILENT
    invoke  CryptGenRandom,hProvider,dwLength,pBuffer
    invoke  CryptReleaseContext,hProvider,0
    ret

RandomBytes ENDP

END start
99
Beginner questions / Re: Run Google Earth
« Last post by TimoVJL on July 02, 2024, 10:46:41 AM »
100
Beginner questions / Re: Run Google Earth
« Last post by John Z on July 02, 2024, 10:31:33 AM »
Hi anatolewilson,

Welcome to the forum!

To do what you are thinking you can invoke a COM object/method to open a web interface from within your program.

I think the attached webbrowser project will get you started.  I am not the author and I am embarrassed to say I don't recall where I originally found it.  Possibly here: http://www.johnfindlay.plus.com/pellesc/ but I'm not sure.

Unzip it and run BrowseApp.exe.   If it looks workable to you dive into the code by opening the Pelles C BrowseApp.ppj file, and modify to your hearts content. 

Hope it helps.

John Z
Pages: 1 ... 8 9 [10]