pouët.net

Random line of code thread

category: code [glöplog]
nop
added on the 2008-07-21 15:52:07 by havoc havoc
Code: #define BeginProgram void main(int argc, char *argv[]) #define CloseBrace } #define CommandLineArgument -1 #define Declare int i,j,n,Flag=1; #define EndOfProgram return; #define False 0; #define ForLoop ;for #define GetCommandLineArgument n=atoi(argv[1]); #define i F1ag #define If if #define Increment ++ #define Is == #define LessThan *(c&64)* #define LessThanOrEqualTo != #define Modulo % #define OpenBrace { #define PossibleFactor j #define PossiblePrime i #define Possib1ePrime (c=getchar()) #define PrimeNumber (c^(!i*n%64)); #define Print putchar #define SetTo = #define SmallestPrime 2 #define True 1 #define Variables char c; #define Zero i%j BeginProgram OpenBrace Declare Variables GetCommandLineArgument ForLoop (PossiblePrime SetTo SmallestPrime ; Possib1ePrime LessThanOrEqualTo CommandLineArgument ; Increment PossiblePrime) OpenBrace F1ag SetTo True ForLoop (PossibleFactor SetTo SmallestPrime ; PossibleFactor LessThan PossiblePrime ; Increment PossibleFactor) If (PossiblePrime Modulo PossibleFactor Is Zero) F1ag SetTo False If (Flag Is True) Print PrimeNumber CloseBrace EndOfProgram CloseBrace
added on the 2008-07-21 17:00:00 by hashdash hashdash
*/
added on the 2008-07-21 17:17:43 by doomdoom doomdoom
Code: If Not Page.IsPostBack Then Dim objConn As New SqlConnection(strConn) objConn.Open() Dim objCmd As New SqlCommand objCmd.Connection = objConn objCmd.CommandType = CommandType.StoredProcedure objCmd.CommandText = "spGetAppUsers" Dim objDR As SqlDataReader = objCmd.ExecuteReader slcViewAs.Items.Clear() While objDR.Read Dim opt As New ListItem opt.Text = objDR("UserGroupName") opt.Value = objDR("UserGroupId") slcViewAs.Items.Add(opt) End While objDR.Close() objConn.Close() End If
added on the 2008-07-21 17:30:03 by Alpha C Alpha C
Synchron code is forever.. :)

Code: move.w #$ 2100,sr stop #$ 2100 move.w #$ 2700,sr clr.b $fffffa19.w lea $ffff8209.w,a6 moveq #127,d3 move.b #2,$ffff820a.w .sync: tst.b (a6) beq.s .sync move.b (a6),d2 sub.b d2,d3 lsr.l d3,d3

added on the 2008-07-21 17:42:49 by evil evil
PDP-8 style in a loop:
Code:PC=0; ACC=0; puts("cpuemu16 - Test"); while(running) { /* opcode fetch */ opcode=memory[PC] & 0xffff; address=(opcode & 0x0FFF); /* extract address field*/ /* operand fetch */ indirect_mode=(opcode & INDIRECT_BIT); if(indirect_mode>0) { indirect='I'; operand=memory[memory[address]]; wb_address=memory[address]; } else { operand=memory[address]; wb_address=address; indirect=' '; } /* debug */ printf("ACC=%4x PC=%3x %4x ",ACC,PC,opcode); PC++; /* execute */ switch(opcode & 0xE000) { case INSTRUCTION_OR: /* logic OR */ printf(" OR %c %3x",indirect,address); ACC=ACC|operand; break; case INSTRUCTION_AND: /* logic AND */ printf("AND %c %3x",indirect,address); ACC=ACC & operand; break; case INSTRUCTION_ADD: /* 2 complements ADD */ printf("ADD %c %3x",indirect,address); ACC=ACC+operand; break; case INSTRUCTION_DSZ: /* decrement and skip if zero */ printf("DSZ %c %3x %d",indirect,address,memory[199]); operand--; memory[wb_address]=operand; if(operand==0) PC++; /* skip next if zero */ break; case INSTRUCTION_SCA: /* store and clear ACC afterwards */ printf("SCA %c %3x",indirect,address); memory[wb_address]=ACC; ACC=0; break; case INSTRUCTION_JL: /* jump and link */ /* deposits current PC at the given address and sets PC to that location+1 */ printf(" JL %c %3x",indirect,address); memory[wb_address]=PC; /* deposit old PC */ printf(" (backjump to %x)",memory[wb_address]); PC=wb_address+1; /* set new PC */ break; case INSTRUCTION_JMP: /* jump unconditionally */ printf("JMP %c %3x",indirect,address); PC=address; break; case INSTRUCTION_MULTI: /* multipurpose instruction */ /* the multi instruction is encoded onehot into the lower byte * each invalid opcode is treated as a NOP */ switch(opcode & 0x00ff) { case OPCODE_HALT: printf("HALT\n"); /* memory dump on machine halt */ for(j=0;j<256;j++) { printf("%3x: ",j*16); for(i=0;i<16;i++) printf("%4x ",memory[j*16+i]); putchar('\n'); } running=FALSE; break; case OPCODE_CPLA: printf("CPL A"); ACC=~ACC; break; case OPCODE_CLRA: printf("CLR A"); ACC=0; break; case OPCODE_SHLA: printf("SHL A"); ACC=ACC<<1; break; case OPCODE_SHRA: printf("SHR A"); ACC=ACC>>1; break; case OPCODE_INCA: printf("INC A"); ACC++; break; case OPCODE_SKPZ: printf("SKPZ A"); if(ACC==0) PC++; break; case OPCODE_SKNZ: printf("SKNZ A"); if(ACC!=0) PC++; break; default: printf("NOP"); break; } break; default: /* this case should never ever be reached! */ puts("ILLEGAL OPCODE!"); } }
PULU
added on the 2008-07-21 20:01:43 by Marq Marq
Code: if (foo) { bar(false); } else { bar(true); }
added on the 2008-07-21 21:03:57 by Joghurt Joghurt
CLS
added on the 2008-07-21 22:11:32 by bdk bdk
10 REM Scooter Strobo Power Intro
20 A=1
30 A=1-A
40 POKE53281,A (please insert your local backgroundcolor-registeraddress in here)
50 GOTO 30
RUN

Now let's wave the Hands to the Beat!
added on the 2008-07-21 22:25:52 by vscd vscd
CLI
HLT
added on the 2008-07-22 00:02:24 by Joghurt Joghurt
Code: </Panel>

added on the 2008-07-22 00:15:23 by xyz xyz
rep stosb ; I thought this thread was about only 1 line of code??
added on the 2008-07-22 04:34:50 by ferris ferris
times, they are changing
added on the 2008-07-22 05:17:31 by waffle waffle
UnderØATH had a CD called The Changing of Times :D...


... oh yeah and:

xor ax,ax
added on the 2008-07-22 10:44:40 by ferris ferris
Overscan is forever :)

Code: moveq #0,d7 moveq #2,d6 ;-------------- dcb.w 6,$4e71 move.b d6,$ffff8260.w move.b d7,$ffff8260.w dcb.w 90,$4e71 move.b d7,$ffff820a.w move.b d6,$ffff820a.w dcb.w 10,$4e71 move.b d6,$ffff8260.w move.b d7,$ffff8260.w dcb.w 4,$4e71
added on the 2008-07-22 11:02:58 by evil evil
defer n! : n! ( n1 -- n2 ) dup 1 > if dup 1- n! * then ; ." 10! = " 10 n! . bye
added on the 2008-07-22 11:13:16 by mic mic
Code:echo (get_config("debug") && get_config("debug_prevent_redirect"))?"<p><a href=\"".$url."\">Redir « " . $url ."</a> (with".($postback?"":"out")." postback)".((get_config("debug_show_stacks", false))?"<p><pre>".debug_backtrace()."</pre></p>":""):"";
added on the 2008-07-22 11:18:42 by Jcl Jcl
random line of coke
added on the 2008-07-22 11:23:43 by pandur pandur
public function __construct($bDebug = false) {
$this->bDebug = $bDebug;
}
added on the 2008-07-22 18:06:58 by stijn stijn
dc.w $ffff,$fffe
added on the 2008-07-22 20:39:20 by bizun_ bizun_
iir :: Num b => Int -> (Stream a -> Stream b -> Stream b) -> Stream a -> Stream b
iir n f xs = ys where ys = f xs (delay n ys)
added on the 2008-07-22 21:01:36 by blala blala
;42!=405006117752879898543142606244511569936384000000000
INPUT COPY PRINT "!=" ! PRINT END
#! COPY SKIP>0 !end COPY 1 - ! * END .!end DROP 1 END
added on the 2008-07-22 21:18:55 by baah baah
SELECT salary FROM employees WHERE salary>=100000;

0 lines found
added on the 2008-07-22 22:27:32 by pmdata pmdata
Quote:

10 Print Hallo
20 Goto 10
run
added on the 2008-07-22 23:01:09 by .. ..

login