News for hackers. Stuff that matters.
Re:What is the coolest thing you can do in ten lines of code? by biot on Friday December 30, 2011 @07:41PM (#3409704)
Less than 10 bytes of code on an Apple II:

  ] CALL -151
  * 300: AD 30 CO 20 ED FD 4C 00 03
  * 300G
Enjoy! For bonus points, get this down to 8 bytes.
Re:What is the coolest thing you can do in ten lines of code? by mmphosis on Saturday December 31, 2011 @04:24PM (#3411898)
; initialize

  CALL -151
  1000:BA 8A A8 49 80 AA 9A A9 2 48 A9 FF 48 BA 86 6 98 AA 9A A6 6 A9 30 85 6 A9 C0 85 7 A0 0 0 N 1000G
; six bytes!

  300:9A B1 6 4C ED FD
  300G
Re:What is the coolest thing you can do in ten lines of code? by mkramlich on Friday December 30, 2011 @09:59PM (#3409972)
I used to do that kind of hacking in the 80's. I recognized the CALL-151. I have an old Apple II+ in the other room I'm tempted to try firing up just to solve this mystery.
Re:What is the coolest thing you can do in ten lines of code? by mmphosis on Saturday December 31, 2011 @12:34AM (#3410253)

  NEW
  1HOME:A=9200:B=13168:C=100:FORI=768TO796:READN:POKEI,N:NEXT:HGR:POKE-16302,0:HCOLOR=4:HPLOT0,0:CALL62454:HCOLOR=2:HPLOT0,63TO279,63:HPLOT0,62TO279,62:HCOLOR=6:HPLOT0,61TO279,61:HPLOT0,60TO279,60:HCOLOR=1:HPLOT0,59TO279,59:HPLOT0,58TO279,58
  2HCOLOR=5:HPLOT0,55TO279,55:HPLOT0,54TO279,54:HCOLOR=0:HPLOT0,123TOC,123:HPLOT0,122TOC,122:HPLOT0,119TOC,119:HPLOT0,118TOC,118:COLOR=0:FORI=0TO39:VLIN0,39ATI:NEXT:COLOR=13:HLIN0,39AT14:FORI=0TO7:POKEA+I,0:POKEB+I,0:NEXT:COLOR=1
  3HLIN0,39AT13:VTAB21:PRINTTAB(16)"RAINBOW":PRINT:PRINT"MIXED GRAPHICS (HI-RES/COLOR)":CALL768:DATA173,87,192,173,83,192,173,84,192,173,80,192,208,251,173,86,192,160,22,136,208,253,234,173,87,192,76,9,3
  RUN
Re:What is the coolest thing you can do in ten lines of code? by cschneid on Saturday December 31, 2011 @12:20AM (#3410226)
For people who didn't hack apple IIs, can you expand on what's going on there?
Re:What is the coolest thing you can do in ten lines of code? by mmphosis on Saturday December 31, 2011 @12:42AM (#3410263)
; enter the machine language monitor

  CALL -151
; toggle the speaker and load the accumulator with the "floating bus" value--the byte last read by the video refresh controlled by the video scanner.

  0300-   AD 30 C0   LDA $C030
; print the accumulator as a character

  0303-   20 ED FD   JSR $FDED
; repeat (loop by going to 0x300)

  0306-   4C 00 03   JMP $0300
; run it! (0x300 Go; just like G in your debugger)

  300G
Running this will display random characters and make noise.
Re:What is the coolest thing you can do in ten lines of code? by CamperBob on Saturday December 31, 2011 @12:06AM (#3410212)
Should be able to use a two-byte BEQ, BNE, BCC, BCS, or something like that instead of the jump, depending on what COUT returns.