flat assembler
Message board for the users of flat assembler.

Index > Linux > learn see - 32b with fasm example

Author
Thread Post new topic Reply to topic
catafest



Joined: 05 Aug 2010
Posts: 120
catafest
Hello. I make a simple example (using 32). This read some integers and I want to using with SSE , but I don't know to make this .
This is a test.txt file :
Code:
$ cat test.txt 
12 23 33
23 34 44
45 22 55
34 45 22    

Also , my asm example is this:
Code:
format elf

extrn 'fopen' as fopen:dword
extrn 'feof' as feof:dword
extrn 'fscanf' as fscanf:dword
extrn 'printf' as printf:dword
extrn 'exit' as exit:dword

public main

section '.data' writable

file_ptr rd 1
integer rd 1
file_name db "test.txt",0
mode db "r",0
fmt_in db " %d ",0
fmt_out db "Read number %d",10,0

section '.text' executable

main:

push mode
push file_name
call fopen
add esp, 8
mov [file_ptr], eax

.loop_start:

push [file_ptr]
call feof
add esp, 4
cmp eax, 0
jnz .exit_loop

push integer
push fmt_in
push [file_ptr]
call fscanf
add esp, 12

push [integer]
push fmt_out
call printf
add esp, 8

jmp .loop_start

.exit_loop:

push 0
call exit     


The big problem is how to set to working with sse ( using mnemonics of sse ).
Thank you. Regards.
Post 26 Dec 2012, 18:09
View user's profile Send private message Visit poster's website Yahoo Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.