00:00:00 --- log: started retro/06.09.18 01:13:54 crc: your additions helped me nicely. Now I've set of functions which allows one to extract information about elf-file's validity and header information, thus, offsets to program and section header table. 01:15:04 I think we need some kind of smart library for error checking or such. and assertion. 01:15:22 plus breakpoints. :) 01:15:41 kind of, at between of function you can execute commands, then let it run by writing cont 03:06:06 crc: I think I've found a bug: 03:06:12 z" foobar" unpack type -> oobar 03:07:04 That's not a bug. z" strings don't have a count byte. You don't use unpack on them. 03:08:03 what do I use on them then? 03:08:22 They're zero-delimited, so you use functions that find the length first, as in C. 03:08:57 yes yes, I want to print zero terminated string. 03:09:09 Then you need to first find the length. 03:11:07 how do I do that? 03:11:14 Search for the zero-byte. 03:11:28 no ready function for that? 03:11:41 I'm not an rf expert, I don't know if it has one in there. 03:12:24 ok, now here is, and it is called ztype. 03:13:26 : ztype ( z-- ) repeat 0; dup emit 1+ again ; 03:13:51 Works, but inefficiently. 03:14:15 hmm. you'r right. 03:14:37 Actually, check that. Doesn't work. Where are you fetching the character? What are you initially comparing to 0? 03:15:05 hmm. yes. of course. :D 03:15:07 damn. 03:15:50 I thought you had posted tested code, and so just glanced at the method (emit one at a time). Test before you post! 03:17:47 :) 03:20:27 : ztype ( z-- ) dup @ dup 0 =if 2drop ;then emit 1+ ztype ; 03:20:32 what about this? 03:20:43 You didn't test that one either, did you? 03:20:54 this one I tested, but with weird consequences. 03:21:06 thought, I assume they are not because that code is wronge. 03:21:15 Keep working on it. 03:25:24 Quartus, how did you devectored words? 03:25:34 devectored? 03:25:41 like, put some extra stuff before one executes cr 03:25:59 : "z tib 1024 0 fill d: "z ; 03:26:09 :: ." hi" d: cr ; is cr 03:26:21 aah. :) 03:26:34 You have to do it with :: because of the annoying habit of rf to make new definitions findable before they're complete. 03:31:20 ok. 03:31:23 : ztype ( z-- ) dup c@ dup 0 =if 2drop ;then emit 1+ ztype ; 03:31:29 this one is working completely. :) 03:33:15 Ok. I think you'd do better with : ztype dup strlen type ; 03:34:32 yep, if I just had that strlen. ;) 03:34:41 Which is trivial. Give it a try. 03:34:57 If you're working with zstrings a lot you'll need it anyway. 03:35:32 : strlen dup c@ 0; drop strlen ; would it be like this? 03:35:38 or wait. 03:35:39 no. 03:35:43 that doesn't count. :D 03:36:50 : strend dup c@ 0; drop 1+ strend ; 03:36:50 : strlen dup strend swap - ; 03:37:14 By the way, are you using rf? Last time I checked it didn't tail-recurse. You may want to use repeat...again instead of the recursion. 03:38:25 Otherwise, for a 50-character string, you'd use 50 cells of return-stack space, and then the routine would have to pop all 50 return addresses before returing. Not useful. 03:39:33 ahaa. ok. 03:42:42 With repeat/again you could make strlen one word, as well. 03:43:25 Wait, could you? Maybe not. You'd need a loop that allows termination, which rf aggravatingly does not supply in the kernel. 03:44:43 In Standard Forth it'd be : strlen dup begin dup c@ while 1+ repeat swap - ; 03:44:48 : strlen dup repeat dup c@ 0 =if swap - ;then 1+ again ; 03:45:46 Yes, I see. A conditional with an exit. Helluva clumsy way to exit a loop, but I guess you have to work with what's there. 03:47:38 hmm. maybe one could improve those conditionals & loops somehow... 03:48:01 in python and common lisp you have iterators and generators... 03:48:40 You can do that in rf, too, if you want to work with 'later', as I believe crc named the word that allows continuation. 03:56:10 now my elf format reader can read section table names. 03:57:38 I wonder where are things like C function names... 05:51:44 --- join: timlarson_ (n=timlarso@65.116.199.19) joined #retro 06:26:31 --- join: Ray_work (n=Raystm2@199.227.227.26) joined #retro 07:26:13 --- quit: Quartus (Read error: 104 (Connection reset by peer)) 08:18:28 --- join: virl (n=virl@chello062178085149.1.12.vie.surfer.at) joined #retro 08:34:07 --- join: neceve (n=claudiu@unaffiliated/neceve) joined #retro 11:07:27 --- quit: Cheery (Read error: 104 (Connection reset by peer)) 11:12:24 --- join: Cheery (n=Cheery@a81-197-19-23.elisa-laajakaista.fi) joined #retro 11:17:38 --- join: Quartus (n=trailer@CPE0001023f6e4f-CM013349902843.cpe.net.cable.rogers.com) joined #retro 13:01:08 --- quit: Quartus__ ("jmIrc destroyed by the OS") 13:29:08 --- quit: timlarson_ ("Leaving") 13:29:15 --- quit: Cheery ("Download Gaim: http://gaim.sourceforge.net/") 14:14:47 --- nick: Raystm2 -> anstm 14:26:30 --- nick: anstm -> nanstm 15:03:45 --- quit: Ray_work ("User pushed the X - because it's Xtra, baby") 15:05:44 --- quit: virl (Remote closed the connection) 15:46:02 --- quit: crc (Remote closed the connection) 15:53:57 --- quit: neceve (Remote closed the connection) 16:39:16 --- join: jas2o (n=jas2o@WNPP-p-203-54-32-196.prem.tmns.net.au) joined #retro 16:42:21 --- quit: jas2o (Client Quit) 17:05:25 --- join: crc (n=crc@pdpc/supporter/active/crc) joined #retro 17:05:26 --- mode: ChanServ set +o crc 17:06:06 --- join: airbrush (i=airbrush@216-237-193-94-access.northstate.net) joined #retro 17:36:51 --- join: jas2o (n=jas2o@WNPP-p-203-54-32-196.prem.tmns.net.au) joined #retro 18:24:54 --- quit: jas2o ("Chatzilla 0.9.74 [XULRunner 1.8.0.1/2006012608]") 19:02:33 --- quit: airbrush ("Leaving") 19:44:41 --- join: nighty_ (n=nighty@CPE00119576a9c5-CM0012c90d36fc.cpe.net.cable.rogers.com) joined #retro 20:59:57 --- quit: nighty_ (Remote closed the connection) 22:27:42 --- join: snoopy_1711 (i=snoopy_1@dslb-084-058-140-072.pools.arcor-ip.net) joined #retro 22:44:44 --- quit: Snoopy42 (Read error: 110 (Connection timed out)) 22:44:54 --- nick: snoopy_1711 -> Snoopy42 23:59:59 --- log: ended retro/06.09.18