Page 54 of 56

Re: Random

Posted: Tue Jun 02, 2020 12:44 pm
by Talvieno
Ahhhh, that's probably the day bots happened. Bots have happened a lot. There were a couple other dates before May 3rd, mostly bot-driven.

Re: Random

Posted: Tue Jun 02, 2020 12:45 pm
by Idunno
Talvieno wrote:
Tue Jun 02, 2020 12:44 pm
Ahhhh, that's probably the day bots happened. Bots have happened a lot. There were a couple other dates before May 3rd.
I missed the robot invasion? :shock:

Re: Random

Posted: Tue Jun 02, 2020 12:46 pm
by Talvieno
You missed several. :ghost: We've been flooded by bots from Yandex and a few other sources. Most of them don't do much, but sometimes they do try to post. That's why we have Taiya. She's a bot that kills bots. :D She's also the IRC hostess.

Re: Random

Posted: Tue Jun 02, 2020 12:47 pm
by Idunno
Talvieno wrote:
Tue Jun 02, 2020 12:46 pm
You missed several. :ghost: We've been flooded by bots from Yandex and a few other sources. Most of them don't do much, but sometimes they do try to post. That's why we have Taiya. She's a bot that kills bots. :D She's also the IRC hostess.
Have we launched a counter invasion? :think:

Re: Random

Posted: Tue Jun 02, 2020 1:10 pm
by Silverware
Idunno wrote:
Tue Jun 02, 2020 12:47 pm
Talvieno wrote:
Tue Jun 02, 2020 12:46 pm
You missed several. :ghost: We've been flooded by bots from Yandex and a few other sources. Most of them don't do much, but sometimes they do try to post. That's why we have Taiya. She's a bot that kills bots. :D She's also the IRC hostess.
Have we launched a counter invasion? :think:
If you count goatbot, then no.

Re: Random

Posted: Tue Jun 02, 2020 1:17 pm
by Idunno
Silverware wrote:
Tue Jun 02, 2020 1:10 pm
Idunno wrote:
Tue Jun 02, 2020 12:47 pm
Talvieno wrote:
Tue Jun 02, 2020 12:46 pm
You missed several. :ghost: We've been flooded by bots from Yandex and a few other sources. Most of them don't do much, but sometimes they do try to post. That's why we have Taiya. She's a bot that kills bots. :D She's also the IRC hostess.
Have we launched a counter invasion? :think:
If you count goatbot, then no.
Do we have the industrial capacity to launch a counter offensive? :think:

More to the point, does anybody but me care? :ghost:

Re: Random

Posted: Fri Jun 19, 2020 7:50 pm
by Idunno
Gonna take that as a no. :ghost:

Does anybody know assembly? :?:

Re: Random

Posted: Fri Jun 19, 2020 8:30 pm
by Talvieno
Josh did! I learned, but I forgot. :D

Re: Random

Posted: Sat Jun 20, 2020 1:27 pm
by Idunno
Talvieno wrote:
Fri Jun 19, 2020 8:30 pm
Josh did! I learned, but I forgot. :D
Maybe an extra set of eyes will help. :ghost:

Can you see a problem in the following code?
section .data
p db 'helloworld.txt', 0
msg db 'hello world'
len equ $ - msg
section .bss
msg1: resb 64
section .text
global _start
_start:

mov rax, 2 ;Opening file
mov rdi, p
mov rsi, 2
syscall
mov rdi, rax ;writing to file
mov rax, 1
mov rsi, msg
mov rdx, len
syscall
mov rax, 2 ;opening file again
mov rdi, p
mov rsi, 0
syscall
mov rax, 0 ;reading from file
mov rdi, p
mov rsi, msg1
mov rdx, 11
syscall
mov rax, 3 ;closing file
mov rdi, p
syscall

mov rax, 60 ;ending program
syscall

Re: Random

Posted: Sat Jun 20, 2020 2:14 pm
by Detritus
My goodness. He's already teaching Tal a thing or two! :o

Re: Random

Posted: Sat Jun 20, 2020 2:49 pm
by Idunno
Detritus wrote:
Sat Jun 20, 2020 2:14 pm
My goodness. He's already teaching Tal a thing or two! :o
I wish I was good enough to teach. :monkey:

So, I have found my problem, and it's the dumbest thing. In-order to write and read from a file in assembly, you have to reopen it after you do one or the other, making the 0_RDWR flag completely worthless. Why would I ever use a flag that allows me to do two things at once, when I can't do two things at once? :?: Here's the code, for anyone who's interested, to amuse themselves with.

section .data
p db 'helloworld.txt', 0
msg db 'hello world'
len equ $ - msg
section .bss
msg1: resb 64
section .text
global _start
_start:

mov rax, 2 ;open file
mov rdi, p ;file descriptor
mov rsi, 2 ;0_RDWR flag
syscall
mov rdi, rax ;move the file descriptor into RDI, because you can't do that manually for some reason
mov rax, 1 ;sys_write
mov rsi, msg ;content
mov rdx, len ;content length
syscall
mov rax, 2 ;open file again
mov rdi, p ;file descriptor
mov rsi, 2 ;0_RDWR flag
syscall
mov rdi, rax ;And we'll do it again
mov rax, 0 ;sys_read
mov rsi, msg1 ;variable to place content into
mov rdx, 11 ;length to read
syscall
mov rax, 3 ;close file, something that seems pointless because it doesn't work
mov rdi, p ;file descriptor
syscall
mov rax, 1 ;sys_write
mov rdi, 1 ;set to output
mov rsi, msg1 ;content
mov rdx, 64 ;content's potential length
syscall

mov rax, 60 ;die :ghost:
syscall

Re: Random

Posted: Wed Jul 15, 2020 4:01 am
by Idunno
Hello, I'm back, soliciting more programming advice from good, hardworking... I was going somewhere with this I swear. :silent:

How do I make this function return zero when x is greater then 700? :think:

Code: Select all

	double e=2.71828;
	double k=0;
	if (x<700){
		double j=pow(e, x);
		double l=j+1;
		double h=pow(l,2);
		k=j/h;
	}
	return k;

Re: Random

Posted: Wed Jul 15, 2020 4:42 am
by Dinosawer

Code: Select all

if (x>700){
    return 0;
}
:ghost:

Re: Random

Posted: Wed Jul 15, 2020 4:58 am
by Idunno
Dinosawer wrote:
Wed Jul 15, 2020 4:42 am

Code: Select all

if (x>700){
    return 0;
}
:ghost:
I'd love to say that worked, but it didn't. Still got NaN.:ghost:

Re: Random

Posted: Wed Jul 15, 2020 7:03 am
by Dinosawer
Then you did it wrong. What's your entire code now?