flat assembler
Message board for the users of flat assembler.

Index > Windows > Cant seem to make object file

Author
Thread Post new topic Reply to topic
rain_storm



Joined: 05 Apr 2007
Posts: 67
Location: Ireland
rain_storm 25 Jun 2008, 19:47
Edit - Nevermind I figured it out didnt have extern in there (DOH)


Can someone explain how to make an object file I just dont get it. Here is the code I am trying to output. I want to link the object file with crinkler.exe which is a compressor+linker but this code keeps throwing errors. (Please forgive the fact that code doesnt clean up afterwards im trying to get openGL quad in 1kb)

error at entry start (why?)
error at section declarations (what extra charictors on line? object files dont need to know section priveledges or something?)

why are these errors happenin and how do I fix them?

Code:
 ;
 ; OpenGL programming example
 ;

;format  PE GUI 4.0
 format  MS COFF
;entry   start
 include 'win32a.inc'



 GL_QUADS            = 0x0007
 GL_COLOR_BUFFER_BIT = 0x4000



 section '.code' code readable executable
 start:xor     eax,eax
       invoke  CreateWindowEx,WS_EX_TOPMOST,EDIT,eax,WS_VISIBLE+WS_POPUP+WS_MAXIMIZE,eax,eax,eax,eax,eax,eax,eax,eax
       invoke  GetDC,eax
       xchg    eax,ebp
       invoke  ChoosePixelFormat,ebp,PFD
       invoke  SetPixelFormat,ebp,eax,PFD
       invoke  wglCreateContext,ebp
       invoke  wglMakeCurrent,ebp,eax
 draw: invoke  glClear,GL_COLOR_BUFFER_BIT
       mov     ebx, 0.7
       mov     edi,-0.7
       invoke  glRotatef, ebx, eax, eax, ebx
       invoke  glBegin,GL_QUADS
               invoke  glColor3f,  ebx, eax, eax
               invoke  glVertex3f, edi, edi, edi
               invoke  glVertex3f, ebx, edi, edi
               invoke  glColor3f,  eax, eax, ebx
               invoke  glVertex3f, ebx, ebx, edi
               invoke  glVertex3f, edi, ebx, edi
       invoke  glEnd
       invoke  SwapBuffers,ebp
       invoke  GetAsyncKeyState,VK_ESCAPE
       or      eax,eax
       jz      draw
       invoke  ExitProcess



 EDIT  db      'EDIT'
 PFD   dd      0,PFD_SUPPORT_OPENGL+PFD_DOUBLEBUFFER+PFD_DRAW_TO_WINDOW



 section '.idata' import data readable writeable
       library kernel, 'KERNEL32',\
               user, 'USER32',\
               gdi, 'GDI32',\
               opengl, 'OPENGL32'
       import  kernel, ExitProcess,'ExitProcess'
       import  user,   CreateWindowEx,'CreateWindowExA',\
                       GetAsyncKeyState,'GetAsyncKeyState',\
                       GetDC,'GetDC'
       import  gdi,    ChoosePixelFormat,'ChoosePixelFormat',\
                       SetPixelFormat,'SetPixelFormat',\
                       SwapBuffers,'SwapBuffers'
       import  opengl, glBegin,'glBegin',\
                       glClear,'glClear',\
                       glColor3f,'glColor3f',\
                       glEnd,'glEnd',\
                       glRotatef,'glRotatef',\
                       glVertex3f,'glVertex3f',\
                       wglCreateContext,'wglCreateContext',\
                       wglMakeCurrent,'wglMakeCurrent'

    
Post 25 Jun 2008, 19:47
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.