flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
crc 18 Nov 2004, 15:00
Are there supposed to be two closing parenthesis in the line below:
Code: _hghghg=(1 shl _bit111)) |
|||
![]() |
|
Matrix 19 Nov 2004, 01:20
oh, thank you,
how could i miss that? ![]() it works if it is _hghghg=(1 shl _bit111) Code: macro resetportbit ._addressadd,_bit111 { _hghghg=((1 shl _bit111)) _hghghg5=($ff xor _hghghg) and word [global_port_data_buffer],_hghghg mov dx,[global_base_address] add dx,._addressadd mov al,[global_port_data_buffer] out dx,al } resetportbit 2,2 global_port_data_buffer: db 0 global_base_address: dw $378 i was just fooled by the illegal instruction error instead of missing parenthesis. well maeby i post this to the wrong place ![]() it must had been better if i post this to compiler internals i'm having a little suggestion to Privalov, namely: it whould be nice (just for completeness) to check if -string has quotes, or quotes are closed, cc db 'string cc db string' cc db 'string'' -missing parenthesis: _hghghg=(1 shl _bit111)) _hghghg=((((1 shl 1) shr 1) shl _bit111))) -brackets [] are closed and then display the appropriate error messages |
|||
![]() |
|
Madis731 05 Dec 2004, 22:36
Its nearly impossible to know how programmer wants his/her brackets/parenthesis etc.
What you can do is count every (, [, { and relatives in each row and check the parity and only warn the user - because maybe he/she wants to close them some 100 lines later. But when to warn the user? It may even compile fine and work, but some unnessecary parenthesis exist like in your example: maybe mov eax,[eax+((1+2))] |
|||
![]() |
|
Matrix 05 Dec 2004, 23:04
it whouldn't be so hard:
say: Code: <destination> <instruction> <source> _hghghg = ((1 shl _bit111) <source> : ((1 shl _bit111) interpret: <source> : <open (=1><open (=2> 1 shl _bit111 <close )=2> next instriction/destination display error message: go to/highlight error position <open (=1> index not closed ( mov eax,[eax+((1+2))] <instruction> <destination> , <source> <source> : [eax+((1+2))] interpret: <source> : <open [=1> eax <operator + check arguments> <open (=1><open (=2>1<operator + check arguments>2<close )=2><close )=1> no error mov eax,[eax+(1+2))] <instruction> <destination> , <source> <source> : [eax+((1+2))] interpret: <source> : <open [=1> eax <operator + check arguments> <open (=1>1<operator + check arguments>2<close )=1><close )=0> display error message: go to/highlight error position <close )=0> index there are no more ( to close |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.