Author Topic: Windows Projects  (Read 2591 times)

TimoVJL

  • Member
  • ***
  • Posts: 476
Re: Windows Projects
« Reply #15 on: February 18, 2019, 05:41:54 AM »
Still some errors and equate.c hangs.
Code: [Select]
C:\code\UAsm\UASM-master\H\codegenv2.h(112):  error:
More than 25 errors. Compilation stoped.
251 errors

C:\code\UAsm\UASM-master\hll.c
22 errors

C:\code\UAsm\UASM-masterX\macro.c(66):  error: Syntax error: ; expected
1 errors
Code: [Select]
#ifdef __WATCOMC__
static _inline char HexDigit( char x )
#elif defined(_MSC_VER)
static _inline char HexDigit( char x )   // line 66
#else
static char HexDigit( char x )
#endif
{
    x &= 0xF;
    return((x > 9) ? (x - 10 + 'A') : (x + '0'));
}
May the source be with you

Manos

  • Moderator
  • Regular Member
  • *****
  • Posts: 47
Re: Windows Projects
« Reply #16 on: February 18, 2019, 05:48:51 AM »
pcc32 is for Windows projects.
If UASM has been builded with another compiler, you should do changes in the source.

Manos.

Manos

  • Moderator
  • Regular Member
  • *****
  • Posts: 47
Re: Windows Projects
« Reply #17 on: February 18, 2019, 06:36:02 AM »
As I found in your code there is: static _inline etc.
pcc32 accepts inline functions when enable the switch: /C99
Also instead of _inline you must write: inline

Manos.

TimoVJL

  • Member
  • ***
  • Posts: 476
Re: Windows Projects
« Reply #18 on: February 18, 2019, 06:58:43 AM »
OK. -D_inline=inline helps with macro.c and hll.c
equate.c hangs and codegen.c have errors
Code: [Select]
C:\code\UAsm\UASM-masterX\H\codegenv2.h(8):  error: Enumerated type 'instr_group' previously defined
C:\code\UAsm\UASM-masterX\H\codegenv2.h(7):  warning: Previous declaration of 'instr_group' here
C:\code\UAsm\UASM-masterX\H\codegenv2.h(9):  error: Multiple declaration of 'GP1'
...
C:\code\UAsm\UASM-masterX\H\codegenv2.h(111):  error: Multiple declaration of 'M32UINT'
C:\code\UAsm\UASM-masterX\H\codegenv2.h(112):  error: Multiple declaration of 'M64UINT'
C:\code\UAsm\UASM-masterX\H\codegenv2.h(112):  error:
More than 25 errors. Compilation stoped.
251 errors
So pcc32 don't support #pragma once ?
May the source be with you

Manos

  • Moderator
  • Regular Member
  • *****
  • Posts: 47
Re: Windows Projects
« Reply #19 on: February 18, 2019, 07:05:59 AM »
pcc32 support #pragma once
But #pragma once must include in header files.

Manos.

TimoVJL

  • Member
  • ***
  • Posts: 476
Re: Windows Projects
« Reply #20 on: February 18, 2019, 07:29:46 AM »
equate.c + headers for testing.
pcc32 support #pragma once
But #pragma once must include in header files.

Manos.
This fixed it
Code: [Select]
#pragma once
#ifndef _CODEGENV2_H_INCLUDED
#define _CODEGENV2_H_INCLUDED
...
#endif  // _CODEGENV2_H_INCLUDED
May the source be with you

Manos

  • Moderator
  • Regular Member
  • *****
  • Posts: 47
Re: Windows Projects
« Reply #21 on: February 18, 2019, 07:54:32 AM »
OK.

Manos.

Manos

  • Moderator
  • Regular Member
  • *****
  • Posts: 47
Re: Windows Projects
« Reply #22 on: February 18, 2019, 04:37:43 PM »
You forgot to include the equate.c file for testing.

Manos.

TimoVJL

  • Member
  • ***
  • Posts: 476
Re: Windows Projects
« Reply #23 on: February 18, 2019, 07:36:44 PM »
It should be in test_equate.zip

In test2.zip that #pragma once issue.
May the source be with you

Vortex

  • Member
  • *****
  • Posts: 2030
Re: Windows Projects
« Reply #24 on: February 20, 2019, 05:17:27 AM »
An inline assembly example based on the Nasm syntax :

Code: [Select]
#include <windows.h>
#include <stdio.h>

char msg[] = "Hello world!";
char title[] = "pcc32";

void WriteMessage(void)
{

asm{
    push    0
    push    title
    push    msg
    push    0
    call    MessageBox
    }

}

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
                    LPSTR lpCmdLine, int nCmdShow)
{
    WriteMessage();
    return 0;
}

Manos

  • Moderator
  • Regular Member
  • *****
  • Posts: 47
Re: Windows Projects
« Reply #25 on: February 20, 2019, 05:45:41 AM »
Good example.

The option: /SUBSYSTEM:WINDOWS is unnecessary
because Link32 has it as default.
Have a look at: http://masm32.com/board/index.php?topic=7681.0

Manos.

Vortex

  • Member
  • *****
  • Posts: 2030
Re: Windows Projects
« Reply #26 on: March 19, 2019, 06:20:55 AM »

Vortex

  • Member
  • *****
  • Posts: 2030
Re: Windows Projects
« Reply #27 on: March 22, 2019, 04:53:48 AM »
liblzg built with pcc32

Quote
liblzg is a minimal implementation of an LZ77 class compression library. The main characteristic of the library is that the decoding routine is very simple, fast, and requires no memory.

In general, liblzg does not compress as well as zlib, for instance. On the other hand the decoder is very simple and very fast - ideal for systems with tight memory limits or limited processing capabilities.

Also, the decompression routine is easliy ported to just about any conceivable programming language (assembly language, JavaScript, etc).

http://liblzg.bitsnbites.eu

Vortex

  • Member
  • *****
  • Posts: 2030
Re: Windows Projects
« Reply #28 on: March 24, 2019, 08:51:36 PM »
Simple dialog box example.

Vortex

  • Member
  • *****
  • Posts: 2030
Re: Windows Projects
« Reply #29 on: April 12, 2019, 04:16:11 AM »
Quick example using msvcrt.lib supplied with pcc32 :

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

include     \masm32\include\windows.inc
include     \masm32\include\kernel32.inc
include     \masm32\include\user32.inc
include     \masm32\include\masm32.inc

includelib  \masm32\lib\kernel32.lib
includelib  \masm32\lib\user32.lib
includelib  \masm32\lib\masm32.lib

printf PROTO C :DWORD,:VARARG

.data

string  db '%s',13,10,0

.code

main PROC C uses esi ebx argc:DWORD,argv:DWORD

    mov     ebx,argc
    mov     esi,argv
@@:
    invoke  printf,ADDR string,DWORD PTR [esi]
    add     esi,4
    dec     ebx
    jnz     @b
    ret

main ENDP

END