flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > small bug ? |
Author |
|
revolution 25 Feb 2010, 15:24
A bit of a cosmetic bug. You still get some sort of error that is the main thing.
|
|||
25 Feb 2010, 15:24 |
|
Tomasz Grysztar 25 Feb 2010, 15:38
The "\" character in fasm has a different function when immediatelly followed by a symbol token, and different when not. In the first case it creates the "escaped" symbol ("\a" in this sample), and in second case it marks the ignored line break and no other symbols should follow in the same line.
|
|||
25 Feb 2010, 15:38 |
|
Tomasz Grysztar 25 Feb 2010, 15:40
PS You may notice that this is a perfectly valid code, because "\a" is a valid symbol:
Code: \a: mov ax,\a |
|||
25 Feb 2010, 15:40 |
|
ouadji 25 Feb 2010, 17:00
Thank you for your reply. I understood your explanation. So yes, with this difference about function of the symbol "\", followed by a symbol token, or not ... then I am more in agreement with the reaction of the compiler. however, i noticed this : Code: FASMW ------- \a: mov ax,\a ; with ax, or eax, it does compile, it's ok. (FASMW) FASM ----- \a: mov ax,\a ; doesn't compile : invalid use of symbol (FASM) But with "eax", it's ok. \a: mov eax,\a ; it does compile, it's ok. (FASM) @revolution : "a cosmetic bug" I do not try to bother, but simply to understand. |
|||
25 Feb 2010, 17:00 |
|
revolution 26 Feb 2010, 02:08
ouadji wrote: FASM Code: flat assembler version 1.69.07 (100000 kilobytes memory) 1 passes, 3 bytes. |
|||
26 Feb 2010, 02:08 |
|
bitshifter 26 Feb 2010, 02:14
Hmm...
I though that would put word offset of label into AX? Also, why/how can this be legal? Code: \a: mov al,\a |
|||
26 Feb 2010, 02:14 |
|
revolution 26 Feb 2010, 02:42
bitshifter wrote: Hmm... bitshifter wrote: Also, why/how can this be legal? |
|||
26 Feb 2010, 02:42 |
|
bitshifter 26 Feb 2010, 05:24
Ahhh, i get it, offset was zero...
I thought we needed to use same reg size as code. Its legal all the way up to MAX_BYTE Within range: Code: times 255 db 0 \a: mov al,\a Out of range: Code: times 256 db 0 \a: mov al,\a Thanks for the clarification |
|||
26 Feb 2010, 05:24 |
|
ouadji 26 Feb 2010, 08:17
(fasm 1.69.12) Quote:
does compile Code: \a: mov ax,\a this, below, does not compile Code: format MS COFF \a: mov ax,\a why ? i don't understand. |
|||
26 Feb 2010, 08:17 |
|
revolution 26 Feb 2010, 08:25
A good example why one should always show all of one's code when asking for help. Otherwise one gets the wrong answer.
Anyhow, does this compile for you? Code: format MS COFF a: mov ax,a |
|||
26 Feb 2010, 08:25 |
|
cthug 26 Feb 2010, 08:43
I am [edit]NOT[/edit] familiar with the COFF format but perhaps it uses 32bit symbols?
[edit]It has relocation, and symbol table.[/edit] Last edited by cthug on 26 Feb 2010, 10:32; edited 1 time in total |
|||
26 Feb 2010, 08:43 |
|
ouadji 26 Feb 2010, 09:35
this doesn't compile either ! Code: format MS COFF ;fasm 1.69.12 nop b: mov ax,b Quote: always show all of one's code when asking for help my_file.asm : 3220 lines my_file.inc : 1420 lines |
|||
26 Feb 2010, 09:35 |
|
vid 26 Feb 2010, 11:23
Cthug is right. How exactly do you expect compiler to move relocated symbol into 16-bit register?
|
|||
26 Feb 2010, 11:23 |
|
ouadji 26 Feb 2010, 11:33
indeed, correct. I had not thought of it ! thank you. |
|||
26 Feb 2010, 11:33 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.