flat assembler
Message board for the users of flat assembler.
Index
> Windows > [solved] Undefined symbol 'read_hex' |
Author |
|
revolution 19 Apr 2020, 21:34
You need to provide the label read_hex and also print_hex
Code: start: ;... read_hex: ;fill in your code here print_hex: ;fill in your code here .end ; <--- allow the windows macros to close off the file |
|||
19 Apr 2020, 21:34 |
|
Bodo 19 Apr 2020, 23:28
Now i am getting error, undefined symbol Exitprocess." Please help! My code is below:
; This is a prgram for adding numbers. format Pe console entry start include 'win32a.inc' ;----------------------------------------------------------- section '.text' code readable executable start: read_hex: mov edx,eax add eax,edx print_hex: section '.idata' import data readable invoke ExitProcess,0 |
|||
19 Apr 2020, 23:28 |
|
revolution 20 Apr 2020, 00:25
You need the ".end" at the end to allow the macros to complete the import section.
See the "examples" folder in the fasm download, they show the ways you can do this. |
|||
20 Apr 2020, 00:25 |
|
Bodo 20 Apr 2020, 02:46
I got it now.
Thank you. |
|||
20 Apr 2020, 02:46 |
|
Ali.Z 20 Apr 2020, 03:19
you need a basic understanding of your target OS, how executables work in that OS.
since you are using windows os, you need minimum of 1 section and you must construct the import table. Code: format pe gui ; executable type and subsystem include 'win32a.inc' ; useful macros, that what makes an all in one section ; note that win32 for 32-bit programs and 'a' for ascii/ansi ; using win32a.inc, we can omit the API variant (a,w) .. invoke MessageBox,0,_construct,_flat,0 ; library function ret _flat db '.flat section have code and data resides in it',0 _construct db 'although fasm create a .flat section for both code and data',0Dh,0Ah,'but you must construct the import table',0 data import ; begin of import table library user32,'user32.dll' ; MessageBoxA resides here include 'api\user32.inc' ; the include file that have all library functions end data ; end of import table _________________ Asm For Wise Humans |
|||
20 Apr 2020, 03:19 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.