Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Code that does nothing forever...
Goto page 1, 2  Next
 
Post new topic   Reply to topic Printable version
 View previous topic  RC Movies Post :: Post One more post  View next topic  
Author Message
k0zy
Server Help Squatter


Gender:Gender:Male
Joined: Jan 11 2003
Posts: 571
Location: Germany
Offline

PostPosted: Wed Apr 07, 2004 2:10 pm   Post maybe stupid    Post subject: Code that does nothing forever... Reply to topic Reply with quote

I was bored... so I coded a few programs or scripts that do nothing forever...

In c++:
Code: Show/Hide
int main() {
  while (1) { ; }
}


In python:
Code: Show/Hide
while 1: pass


In assembly (for MFA):
Code: Show/Hide
.org 0E00h
start: MVI C,0FFh
NOP
DCR C
JZ start
.end


What languages do you know?
And how do you make then do nothing forever?

Bob Dole.. Bob Dole... Bob Dole...... bob dole.... bob... dole....
_________________
It's a shark! Oh my god! Unbelievable!
Back to top
View users profile Send private message Add User to Ignore List
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Wed Apr 07, 2004 2:41 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

java:

while(true)

or you could do like
for(int i = 1; i > 0; i++)
_________________

Back to top
View users profile Send private message Add User to Ignore List Visit posters website
-Smong-
Guest


Offline

PostPosted: Wed Apr 07, 2004 2:49 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Code: Show/Hide
while(1);
Back to top
Gravitron
VIE Vet


Age:43
Gender:Gender:Male
Joined: Aug 02 2002
Posts: 993
Location: Israel
Offline

PostPosted: Wed Apr 07, 2004 2:59 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Good ol' GWBasic:
Code: Show/Hide

100 Go 100

$
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address Yahoo Messenger MSN Messenger
Dustpuppy
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Jan 23 2003
Posts: 215
Location: England
Offline

PostPosted: Wed Apr 07, 2004 3:36 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Befunge:

Code: Show/Hide
><

_________________
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
k0zy
Server Help Squatter


Gender:Gender:Male
Joined: Jan 11 2003
Posts: 571
Location: Germany
Offline

PostPosted: Wed Apr 07, 2004 3:43 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Any other commands that do nothing? icon_wink.gif

c:
Code: Show/Hide
;

python:
Code: Show/Hide
pass

assembly:
Code: Show/Hide
NOP
Back to top
View users profile Send private message Add User to Ignore List
Dustpuppy
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Jan 23 2003
Posts: 215
Location: England
Offline

PostPosted: Wed Apr 07, 2004 3:49 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Does continue (C++) count? tongue.gif
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
k0zy
Server Help Squatter


Gender:Gender:Male
Joined: Jan 11 2003
Posts: 571
Location: Germany
Offline

PostPosted: Wed Apr 07, 2004 3:59 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

continue actually does something icon_razz.gif
Back to top
View users profile Send private message Add User to Ignore List
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Wed Apr 07, 2004 4:34 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Code: Show/Hide
HANDLE h;

h = CreateObject(CONTINUUM_40);
WaitForSingleEvent(h, INFINITE);

_________________
4,691 irradiated haggis!
Back to top
View users profile Send private message Add User to Ignore List
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:42
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3615
Location: Las Vegas
Offline

PostPosted: Wed Apr 07, 2004 5:11 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Mr Ekted wrote:
Code: Show/Hide
HANDLE h;

h = CreateObject(CONTINUUM_39_OFFICIAL);
WaitForSingleEvent(h, INFINITE);

Fixed it for you.

And for asmembly, jumping to the jump command is a much faster nothingness.
Back to top
View users profile Send private message Add User to Ignore List Send email
MGG
Guest


Offline

PostPosted: Wed Apr 07, 2004 5:27 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

EB FE

icon_biggrin.gif
Back to top
50% Packetloss
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Sep 09 2003
Posts: 561
Location: Santa Clarita, California
Offline

PostPosted: Wed Apr 07, 2004 6:22 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Every program does something, even NOP increments the program counter

-ASM for the Motorola 6800
0000 BRA (20)
0001 02

-C
Bob:
goto Bob;
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
liito-orava
Novice


Gender:Gender:Male
Joined: Sep 24 2003
Posts: 41
Offline

PostPosted: Wed Apr 07, 2004 6:25 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

50% Packetloss wrote:

-C
Bob:
goto Bob;

That's so ugly. :/
_________________
"Do you hear that? That is the sound of nobody giving a fuck!"
Wolfix> Lesbian transvestites trapped in man's bodies spanking their monkeys to freq 395
Back to top
View users profile Send private message Add User to Ignore List
k0zy
Server Help Squatter


Gender:Gender:Male
Joined: Jan 11 2003
Posts: 571
Location: Germany
Offline

PostPosted: Wed Apr 07, 2004 6:50 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

50% Packetloss wrote:
Every program does something, even NOP increments the program counter


Would be painfull if it didn't increase the program counter! icon_wink.gif
Usually NOP is used to wait 4 cpu clock cycles... which is nothing...

Bob Dole.. Bob Dole... Bob Dole...... bob dole.... bob... dole....
Back to top
View users profile Send private message Add User to Ignore List
Helicon
Server Help Squatter


Joined: Dec 03 2002
Posts: 771
Location: GNU Doldrums
Offline

PostPosted: Wed Apr 07, 2004 8:00 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

D1st0rt wrote:
for(int i = 1; i > 0; i++)


this just runs until the int ceiling value... it stops
_________________
Signatures just seem so quaint.
Back to top
View users profile Send private message Add User to Ignore List
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Wed Apr 07, 2004 10:40 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

50% Packetloss wrote:
Every program does something, even NOP increments the program counter


EB FE doesn't increment the program counter.
Back to top
View users profile Send private message Add User to Ignore List
Qndre's Metaspace
Guest


Offline

PostPosted: Thu Apr 08, 2004 3:12 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

BASIC:
Code: Show/Hide

DO
LOOP
Back to top
k0zy
Server Help Squatter


Gender:Gender:Male
Joined: Jan 11 2003
Posts: 571
Location: Germany
Offline

PostPosted: Thu Apr 08, 2004 7:11 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

Mr Ekted wrote:
[..]



EB FE doesn't increment the program counter.


What's EB FE?
Back to top
View users profile Send private message Add User to Ignore List
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Thu Apr 08, 2004 11:59 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

Bob Dole.. Bob Dole... Bob Dole...... bob dole.... bob... dole.... wrote:
What's EB FE?


It's Intel machine code for:

label: jmp label
Back to top
View users profile Send private message Add User to Ignore List
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Thu Apr 08, 2004 1:52 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Bob Dole.. Bob Dole... Bob Dole...... bob dole.... bob... dole.... wrote:
Usually NOP is used to wait 4 cpu clock cycles...Bob Dole.. Bob Dole... Bob Dole...... bob dole.... bob... dole....


NOP has never taken 4 clock cycles. Pentium it is less than 1, 486 was 1, 386/286/86 was 3. Writing code that assumes a certain number of cpu clocks is very bad.
Back to top
View users profile Send private message Add User to Ignore List
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:42
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3615
Location: Las Vegas
Offline

PostPosted: Thu Apr 08, 2004 4:23 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Mr Ekted wrote:
Writing code that assumes a certain number of cpu clocks is very bad.

I see no problem when playing DigDug. You just have to be a better player.
Back to top
View users profile Send private message Add User to Ignore List Send email
Dr Brain
Flip-flopping like a wind surfer


Age:39
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Thu Apr 08, 2004 4:49 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Or, do what normal people do, underclock their CPU.
_________________
Hyperspace Owner

Smong> so long as 99% deaths feel lame it will always be hyperspace to me
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
k0zy
Server Help Squatter


Gender:Gender:Male
Joined: Jan 11 2003
Posts: 571
Location: Germany
Offline

PostPosted: Thu Apr 08, 2004 4:58 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Mr Ekted wrote:
[..]



NOP has never taken 4 clock cycles. Pentium it is less than 1, 486 was 1, 386/286/86 was 3. Writing code that assumes a certain number of cpu clocks is very bad.


We learned assembly at school for programming MFAs (8085). And I'm sure that NOP just waits a few clock cycles. I thought it was 4, I have to look it up in my book.

EDIT: Yeah, my books says: NOP / No operation / 1 byte / 4 clock cycles

Bob Dole.. Bob Dole... Bob Dole...... bob dole.... bob... dole....
Back to top
View users profile Send private message Add User to Ignore List
pixelsoft
Seasoned Helper


Age:38
Gender:Gender:Male
Joined: Apr 15 2003
Posts: 154
Location: Vienna
Offline

PostPosted: Sun Apr 11, 2004 5:59 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

php:
Code: Show/Hide
<?php
//
?>

_________________
i don't have anything important to say
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
Sercit
99.5% Optimistic


Age:41
Gender:Gender:Cat Lover
Joined: Sep 12 2003
Posts: 352
Offline

PostPosted: Sun Apr 11, 2004 6:25 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

You know your a coder with too much time on your hands, and no porn at the ready, when you type up codes that do nothing, forever. tongue.gif
_________________
Signature.
Back to top
View users profile Send private message Add User to Ignore List
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Trash Talk All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can 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
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 145 page(s) served in previous 5 minutes.

phpBB Created this page in 0.705634 seconds : 49 queries executed (78.3%): GZIP compression disabled