User forums > Using Code::Blocks
fasm using c::b works, but still some questions
stahta01:
What CB Compiler did you clone to make it use FASM?
denimjeans2007:
I believe I did clone the C++ gcc standard compiler.
The error message is in the first post.
denimjeans2007:
example program with error
--- Code: ---; Template for program using standard Win32 headers
format PE GUI 4.0
entry start
include 'win32w.inc'
section '.text' code readable executable
start:
invoke GetModuleHandle,0
mov [wc.hInstance],eax
invoke LoadIcon,0,IDI_APPLICATION
mov [wc.hIcon],eax
invoke LoadCursor,0,IDC_ARROW
mov [wc.hCursor],eax
invoke RegisterClass,wc
test eax,eax
jz error
invoke CreateWindowEx,0,_class,_title,WS_VISIBLE+WS_DLGFRAME+WS_SYSMENU,128,128,256,192,NULL,NULL,[wc.hInstance],NULL
test eax,eax
jz error
msg_loop:
invoke GetMessage,msg,NULL,0,0
cmp eax,1
jb end_loop
jne msg_loop
invoke TranslateMessage,msg
invoke DispatchMessage,msg
jmp msg_loop
error:
invoke MessageBox,NULL,_error,NULL,MB_ICONERROR+MB_OK
end_loop:
invoke ExitProcess,[msg.wParam]
proc WindowProc uses ebx esi edi, hwnd,wmsg,wparam,lparam
cmp [wmsg],WM_DESTROY
je .wmdestroy
.defwndproc:
invoke DefWindowProc,[hwnd],[wmsg],[wparam],[lparam]
jmp .finish
.wmdestroy:
invoke PostQuitMessage,0
xor eax,eax
.finish:
ret
endp
ERROR_HERE
section '.data' data readable writeable
_class TCHAR 'FASMWIN32',0
_title TCHAR 'Win32 program template',0
_error TCHAR 'Startup failed.',0
wc WNDCLASS 0,WindowProc,0,0,NULL,NULL,NULL,COLOR_BTNFACE+1,NULL,_class
msg MSG
section '.idata' import data readable writeable
library kernel32,'KERNEL32.DLL',\
user32,'USER32.DLL'
include 'api\kernel32.inc'
include 'api\user32.inc'
--- End code ---
so what I want to achieve is, that I dont want to scroll but doubleclick and then it jumps straight to the line 55, I hope I was able to explain what I mean :) We need to be able to parse the error message and fish the 55 out. then when user doubleclicks, jump to line 55. This would really awesome. My code is now approx 2000 line, and scrolling back forth is messy. Sure I can work with includes ... but still you need to scroll
For testing, if you are on Windows, you can try fasmw, which comes in the same package. All "portable" and no need to install, super small. It is the windows "IDE" but not really comfortable. no line numbers etc. but does the job.
stahta01:
--- Code: ----------------- Build: Release in test_fasm (compiler: FASM)---------------
FASM.EXE H:\devel\cb_projects\test\test_fasm\main.asm obj\Release\main.o
Linking stage skipped (build target has no object files to link)
H:\devel\cb_projects\test\test_fasm\main.asm [4]:
include 'win32ax.inc' ; you can simply switch between win32ax, win32wx, win64ax and win64wx here
error: file not found.
flat assembler version 1.73.32 (1048576 kilobytes memory)
Process terminated with status 2 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
--- End code ---
Edit: I am assembling hello.asm code
This is the build log I am getting; I will see if I can figure out what advanced compiler setting needs to be changed and to what.
Settings -> Compiler
Far right tab: "Other Settings"
Button: Advanced Options"
Tab: output parsing
But, it looks more complex than I remember from about 5 years, ago.
I will see which one looks closest or more correct to change.
I think I forgot all I knew about regex; so, it will be a while before I can figure it out.
Tim S.
denimjeans2007:
here is my build log:
--- Code: ----------------- Build: Debug in server_tcp_listen_v0.2 (compiler: FASM2)---------------
Running target pre-build steps
mkdir -p bin/Debug
FASM.EXE D:\ASM\projects\01.TEMPLATES\server_tcp_listen_v0.2\main.asm bin\Debug\server_tcp_listen_v0.exe
Linking stage skipped (build target has no object files to link)
flat assembler version 1.73.31 (1048576 kilobytes memory)
7 passes, 0.2 seconds, 17131008 bytes.
Process terminated with status 0 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
--- End code ---
here again my settings:
1. under global compiler settigns:
2. Selected Compiler: FASM (your newly created compiler settings)
3. Nothing checked or entered on any of these tabs beside:
4. Search directory -> Compiler -> d:\ASM\FASM (where your FAMS folder is)
5. Toolchain Executables ->
* 5a. Compiler install dir: D:\ASM\fasm
* 5b. C Compiler: fasm.exe
* 5c. C++ Compiler: fasm.exe
* Rest can stay as it is, it will ignored anyways6. other settings -> Advanced options -> commands -> command line Macro: $compiler $file $exe_output
(before changing, make sure your selected compiler is your newly created FASM compiler settings, otherwise you will mess up the gcc settings :D )
under project build options:
7. pre/post build steps:
8. pre: mkdir -p bin/Debug
under properties of your asm file:
9. Build: uncheck link file (no obj file to be created)
10. Advance: customer build -> for this compiler: FASM
10a. use customer command to build: $compiler $file $exe_output
(will give you as example: fasm.exe main.asm main.exe)
with this settings, you should be able to complile without issues
In your output it does seem like that you are are missing:
4,5a.,maybe 6.
once everything compiles fine, says thanks god ;D and then save it as project template, example: ASM_Template
regarding the regex thing, I probaly can help you if we can tell me where I can check or where to test the regex?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version