00:00:00 --- log: started forth/19.08.15 00:48:37 --- quit: C-Keen (Ping timeout: 268 seconds) 00:50:47 --- join: C-Keen (cckeen@pestilenz.org) joined #forth 00:51:10 --- nick: C-Keen -> Guest3376 00:52:29 --- quit: Guest3376 (Changing host) 00:52:29 --- join: Guest3376 (cckeen@k4cg/C-Keen) joined #forth 00:52:31 --- nick: Guest3376 -> C-Keen 00:54:36 --- join: nullnullnull (~no@bzq-79-179-76-17.red.bezeqint.net) joined #forth 01:05:25 --- quit: dys (Ping timeout: 245 seconds) 01:08:32 aw, he left 01:12:57 --- quit: X-Scale (Read error: Connection reset by peer) 01:47:50 --- quit: phadthai (Remote host closed the connection) 01:51:11 --- join: phadthai (mmondor@ginseng.pulsar-zone.net) joined #forth 02:18:44 guys what is this error "double free or corruption (out)" 02:18:52 why im getting this error? 02:18:58 I will upload the code sec 02:19:52 https://pastebin.com/m9jRmrh0 02:21:16 with this script, I'm trying to make a simple tcp connection (+ timeout after 2 sec if connection is not responding) 02:22:06 btw using gforth 02:22:14 why is it indented like that 02:22:33 is "t a word 02:22:40 --- quit: john_metcalf (Read error: Connection reset by peer) 02:22:44 oh these are gforth includes 02:22:56 hmm I tried with " but not working 02:22:59 without* 02:23:07 t is like a task 02:23:18 to call a task 02:23:19 not sure how gforth tasks work, sorry 02:23:27 np mate :) ty 02:27:20 btw do you know how to exit with failure? (like exit(1)) 03:38:10 --- join: dddddd (~dddddd@unaffiliated/dddddd) joined #forth 05:59:47 --- join: X-Scale (~ARM@253.52.54.77.rev.vodafone.pt) joined #forth 08:56:57 --- join: wildtrees (~wildtrees@unaffiliated/wildtrees) joined #forth 08:58:02 --- quit: wildtrees (Max SendQ exceeded) 09:59:16 --- join: ryke (~Thunderbi@71-9-169-152.dhcp.jcsn.tn.charter.com) joined #forth 10:05:39 --- join: dys (~dys@tmo-114-83.customers.d1-online.com) joined #forth 10:13:38 so anyone know how to exit (1) [with failure] from gforth? 10:17:12 it should be something like: 10:17:15 \c #include 10:17:16 c-function exit exit n -- void 10:17:16 1 exit 10:17:43 hmm 10:18:39 no other way right? 10:21:21 without using C code 10:24:03 nullnullnull: Have You tried https://bitbucket.org/avanderhorst/yourforth ? 10:24:37 sec 10:25:49 not yet mate, I will check 10:29:39 nullnullnull: not that I'm aware of 10:29:41 --- quit: ryke (Ping timeout: 258 seconds) 10:30:45 crc, btw mate I'm new to gforth, but I will try to write some C code there, like your example 10:31:41 but for some reasons, it doesnt read the "exit" 10:32:27 gforth.fs:6: Invalid name argument 10:32:31 pointing at "1 exit" 10:33:00 maybe I should put exit(1)? like in C 10:33:49 ah maybe the include is not for exit 10:33:52 not stdlib 10:33:56 it's something else, sec 10:34:42 stdio* 10:41:20 --- join: Mat42 (~claude@ip5b409bed.dynamic.kabel-deutschland.de) joined #forth 10:43:49 sorrp, it should be stdlib.h, not stdio.h 10:43:55 *sorry 10:45:41 hi crc 10:46:28 hi Mat42 10:48:48 just read you experimenting again with a bare-metal retro version 10:50:04 yes, with john_cephalopoda's vm implementation 10:50:44 have you an AMD64 port in mind? 10:55:19 I don't have any plans for that at present; still need to finish my basic drivers on 386 first 10:57:33 crc mate, do I have to add something before the "1 exit"? cuz it's still showing error "Invalid name argument" on it 10:57:58 I included both stdlib and stdlib, just to be sure 10:58:02 stdio* 11:01:15 I think I'll have the x86 drivers working relatively soon. 11:02:15 I am mainly working on directory structures right now. 11:03:48 nullnullnull: this is what I get: http://forth.works/cb066e59a4a4561fe0ba24b663172685 11:05:31 --- join: mtsd (~mtsd@94-137-100-130.customers.ownit.se) joined #forth 11:09:04 Mat42: I'm not sure how much benefit I'd see from a 64-bit native implementation of the vm 11:15:44 --- quit: joe9 (Remote host closed the connection) 11:20:21 crc: as long as no native-code compilation is involved, advantages are limited to the larger integer resolution and easier access to the increased address space 11:21:50 john_cephalopoda: Reads like you work on a FAT driver? 11:27:07 larger integer resolution would require a modified vm + image 11:27:54 increased address space could be interesting, but I'm unlikely to need that much ram for anything I'm doing 11:28:41 crc: 32 bit protected mode have also some advantages as the possibility to enter vm mode for calling the BIOS which may ease driver development 11:31:37 for long mode I prefer a 1:1 mapping with 2 GB page entries as I found the whole hardware based memory management quite questionable 11:48:36 I've never done a V86 interface to use the BIOS 11:53:47 Mat42: Ah, no, with "directory structures", I mean the project structure, not a filesystem driver. 11:55:10 I'll make a display and keyboard driver, that will handle most things. 11:55:39 x86 is quite tedious to work with. 11:56:00 crc: I found it a better way than switching to real-mode and back for every BIOS call 12:00:28 john_cephalopoda: well, system programming for ARM based boards for example is not really easier 12:02:22 ciao 12:02:25 I am doing that. 12:03:19 --- part: Mat42 left #forth 12:03:19 ARM boards have a relatively sane instruction set and haven't got an enormous amount of outdated things that are there to keep backwards-compatibility. 12:04:30 For example, on x86 you can't just use the PS/2 controller. On many computers it is in "Legacy USB" mode, routing the keyboard and mouse directly into it. So you first have to configure the USB stack, disable legacy USB and switch back to use it. 12:04:47 It is also not guaranteed that it is there or works at all. 12:05:31 And if you want to use the "Legacy USB" mode, then the quality of what you get depends on the implementation that the mainboard creators did, which often is buggy and hardly usable. 12:06:35 * crc dislikes the complexities usb brings 12:07:05 I'll probably have to write an USB stack for impexus eventually. 12:07:19 But I'll try to push it back as long as I can. 12:47:29 --- quit: mtsd (Quit: Leaving) 13:10:33 --- quit: dys (Ping timeout: 248 seconds) 13:14:10 --- quit: gravicappa (Ping timeout: 268 seconds) 13:26:10 --- quit: presiden (Ping timeout: 272 seconds) 14:25:05 guys, I'm sending to a thread task like this: s" "task but I want to make it run in parallel, is it possible with gforth? 14:36:03 --- join: wigbig (~syd@cpc95880-hart11-2-0-cust675.11-3.cable.virginm.net) joined #forth 14:38:23 Is there a way to work easily/automatically with 16-bit ints in Forth? Or is manual bit-twiddling and calculating the way to go? An example of why is that I'd like "$FFFFFFFF LDA" to ideally be an out-of-range error (can't fit in 16 bits) whereas Forth considers it a -1. 14:38:58 (I'm using a 32-bit Forth) 14:43:42 --- join: ryke (~Thunderbi@71-9-169-152.dhcp.jcsn.tn.charter.com) joined #forth 14:43:56 wigbig: You could just add bounds checks to everything. Define a word called 16BIT? and throw an error if the number is not between 2^15 and -(2^15)-1 14:46:52 You'll probably have to change some other words, too, in order to ensure that the numbers are capped after additions etc. 14:49:53 --- join: dave0 (~dave0@069.d.003.ncl.iprimus.net.au) joined #forth 14:51:12 I'll give that a try, thank you :) 14:51:20 It's bit a while since I worked with twos complement, and the combination of the different representations is really throwing me, haha. 14:55:31 It's not that difficult. 14:56:06 If the number you got is negative, just fill all the upper bytes with 1. 15:14:21 --- quit: nullnullnull (Quit: Leaving) 15:22:24 Aaah, I think the problem was that I tried to implement that same check, but with literal -32769 and 32768. It seems to work now, thank you :) 15:27:54 np 15:28:18 --- quit: ryke (Ping timeout: 258 seconds) 15:41:08 --- quit: dddddd (Ping timeout: 246 seconds) 15:50:20 Whoops, I think I spoke too soon. I'd still like to allow numbers up to $FFFF. I guess what I'm asking is, for hexadecimal numbers to be treat as 16-bit unsigned, with anything outside of that range being out-of-bounds. However, I'd still like to allow Forth's unary minus. Is that possible? 15:53:32 wigbig: What should the result for "0x1 0x2 -" be? 15:54:09 0xffff or "Out of bounds"? 16:04:33 0xff, if that doesn't sound strange. I'm trying to mimic the way another (popular) assembler works (asm6) and "LDA ($1 - $2)" outputs (A5 FF) into the binary. 16:06:32 So 1-2 = 255? That seems quite strange. 16:07:30 Are you trying to write an assembler? 16:10:52 I initially planned on just writing a little program that outputs the bytes for the operator and the operand. After getting that working okay, I decided to add bounds checking and found myself completely baffled, haha. 16:12:15 wigbig: The operation "A5" that you mention above does an operation with the ZP. The ZP is only 8 bit large. 16:12:51 (Going from memory 0x0000 to 0x00ff) 16:13:32 I figured that might be influencing things. If the operand is <=$FF, zero page mode is chosen, otherwise absolute. 16:13:47 http://www.oxyron.de/html/opcodes02.html 16:14:32 http://www.chibiakumas.com/6502/ 16:14:44 Those seem like useful ressources, especially #2. 16:20:20 I'll think on it a bit more, thanks. :) 16:20:27 If you are on Linux, I can recommend radare2, a disassembler and reverse-engineering tool. It supports nearly all architectures and is really helpful for debugging. 16:22:06 I have written an assembler in Forth myself. My approach is to do something like "EAX 4 asm:addi", where the word "asm:addi" takes the last two operands and writes the assembly for that command to memory or a file. 16:22:45 It is for x86, but the same thing probably also works with NES assembly. 16:23:27 wigbig: https://github.com/jmf/impexus/tree/a739e544bd4d862c054cff41d2b084cecd37e83c/arch/x86 16:24:17 I switched from ANS-y Forth to RETRO in the meantime, that's the last (and most complete) version of an ANS Forth x86 assembler I got. 16:26:59 --- join: TheCephalopod (~john@unaffiliated/john-cephalopoda/x-6407167) joined #forth 16:27:07 --- quit: john_cephalopoda (Disconnected by services) 16:27:09 --- nick: TheCephalopod -> john_cephalopoda 16:27:58 Thanks for the advice, much appreciated. I should help a lot to have a similar project to learn from. 16:28:03 *It 16:29:11 this is my attempt so far, anyway: https://github.com/dys-bigwig/Forth-6502-parse/blob/master/asm.fs 16:33:49 --- join: rdrop-exit (~markwilli@112.201.162.86) joined #forth 16:34:41 wigbig: A proposal for "?IN-SIGNED-8BIT-RANGE": You should ask if it is >=0 and <=255. 16:35:55 Hmm, although... 16:36:49 Good morning Forthers 16:37:33 Good night, from last night ;) Thanks for your help yesterday. 16:38:07 wigbig: Right now it won't accept 0xff, which _is_ a valid 8-bit integer. 16:38:35 Hi wigbig, np 16:40:42 -256 and 0= 16:42:13 john_cephalopoda: thanks. I should probably just have all the ranges in decimal. This bounds checking is really confounding me, haha. 16:43:41 To be fair I hadn't even thought of the ($1 - $2) problem, and asm6's output of $FF doesn't elucidate matters sadly. 16:44:40 ah sorry you want signed 16:47:01 rdrop-exit: at this point, I'm not entirely sure I know what I want, to be honest. haha. I was ready to wrap up last night when I tried "$FFFFFFFF LDA" and realised it was accepted, when I'd ideally like that to be an out-of-range error. 16:52:02 Big thanks to both of you for your help and advice. Sorry if this question was vague and such, I think I need to sit on it more. 16:52:37 For that what I posted above will work 16:53:19 wigbig: I wrote a better function. 16:53:32 wigbig: https://bpaste.net/show/J5hs 16:53:57 It takes a number and returns the proper 8-bit number. If it is not a valid 8-bit number, it will quit (BYE). 16:56:14 Thank you! Instead of bye, I suppose I could then check whether it's a valid /16-bit number/ and, if it is, choose absolute rather than zero page. 16:56:31 1 2 - SIGNED-8 \ will return "255" (0xff). 16:58:35 Why do you need this, what do you require the input to be? ie. lda ( ? -- ) 16:58:52 What's the "?" 16:59:27 If you need it to be a byte, then: -256 and 0= will tell you that 17:00:02 I'll write a paste up real quick, one moment 17:00:23 wigbig: You should probably stop trying to replicate behavior of an other assembler. They probably use C and an uint8_t, which takes care of that without them having to do anything. 17:00:55 That behavior is just annoying to replicate in Forth and doesn't really make much sense. in general. 17:01:32 You are working with memory addresses, when they are negative, then you probably do something wrong. 17:03:34 In that case, I'll let it alone. I figured this may just not be worth it in Forth due to it not being "automatic", as you mention. 17:04:18 Thanks again for the help, it is very much appreciated. 17:09:54 :) 17:17:00 :) 17:17:06 Late for me, good night. 17:17:29 Good night john_cephalopoda 17:17:33 Night :) 17:19:15 rdrop-exit: Mind if I ask what your programming areas-of-interest are? Sorry for being nosy, I'm just curious. 17:21:12 I'm retired, no specific area at the moment 17:23:21 ah, okie dokie. thanks. 17:23:34 :) 17:29:46 I've done a little bit of everything over the years (except for web related stuff, never got into that) 17:35:18 I feel the same regarding web-dev. It's arguably the biggest thing at the moment, but it just doesn't spark my curiosity for some reason. I'm mainly into functional programming, language design, and games myself. Not to say I'm /good/ at any of those things, but they interest me nonetheless haha. 17:40:50 Cool 17:44:42 I never cared for functional programming, but I do play games, but not computer ones, old school board wargames. 18:04:01 --- quit: wigbig (Quit: Leaving.) 18:44:27 --- join: wigbig (~syd@cpc95880-hart11-2-0-cust675.11-3.cable.virginm.net) joined #forth 19:59:18 --- quit: wigbig (Quit: Leaving.) 20:38:28 --- join: gravicappa (~gravicapp@h109-187-16-242.dyn.bashtel.ru) joined #forth 21:09:11 --- quit: rdrop-exit (Quit: Lost terminal) 21:43:22 --- quit: dave0 (Quit: dave's not here) 22:00:49 --- nick: arrdem__ -> arrdem 22:01:30 --- join: wigbig (~syd@cpc95880-hart11-2-0-cust675.11-3.cable.virginm.net) joined #forth 22:05:51 --- join: dys (~dys@tmo-081-42.customers.d1-online.com) joined #forth 22:49:42 --- join: `presiden (~presiden@unaffiliated/matematikaadit) joined #forth 23:43:57 --- join: dave0 (~dave0@069.d.003.ncl.iprimus.net.au) joined #forth 23:51:09 --- part: ttmrichter left #forth 23:59:59 --- log: ended forth/19.08.15