Lurker News
Preferably an elegant snippet rather than an entire (well engineered) codebase.

Comments (380) 116 threads

Earlier comments
hazeii#
Recursive gem in PDP-11 assembler: convert binary value in R0 into ASCII:-

  CNV10: MOV R0,-(SP)    ;Converts binary value
         CLR R0          ;in R0 to ASCII in buffer
  1$:    INC R0          ;pointed to R1
         SUB #10.,@SP
         BGE 1$
         ADD #72,@SP
         DEC R0
         BEQ 2$
         CALL CNV10
  2$:    MOVB (SP)+,(R1)+
         RETURN
alex-ant#
Had a case where I needed to update MySQL column's value if an incoming argument is less/greater than it without using functions or procedures.

This returns the greatest value (passed ? or max_value column):

  ?^((?^max_value)&-(?
And for minimum:

  min_value^((?^min_value)&-(?

Load more comments