00:00:00 --- log: started forth/16.09.26 00:26:59 --- join: mnemnion (~mnemnion@71.198.73.193) joined #forth 00:31:23 --- quit: mnemnion (Ping timeout: 244 seconds) 00:39:45 --- join: dys (~dys@ip-109-44-0-233.web.vodafone.de) joined #forth 00:47:09 --- quit: nal (Quit: WeeChat 1.4) 00:58:16 --- join: mnemnion (~mnemnion@71.198.73.193) joined #forth 01:02:56 --- quit: mnemnion (Ping timeout: 265 seconds) 01:50:31 --- nick: eldre_ -> eldre 02:17:18 --- quit: proteusguy (Ping timeout: 244 seconds) 02:24:33 --- quit: nighty (Quit: Disappears in a puff of smoke) 02:33:56 --- join: mnemnion (~mnemnion@71.198.73.193) joined #forth 02:35:39 --- join: true-grue (~true-grue@176.14.222.10) joined #forth 02:38:37 --- quit: mnemnion (Ping timeout: 265 seconds) 02:53:43 --- join: Indecipherable (~Howl@41.162.98.122) joined #forth 03:03:01 --- join: proteusguy (~proteusgu@14.207.10.75) joined #forth 03:03:01 --- mode: ChanServ set +v proteusguy 03:28:12 --- join: nighty (~nighty@s229123.ppp.asahi-net.or.jp) joined #forth 04:03:23 --- join: mnemnion (~mnemnion@71.198.73.193) joined #forth 04:08:24 --- quit: mnemnion (Ping timeout: 272 seconds) 04:40:24 --- quit: sebboh (Remote host closed the connection) 04:40:40 --- join: sebboh (~user@fsf/member/Sebboh) joined #forth 04:56:38 --- quit: sebboh (Remote host closed the connection) 04:56:53 --- join: sebboh (~user@fsf/member/Sebboh) joined #forth 05:26:39 --- join: rgrinberg (~rgrinberg@24-246-56-85.cable.teksavvy.com) joined #forth 05:27:42 --- quit: rgrinberg (Client Quit) 05:28:04 --- join: rgrinberg (~rgrinberg@24-246-56-85.cable.teksavvy.com) joined #forth 05:55:28 --- join: mnemnion (~mnemnion@71.198.73.193) joined #forth 06:00:16 --- quit: mnemnion (Ping timeout: 264 seconds) 06:30:38 --- quit: proteusguy (Ping timeout: 265 seconds) 06:34:55 --- join: mnemnion (~mnemnion@71.198.73.193) joined #forth 06:39:41 --- quit: mnemnion (Ping timeout: 255 seconds) 06:57:28 --- join: rprimus (~micro@a9.lence.net) joined #forth 07:16:05 --- join: proteusguy (~proteusgu@14.207.10.75) joined #forth 07:16:05 --- mode: ChanServ set +v proteusguy 07:32:12 --- join: ASau (~user@netbsd/developers/asau) joined #forth 09:11:07 --- nick: Vendan_ -> Vendan 10:06:45 --- join: mykespb (~myke@213.141.133.133) joined #forth 10:08:05 --- quit: mykespb (Remote host closed the connection) 10:19:31 --- join: mykespb (~myke@213.141.133.133) joined #forth 10:30:15 --- quit: Indecipherable (Ping timeout: 240 seconds) 10:31:43 --- join: Indecipherable (~Howl@41.162.98.122) joined #forth 10:43:19 --- join: Zarutian (~zarutian@168-110-22-46.fiber.hringdu.is) joined #forth 10:43:54 --- quit: Zarutian (Read error: Connection reset by peer) 10:44:39 --- join: Zarutian (~zarutian@168-110-22-46.fiber.hringdu.is) joined #forth 10:57:33 --- part: sebboh left #forth 11:17:13 --- join: mnemnion (~mnemnion@71.198.73.193) joined #forth 11:41:02 --- quit: rgrinberg (Ping timeout: 276 seconds) 12:10:46 --- join: nal (~nal@adsl-64-237-238-172.prtc.net) joined #forth 12:13:20 --- quit: mykespb (Remote host closed the connection) 12:16:36 --- join: rgrinberg (~rgrinberg@205.189.187.4) joined #forth 12:34:39 --- join: mykespb (~myke@213.141.133.133) joined #forth 12:57:00 --- quit: nal (Ping timeout: 252 seconds) 12:58:16 --- quit: mykespb (Remote host closed the connection) 13:16:48 --- join: nal (~nal@adsl-64-237-238-172.prtc.net) joined #forth 14:07:54 I am trying to work with a message protocol that encodes ASCII with a lead 4-byte message length, but the length is big endian. Any clues on converting or working with big endian numbers on a little endian system? I thought I needed to apply successive left and right shifts but I'm missing something 14:10:18 Maybe you can look here (using C): http://stackoverflow.com/questions/19275955/convert-little-endian-to-big-endian 14:11:14 --- quit: Indecipherable (Quit: http://i.imgur.com/rWAnqP3.jpg) 14:14:01 hmm... a bit of a brain teaser, letssee 14:18:53 : big2little-endian ( bn -- ln ) DUP 0xFF AND 24 << >R DUP 8 >> 0xFF AND 16 << R> OR R> DUP 16 >> 0xFF AND 8 << R> OR ; \ should do it ( and can probably be refactored a bit ) 14:40:43 npr: does that answer your question? 14:42:07 I'm still working on it. I substituted lshift and rshift for << and >> in your answer (using gforth at the moment) and it locked the shell 14:42:44 I _think_ I understand the how of it, but my transliterating the C code above isn't producing the expected answer yet 14:45:56 The data I'm working with: https://glue.nprescott.com/content/924756 - where the 4 bytes I'd like to convert are 00 02 CE C6 and I'd prefer the format C6 CE 02 00 15:00:39 : Endian! { Hollow -- Swapped! } 15:00:39 \ Pour Bytes from `Hollow' into `Empty'. 15:00:39 0 { Empty } 15:00:39 cell 0 u+do 15:00:43 Empty 8 lshift 15:00:46 Hollow $FF and 15:00:49 or to Empty 15:00:52 Hollow 8 rshift to Hollow 15:00:55 loop 15:00:59 Empty ; 15:01:03 assert( $03020100 dup Endian! dup hex. Endian! dup hex. = ) 15:01:55 --- quit: mnemnion (Read error: Connection reset by peer) 15:03:00 --- quit: rgrinberg (Ping timeout: 244 seconds) 15:04:15 --- join: mnemnion (~mnemnion@71.198.73.193) joined #forth 15:04:25 DKordic: which forth are you working with there? There's several new-to-me parts I'll need to look into 15:04:53 I tryed that with gforth. 15:06:16 npr: What is not clear? 15:09:05 --- join: mnemnia (~mnemnion@2601:643:8102:7c95:7181:b97c:d5f5:cc42) joined #forth 15:09:15 I've never seen Hollow or { } used, I see that they are defined in gforth, interesting 15:11:45 --- quit: Zarutian (Quit: Zarutian) 15:12:09 `{' and `}' define Word local `Variable's, and look like Stack Comments. 15:12:16 --- quit: mnemnion (Ping timeout: 276 seconds) 15:12:36 so is Empty taken to be the second item on the stack? 15:13:39 Could be. 15:15:35 npr: Exercise for Local Variables in gforth tutorial is to define `dup' and others with them. Do it. It should take just a few seconds. 15:18:12 A good and simple exercise for novices is to write Majority function without them. And do it in a clean way :) 15:24:58 Maj(x,y,z)=(x∧y)⊕(x∧z)⊕(y∧z) 15:54:26 --- quit: nighty (Read error: Connection reset by peer) 16:48:32 --- quit: true-grue (Read error: Connection reset by peer) 17:08:11 --- join: mykespb (~myke@213.141.133.133) joined #forth 17:08:38 --- quit: mykespb (Remote host closed the connection) 17:13:43 --- join: nighty (~nighty@d246113.ppp.asahi-net.or.jp) joined #forth 17:29:06 --- join: rgrinberg (~rgrinberg@24-246-56-85.cable.teksavvy.com) joined #forth 17:35:46 npr: big/little endian isn't (just) bit order - it's the bytes within the word 17:36:01 the bits within each byte stay the in the same order 18:09:45 --- join: neceve (~ncv@79.114.30.41) joined #forth 18:09:45 --- quit: neceve (Changing host) 18:09:45 --- join: neceve (~ncv@unaffiliated/neceve) joined #forth 21:09:44 --- quit: neceve (Quit: Konversation terminated!) 21:18:49 --- quit: rgrinberg (Ping timeout: 272 seconds) 21:55:34 --- join: DocPlatypus (~skquinn@c-73-166-108-48.hsd1.tx.comcast.net) joined #forth 22:12:49 --- quit: ASau (Ping timeout: 276 seconds) 22:14:09 --- quit: mnemnia (Read error: Connection reset by peer) 22:14:45 --- join: mnemnion (~mnemnion@2601:643:8102:7c95:7181:b97c:d5f5:cc42) joined #forth 22:24:24 --- quit: DocPlatypus (Quit: Leaving) 22:24:29 --- join: _DocPlatypus (~skquinn@c-73-166-108-48.hsd1.tx.comcast.net) joined #forth 22:24:56 --- nick: _DocPlatypus -> DocPlatypus 23:46:58 --- join: true-grue (~true-grue@176.14.222.10) joined #forth 23:59:59 --- log: ended forth/16.09.26