flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
vid 25 Oct 2006, 22:50
by the way, i am doing same with EOF (end of file) and OF flag. But in that case i HAVE to do it through flag, so no questioning there
|
|||
![]() |
|
dead_body 26 Oct 2006, 04:19
i am for the flag.
|
|||
![]() |
|
shoorick 26 Oct 2006, 05:27
a2f function i had wrote returns eax=0&ZF=1 on error, otherwise number in ST0 and pointer to the first byte after loaded number, so you can check is it valid terminator (like zero, space, tab or any other for specific situation)
|
|||
![]() |
|
vid 26 Oct 2006, 10:14
shoorick: i provided too few info. FASMLIB functions always return error wth CF=1/EAX=error code. my conversion routines beheave similar to what you described (except number is returned in EAX, and conversion length is stored in variable pointed by function argument).
But this operation is working with stream, eg. after you read number, next read (or peek) from stream shows you terminator character. This is not issue, problem is whether to use flag (faster for lowlevel typing, less standardized) or return standard error (needs uglier code constructs, but is very "general"). I also forgot to mention one PRO of error: in future, it will be possible to very easily implement mass catching of errors, like in HLLs: Code: try libcall text.read libcall text.read libcall text.read ... catch ERR_NOT_NUMERIC ;print position in text and error here endtry i am not personally fan of try-catch, it forces you to write somewhat dumber than with "manual" handling of each call. But still it's nice, and someone might be interested. so this question can be understood as higher-level vs. low-level |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.