flat assembler
Message board for the users of flat assembler.
![]() Goto page Previous 1, 2 |
Author |
|
bitRAKE
Is there an a way to terminate the assembly process without producing an error? I don't want an output file, but presently am using "err 'No Output File'".
Code: test-file.fasmg [66]: err 'No Output File' Custom error: No Output File. The terminal process terminated with exit code: 1 Maybe "format null" could not produce a file? |
|||
![]() |
|
bitRAKE
bitRAKE wrote: Next I try to verify some data: There is list of cube sums at https://arxiv.org/abs/1604.07746v1 https://www.youtube.com/watch?v=ASoz_NuIvP0 [EDIT] Found! https://youtu.be/zyG8Vlw5aAw Last edited by bitRAKE on 06 Sep 2019, 17:05; edited 1 time in total |
|||
![]() |
|
bitRAKE
Tried to encapsulate commandline option testing to something like:
Code: OPTION "s","silent" bts [Options.FLAGS],FLAG_SILENT END OPTION OPTION "h","help" mov rax,[.pArgv] push qword [rax] lea rdx,[HelpMessage] call STD_OUTPUT_HANDLE__wsprintfA pop rax END OPTION Code: Options.count = 0 macro OPTION text& local skip macro END.OPTION! label skip.0 esc end macro end repeat purge END.OPTION end macro Options.count = Options.count + 1 repeat 1,i:Options.count esc macro Options.i iterate txt,text virtual at 1 ; rely on DU to convert UTF8 to widechar du txt load temp: $-1 from $$ end virtual if % = %% skip.temp = 1 end if repeat ((bsr temp) shr 4) + 2 Display "0"+%% ; 1? if % = %% if % and 1 cmp word [rsi+2*(%+1)],temp else cmp dword [rsi+2*(%+1)],temp end if if skip.temp ; fall through to process, if txt is last alternative jnz skip.0 else ; jump over alternatives to process jz skip.dont end if else if ~ (% and 1) cmp dword [rsi+2*(%+2)],temp and $FFFFFFFF temp = temp shr 32 if skip.temp ; if txt is last alternative skip process jnz skip.0 else ; try next alternative jnz skip.% end if end if end repeat label skip.% end iterate label skip.dont end macro macro __OPTIONS postpone ? repeat Options.count Options.% end repeat end postpone end macro |
|||
![]() |
|
Tomasz Grysztar
bitRAKE wrote: Can't seem to get this to work as expected. Completely baffled how REPEAT ?+2 could result in %%=1. To make matters worse, "%" and "%%" are global parameters (not limited by a scope, as long as you are inside some repeated block, they have a value), so even encapsulating the macro definition would not save you here. |
|||
![]() |
|
Tomasz Grysztar
A reduced sample that demonstrates the problem:
Code: repeat 1,i:1 macro Options.i iterate txt, 'a','b','c' display '0'+%% end iterate end macro end repeat Options.1 Code: macro preserve_counters? %:%, %%:%% macro end?.preserve_counters? end match end macro outscope match %:%%, %:%% end macro repeat 1,i:1 preserve_counters macro Options.i iterate txt, 'a','b','c' display '0'+%% end iterate end macro end preserve_counters end repeat Options.1 |
|||
![]() |
|
bitRAKE
Since I didn't need the count, I went with something similar to:
Code: postpone ? OPTIONS end postpone macro OPTIONS end macro macro OPTION text& macro END.OPTION! esc end macro purge END.OPTION end macro esc macro OPTIONS OPTIONS iterate txt, text display "0"+%,txt end iterate display 13,10 end macro OPTION 'a','b','c' END OPTION OPTION 'x','y','z' END OPTION |
|||
![]() |
|
Goto page Previous 1, 2 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2019, Tomasz Grysztar.
Powered by rwasa.