flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > [solved] searching strings for reserved words? FASM |
Author |
|
revolution 19 Jun 2018, 16:28
Works for me:
Code: 1 passes, 18 bytes. Maybe you have overridden db? |
|||
19 Jun 2018, 16:28 |
|
Azagaros 19 Jun 2018, 16:32
Try it now..
|
|||
19 Jun 2018, 16:32 |
|
revolution 19 Jun 2018, 16:59
No problem:
Code: 1 passes, 14 bytes. Code: 00000000 00 00 00 41 4c 49 47 4e 00 01 00 41 41 53 |...ALIGN...AAS| |
|||
19 Jun 2018, 16:59 |
|
Azagaros 19 Jun 2018, 19:43
Appears this is what is giving me headaches. The idea of readable code.
Code: foo equ 0x02 bar equ 0x03 table: db 0x00, foo, 0x00, 'ABCDEF' db bar, 0x00, 0x00, 'adcBXY' I do not want to hard code the numbers, it is a substantial list. Both in NASM and FASM |
|||
19 Jun 2018, 19:43 |
|
revolution 19 Jun 2018, 20:21
Still no problem:
Code: foo equ 0x02 bar equ 0x03 table: db 0x00, foo, 0x00, 'ABCDEF' db bar, 0x00, 0x00, 'adcBXY' Code: 1 passes, 18 bytes. Code: 00000000 00 02 00 41 42 43 44 45 46 03 00 00 61 64 63 42 |...ABCDEF...adcB| 00000010 58 59 |XY| |
|||
19 Jun 2018, 20:21 |
|
Azagaros 19 Jun 2018, 20:44
You have the gist of what I am doing. I am still trying to find the reserved word then. db I have not messed with. It defines like that but is much longer per row and still looking.
I do something like this too: Code: foo equ 0x02 bar equ 0x03 dumb equ 0b00010001 dumber equ 0b10001000 table: db 0x00, foo, dumb, 'abcdef' db bar, 0x00, dumber, 'abxdef' db 0x00, 0x00, dumber|dumb , 'abzabx' I am still cleaning up the table, seeing what works but reserved word problem and it points to lines that looks like these. |
|||
19 Jun 2018, 20:44 |
|
revolution 19 Jun 2018, 20:56
In fasm binary-or is spelled out in full.
Code: db 0x00, 0x00, dumber or dumb , 'abzabx' |
|||
19 Jun 2018, 20:56 |
|
Azagaros 19 Jun 2018, 21:05
can I stack 'or's like dumb or dumber or dumbest? I am use to using the | pipe...c thing..
the other problem is that reserved word does not show up on a line with the |. Where do I find a complete list of reserved words? I might be running into an undocumented one. |
|||
19 Jun 2018, 21:05 |
|
revolution 19 Jun 2018, 21:07
You can use as many ors as you need. Just don't use the pipe unless you are doing logical tests.
Azagaros wrote: the other problem is that reserved word does not show up on a line with the |. Where do I find a complete list of reserved words? I might be running into an undocumented one. For a list of reserved words you can look into the source code "tables.inc". |
|||
19 Jun 2018, 21:07 |
|
Azagaros 19 Jun 2018, 21:27
In c logical test is || and unary math with | in C\C++. You are telling me that && and & are & and 'and' for fasm too..
Exact error is: error: reserved word used as symbol. |
|||
19 Jun 2018, 21:27 |
|
revolution 19 Jun 2018, 21:30
or, and, xor are all spelled out in full. There is no || or && in fasm.
The order of precedence is listed in the the manual. I always forget what it is and have to refer to the manual regularly. |
|||
19 Jun 2018, 21:30 |
|
revolution 19 Jun 2018, 21:33
Azagaros wrote: Exact error is: error: reserved word used as symbol. For example: Code: test.asm [1]: and = 4 processed: and=4 error: reserved word used as symbol. Code: x equ and x = 4 Code: test.asm [2]: x = 4 processed: and=4 error: reserved word used as symbol. |
|||
19 Jun 2018, 21:33 |
|
Azagaros 19 Jun 2018, 21:58
How do I make that processed concept you are talking about? I am not familiar with the fasm command line options fully. I do not do anything you are stating.
Code: foo equ 0x10; hex value 10h, decimal 16 ; word byte, byte ,byte, byte , byte, word, null-terminate string length 16 and padded out to make a nice square line. table: db 0x00,0x02, foo, 0x00, 0x00, 0x00, foo, dumb or dumber, 'stringx', 0x00, 0x00 I am working with SASM editor and it is not indicating anything as a keyword in the equate statements. The line before it does not generate the error and zeros in it. The line it errors on and every line just like it that follow, if I comment out the offending line errors out. equ is a preprocessor thing? or does it need to be in the data block? NASM its preprocessor, FASM? |
|||
19 Jun 2018, 21:58 |
|
Azagaros 19 Jun 2018, 23:10
Code: C:\Users\drago\AppData\Local\Temp\SASM\program.asm [185]: db 0x00,0x02, imm8, 0x00, 0x00, 0x00, 0x00, 0xD5, 0x00, 0x0A, eIMM, 'AAD',0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 error: reserved word used as symbol. it does not tell me the offending symbol. Code: InstTable: db 0x00,0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x0000, 'AAA',0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 db 0x00,0x02, imm8, 0x00, 0x00, 0x00, 0x00, 0xD5, 0x00, 0x0A, eIMM, 'AAD',0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 imm8 equ 10h and eimm equ 1. The first concept I went to was the string and the other two I am not finding in FASM. The first line compiles fine the second one errors.. |
|||
19 Jun 2018, 23:10 |
|
revolution 20 Jun 2018, 04:52
Still no problem:
Code: imm8 equ 10h eIMM equ 1 InstTable: db 0x00,0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x0000, 'AAA',0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 db 0x00,0x02, imm8, 0x00, 0x00, 0x00, 0x00, 0xD5, 0x00, 0x0A, eIMM, 'AAD',0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 Code: 1 passes, 54 bytes. To show the "processed" output I just use the command fasm test.asm in the console window. And make sure you are using the latest version of fasm. |
|||
20 Jun 2018, 04:52 |
|
Azagaros 20 Jun 2018, 05:15
I realized a problem with all the equates and it was not one in either line but I did define something twice or redefined. It has been cleared up and it compiles. No warnings that I may have done that.
one compile it gets by it and fix the next error it return to the same line with the same error. It is a current version of SASM, gui editor with fasm built in. I will get it setup on linux and not window where I am editing it right now. SASM claims this version fasm 1.71.39 |
|||
20 Jun 2018, 05:15 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.