flat assembler
Message board for the users of flat assembler.
Index
> Main > <internal> Invalid handle error on text.read.macro get |
Author |
|
vid 23 May 2007, 21:44
it's bug in stream.readchar (that is used by text.read.char). thank you.
i'm uploading fixed version (0.5.1) right now |
|||
23 May 2007, 21:44 |
|
rkamarowski 23 May 2007, 22:05
thank you vid.
|
|||
23 May 2007, 22:05 |
|
vid 23 May 2007, 22:57
it's up: http://fasmlib.x86asm.net/fasmlib-0.5.1.zip
sorry for delay in FASMLIB development, i'm really busy with other things, and before i continue FASMLIB i must finish tool that i will use for FASMLIB documentation. |
|||
23 May 2007, 22:57 |
|
rkamarowski 24 May 2007, 12:34
vid,
i'm sorry to bother you with this but i'm getting the same error. i've deleted the old 0.5.0 files and installed the 0.5.1 files. i'm running: windows xp pro amd athlon 64 processor 2.41ghz |
|||
24 May 2007, 12:34 |
|
vid 24 May 2007, 13:09
you're not bothering me, if it's a bug then you are doing me a fover.
but are you sure you are not messing anything? For me it worked after i fixed it. Maybe you are still using old version? To make sure, go to fasmlib sources, file "src/stream.inc", there find procedure "proc stream.readchar", and check this line: Code: libcall stream.read, [stream], eax, 1 If you see following, then you are still using 0.5.0: Code: libcall stream.read, eax, 1 If you are sure you are using 0.5.1, post your code. |
|||
24 May 2007, 13:09 |
|
rkamarowski 24 May 2007, 13:17
i deleted and re-installed 0.5.1, and i'm getting the same error. here's stream.readchar
proc stream.readchar stream local buf rb 1 lea eax, [buf] libcall stream.read, [stream], eax, 1 jc .r jo .r mov al, byte [buf] clc .r: ret endp |
|||
24 May 2007, 13:17 |
|
vid 24 May 2007, 13:55
please either post your source, compiled application with int3 right before call that fails. I will look into it
|
|||
24 May 2007, 13:55 |
|
rkamarowski 24 May 2007, 14:04
source attached. i'm new to assembly programming, so you'll see a number of tests.
|
|||||||||||
24 May 2007, 14:04 |
|
rkamarowski 24 May 2007, 14:06
uhhh... sorry about the attachment. here's the source:
Code: format PE console include 'include/win32ax.inc' SYSTEM equ win32 include 'include/fasmlib/include/fasm/fasmlib-src.inc' ;include 'k2-mMacros.inc' TEXT_SIZE = 1024 macro abort xString { error xstring } macro emit xString { push xString push stream.stdout call text.write jc fasmError } macro emitLn xString { emit xString } macro error xString { emitLn xString } macro expected xString { } macro expression { } macro getChar { push stream.read call text.read.char jc fasmError } macro getLine { push TEXT_SIZE push text push stream.stdin call text.read.line jc fasmError } macro getName { } macro getNum char { } macro init { } macro initialize { call mem.init jc fasmError call stream.init jc fasmError } macro isAlpha char { } macro isDigit char { } macro lookAhead char { } macro match xString { } macro prompt xString { push xString push stream.stdout call text.write } .data _error db 'fasm error: ',0 _prompt db 'k2-m> ',0 _text db 'After str.ins and str.cat: ',0 _text2 db '(a)',0 _text3 db '(i)',0 z db 'i',0 IncludeIData IncludeUData text rb TEXT_SIZE .code start: ; initialize modules 'mem' and 'stream' initialize prompt _prompt ; get line of text getChar getLine ; display line of text emit text ; unititialize modules in 'reverse' order call stream.uninit jc fasmError call mem.uninit jc fasmError ; exit without fasmError push 0 call process.exit .end start fasmError: ; eax holds fasmError code ; ebx = text of fasmError code in eax push eax call err.text mov ebx,eax ; display 'Error: ' push _error push stream.stderr call text.write ; display fasmError message push ebx push stream.stderr call text.write ; unitialize modules call stream.uninit call mem.uninit ; exit with code '1' push 1 call process.exit |
|||
24 May 2007, 14:06 |
|
vid 24 May 2007, 14:32
next time use [ code ] tags around to code
going to look into it |
|||
24 May 2007, 14:32 |
|
rkamarowski 24 May 2007, 14:36
i was wondering how to do that: [ code ]
thanks. |
|||
24 May 2007, 14:36 |
|
vid 24 May 2007, 14:36
your code pushes stream.read instead of stream.stdin
But your first post said it pushes proper stream.stdin so you helped me find bug by mistake |
|||
24 May 2007, 14:36 |
|
rkamarowski 24 May 2007, 14:40
uhhh. i forgot i had changed it (trying different ways). it's working now.
thank you vid! |
|||
24 May 2007, 14:40 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.