What I have been working on... - Page 1
Forum section: electronics / general

author: Ampera
author_rank: Super Contributor
timestamp: February 20, 2018, 08:24:33 am
content: My C programming is getting stronger and stronger, and now that I am starting on Assembly programming, I thought I would put my C skills to the test and try to write myself a little tool.There's a program called Emu8086 which is a stepping 8086 assembler and emulator that can run programs instruction by instruction. This is cool, but the program is I believe abandoned, and also paid, which are two things that don't go well together.Either way, my current project, called Amp8086 out of a massive, unending ego, as well as a complete and total lack of any creativity on my part, is an MS-DOS oriented 8086 IDE, including a text editor with support for Unix and DOS line endings for easy use of files from both OS families, an MASM compatible 8086 assembler (MASM as that's what I've been learning currently), and a simple stepping 8086 emulator.The program is in preliminary stages, with time being sporadically placed into it, but I hope to get text manipulation working in a week, including I/O.It is written entirely in C, and will be tested to run in DOSBox, but the idea would be to use something like VMWare with a much faster system to get a much more capable program.Why DOS? Because I got annoyed with setting up the one C display library that claimed to be simple, so I decided DOS it was. This will be released for completely free use, but I may or may not charge for private use of the source code.I do have a picture of the text editing UI that I made:Currently only basic text editing is working, but I've been reorganizing my thoughts, and I have some very basic buffer manipulation.Here is a semi-mockup (Was done using the program, but the proper functionality isn't really in there yet) I made of what code might look like in the IDE:My personal development environment has also changed. I am now using a RasPi 3 over SSH with X11 tunneling to use DOSBox. All text is edited in GNU Nano, and compiled using TC.

author: ebastler
author_rank: Super Contributor
timestamp: February 20, 2018, 08:53:02 am
content: Quote from: TwoOfFive on February 20, 2018, 08:24:33 amHey -- isn't the whole point of this vintage computing hobby to use an old 8086 machine, whirring floppy drives, clicky IBM keyboard and all? You are doing it wrong!

author: Ampera
author_rank: Super Contributor
timestamp: February 20, 2018, 08:57:15 am
content: I wanted to run an SSH server using DOS, but it's Real hard to do that.

author: joeqsmith
author_rank: Super Contributor
timestamp: February 21, 2018, 02:35:15 am
content: Looks fancy. Is the plan to try and simulate a PC? BIOS and all? It will be interesting to see how far you get with it.

author: Ampera
author_rank: Super Contributor
timestamp: February 21, 2018, 03:34:19 am
content: Quote from: joeqsmith on February 21, 2018, 02:35:15 amThe plan for the moment is to do just a straight opcode interpreter with no BIOS. It just takes instructions, and shows what they would do when executed.

author: Ampera
author_rank: Super Contributor
timestamp: February 23, 2018, 09:09:07 am
content: Is it embarrassing that it took days of code redesign, and finally about 30-60 minutes just trying stuff with the watch tool to get a function that inserts a character into a string at a certain offset?Here is some code, and it'sprobablydefinitely messy.First off, I have a function to make lines. I use a char pointer array (an array of pointers) that point to strings (so essentially an array of pointers that point to arrays). I used this to store images in memory, it should work well here, and allow very powerful line by line modifications. The reason it's so big is because I am adding in support for both Unix and DOS line endings, and the line endings are stored with the array. However, now that I think about it, that's pretty not needed, and I can most definitely do without those and just add them when I save the file. Will fix that in a second. My brain has been clogging with this for too long, I'm getting off track.Next up we have the code to insert text into the string. This is probably mostly final. Hopefully it fully works, I haven't extensively tested it (out of fear of breaking it), but it should work.Most of my issues come from my inexperience with the intricacies of C. I know what I'm doing (or at least I hope and think I do), but small things that I just don't understand the minute nature of trips me up. Either way, this is intended to be a learning project, so at least I am learning.Anyways, back to coding.

author: joeqsmith
author_rank: Super Contributor
timestamp: February 23, 2018, 11:26:07 am
content: This is a similar program I wrote way back to run an ICE I had designed. It can assemble the code, then display the opcodes and number of clock cycles per instruction. You can set break points and do single steps. It looks like I was doing the color text in assembler back then.