C and Assembler files


I use the Borland C++ builder.
I wrote the simple program .c file that looks for a datapattern into a .asm file. But how must I declare the 'AllDemos' wich is located in the .asm file?

.c file:
#pragma hdrstop
#pragma argsused

int main(int argc, char* argv[])
int i;
for (i=0; i < 100; i++) {
if (AllDemos[i] == 0x4D){
return 0;

.asm file:
_AllDemos segment dword public use32 'AllDemos'

db 0x4D,0x54,0x68,0x64,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x01,0x00,0xF0,0x4D,0x54
db 0x72,0x6B,0x00,0x00,0x03,0xE9,0x00,0xFF,0x59,0x02,0x00,0x00,0x00,0xFF,0x51,0x03
db 0x08,0xF9,0xCB,0x00,0x90,0x30,0x40,0x00,0x40,0x4B,0x00,0x43,0x4B,0x00,0x3C,0x3C
db 0x81,0x66,0x3C,0x00,0x00,0x30,0x00,0x00,0x40,0x00,0x00,0x43,0x00,0x0A,0x3C,0x3E
db 0x00,0x43,0x4E,0x00,0x40,0x4E,0x00,0x30,0x41,0x83,0x56,0x30,0x00,0x00,0x3C,0x00
db 0x00,0x43,0x00,0x00,0x40,0x00,0x0A,0x37,0x48,0x00,0x30,0x43,0x00,0x40,0x4F,0x00
db 0x50,0x00,0x37,0x44,0x00,0x41,0x4A,0x81,0x66,0x41,0x00,0x00,0x3E,0x00,0x00,0x47
db 0x00,0x00,0x37,0x00,0x0A,0x3C,0x3C,0x00,0x40,0x41,0x00,0x48,0x50,0x00,0x30,0x40
db 0x85,0x46,0x30,0x00,0x00,0x3C,0x00,0x00,0x40,0x00,0x00,0x48,0x00,0x00,0xFF,0x2F
db 0x00


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!