Search found 52 matches

by IchMagBier
Aug 01, 2018 11:35
Forum: General
Topic: Slow opening and closing of files
Replies: 26
Views: 1875

Re: Slow opening and closing of files

Your link leads me to "Error 500: This page is unavailable". How did you compile your code? What does the following mean? "=r" (time_high_start), "=r" (time_low_start):: "%rax", "%rdx" Does it mean it saves rax in time_high_start and rdx in time_low_...
by IchMagBier
Aug 01, 2018 4:26
Forum: General
Topic: Slow opening and closing of files
Replies: 26
Views: 1875

Slow opening and closing of files

Hello :) So I was writing some text to a file and saw that open and close take a lot more time than actually writing to the file. Even writing several megabytes is still faster than opening and closing. I wonder why and if there maybe is a faster way? I used this code to measure the time (64bit only...
by IchMagBier
Jul 11, 2018 8:35
Forum: General
Topic: Saving top half ot array/stack
Replies: 6
Views: 666

Re: Saving top half ot array/stack

Ah nice, thank you!
I knew it could be simple.
by IchMagBier
Jul 11, 2018 7:59
Forum: General
Topic: Saving top half ot array/stack
Replies: 6
Views: 666

Re: Saving top half ot array/stack

The lower part needs to be completly gone. I am saving the "history" of files (I don't know the right word for it. The text you can redo/undo via Ctrl+Z/Y) in that stack and I don't want it to grow to an infinite size.
by IchMagBier
Jul 11, 2018 4:34
Forum: General
Topic: Saving top half ot array/stack
Replies: 6
Views: 666

Saving top half ot array/stack

Hello I have a problem. I wrote a "stack"-class, where you can push and pop strings. This works well, however I want to prevent the stack getting to big. So when the stack reaches the size 6, I want to cut off the lower half, but I don't want to loose the top half. How would I do that? I t...
by IchMagBier
Jun 20, 2018 9:16
Forum: Linux
Topic: Best Distro for FB
Replies: 38
Views: 14241

Re: Best Distro for FB

The biggest problem with Linux and FB is "libtinfo". I am using Debian for coding and when I want to run my programs on Fedora, CentOS or Ubuntu, it complains about libtinfo being not the version it needs (on some systems, especially newer ones, libtinfo isn't even installed by default). S...
by IchMagBier
May 05, 2018 4:32
Forum: General
Topic: Calling opcodes
Replies: 10
Views: 559

Re: Calling opcodes

I found out, what the problem was. You need some memory marked as executable. On Linux, you need to use "mmap" for that. I got it working with a lot of inline-ASM: dim as ubyte ptr function_in_memory asm xor rdi, rdi 'address = 0 mov rsi, 4096 'length of the array mov rdx, 7 'read OR write...
by IchMagBier
May 04, 2018 19:32
Forum: General
Topic: Calling opcodes
Replies: 10
Views: 559

Re: Calling opcodes

This crashes on 64 bit fbc win 10 Works fine for me on Linux. The statement by you, is by far to fuzzy to make sense, do you have a more "in depth explanation" ? I want to write a JIT-Compiler for a script-language. The compiler generates x86-opcodes out of the script and saves them insid...
by IchMagBier
May 04, 2018 19:20
Forum: General
Topic: Calling opcodes
Replies: 10
Views: 559

Re: Calling opcodes

I need to compile some stuff during runtime and can't do that with inline ASM alone.
by IchMagBier
May 04, 2018 19:05
Forum: General
Topic: Calling opcodes
Replies: 10
Views: 559

Calling opcodes

Hello Is it somehow possible to call x86-opcodes with FreeBasic? Something like "CALL ABSOLUTE" in QBasic? I tried the following: dim as ubyte test(0)={&hC3} dim as ubyte ptr test_call=@test(0) asm call [test_call] But it is crashing with a "Segmentation fault" on my 64bit Li...
by IchMagBier
May 01, 2018 4:43
Forum: Tips and Tricks
Topic: Binary data visualization with OpenGL
Replies: 5
Views: 1153

Re: Binary data visualization with OpenGL

Might be even more interesting to have the program inspect the data while it was reading it and create a key that displayed which datatype belonged to which color... so you would know what you were looking at without having to bring up a hex viewer on some large program. Might have to parse the fil...
by IchMagBier
Apr 30, 2018 14:06
Forum: Tips and Tricks
Topic: Binary data visualization with OpenGL
Replies: 5
Views: 1153

Binary data visualization with OpenGL

Hello After finding this , I decided to write my own "renderer" for binary data. Its just about 70 lines of FB/GL-Code: #include once "GL/gl.bi" #include once "GL/glu.bi" var ff=freefile open "SOME FILE" for binary as #ff <- Change this to a valid filepath dim...
by IchMagBier
Apr 20, 2018 11:23
Forum: Tips and Tricks
Topic: Pipes screensaver for console
Replies: 2
Views: 708

Pipes screensaver for console

http://fs1.directupload.net/images/180420/7itumpnb.png Some sort of "screensaver" for your console/terminal. Based on Yu-Jie Lin's "pipes.sh" , but cooler, since it's written in FreeBasic. Maybe someone rembembers the old Windows 98 OpenGL-screensaver with those pipes? const num...
by IchMagBier
Jan 19, 2018 3:12
Forum: Tips and Tricks
Topic: Routines to write syntax highlighted code
Replies: 46
Views: 27557

Re: Routines to write syntax highlighted code

Lines 3-5 are commented out in the C-Code, that's why they appear gray.

Operators are the same for all languages. I don't want to change that, but I fixed a bug with them and added some more "operators": . , %
by IchMagBier
Jan 17, 2018 12:47
Forum: Tips and Tricks
Topic: Routines to write syntax highlighted code
Replies: 46
Views: 27557

Re: Routines to write syntax highlighted code

It can handle comment blocks. What do you mean "the C section doesn't work correct"? I don't see any problems there.

Go to advanced search