Jump to content

rankeney

New Members
  • Posts

    6
  • Joined

  • Last visited

rankeney's Achievements

Combat Commando

Combat Commando (1/9)

17

Reputation

  1. @dmsc - Thanks for your comments! I've corrected newline handling and CTRL-C (it was calling a BRK instruction). I also modified the code to echo control characters as ^X (for CTL-X). As to your backspace comment, with Altirra, I receive a $7F for backspace (left arrow on my keyboard). It looks like DELETE returns $FE, so I guess that's the Atari equivalent, maybe prior to masking the parity bit? It looks like either way, backspace isn't actually deleting the previous character from my input buffer, so I have some work to do. I'll post an update when it's fixed.
  2. FWIW, I now have an initial port of TECO for the Atari. See: http://atariage.com/forums/topic/273861-teco-for-the-atari/ What's left to do is File I/O, which I'll be looking at next. A few questions: As I recall, my old implementation of TECO does some parsing of the filename to figure out if a device name is specified, and if the filename is legal (i.e. no funky characters used, syntax is correct, etc). I gather that may not be necessary - I can just pass the specified filename and CIO will figure out the rest. Is this correct? Or are there, for example, limits to the length of the filename? If a file open or create fails, is there an error code that I can look at? (I seem to recall it return Minus on fail or something like that and the status is in the X register, or I can make a Get Status call). Whichever, I can consult the manual. But I don't recall seeing a list of returned status values... Is there a rename file function? Is there a delete file function? Anyway, I'm hoping to add these features to make for a complete TECO port. Thanks! Robert
  3. I now have TECO ported and running on the Atari. TECO is an implementation of DEC's Text Editor and COrrector for the 6502. All editing functionality should be there (I haven't test this port much). File I/O (reading and writing input and output files) has yet to be ported:. Yeah, I know, it's pretty useless without. I'll be looking at doing that part next. For those not familiar with TECO, not only is it a character-oriented editor, but it is considered Turing complete, meaning you can write programs with it. For example, the code: 10U1$10<Q1\$Q1+10U1$I $>$HT$$ will insert the numbers 10 to 100 with increments of 10 into the text buffer, then print the buffer. Note the '$' shown in the command is the ESC key. Two ESCs terminates and executes the command. The code means: 10U1 = Assign the value 10 to Q-register 1 (Q-registers are numeric or text-holding registers). 10<...> means execute the enclosed text 10 times Q!\ = Insert the value held in Q-register 1 into the text buffer Q1+10U1 = Take the value held in Q-register 1, add 10 to it and place the result back in Q-register 1 I<eol> = Insert an end of line HT = Show the entire text buffer TECO is pretty cryptic, but very cool. Like Perl, it has pattern-matching capabilities too. Anyway, give it a shot and let me know what you think. You can find a copy of the executable attached. Robert teco.obx
  4. Wow, thanks for all the suggestions! Based on what I've heard, I think initially I'll start my code at $2000, and I'll keep my buffer from the end of code to MEMTOP or $A000, depending on how I wrote my original code. I'm guessing I can easily do the calculation and go from there. As to keyboard handling, using K: seems easy enough. As to screen handling, I'm not sure yet what to do. Initially I'll try using S: and see where that gets me. TECO doesn't expect much. It was designed to work on dumb terminals, and would work find on a Teletype. My expectation would be that a character out routine would print a character. If it was at the last column of a line or was an end-of-line ($9B?), it would advance to the next line. If it was on the final row, it would scroll the screen. Does this mean I need to write the code to do this? (@dmsc - From your description, maybe the OS does *just* what I need, though slowly. I'll give it a try) As to IOCB usage, I'm a bit confused about setting them up. At a glance, it appears IOCB0 is already open. Is it always open and set to the S:? Do I need to check if a specific device is open before opening one myself? Do I need to check each IOCB to see if it is in use before I do an open? Sorry, I haven't gotten around to the RTFM part thoroughly yet FWIW, I tried a simple print character IOCB example from a book, but it didn't work at all. It opened E: on IOCB2 and called CIOV at $E456 to print a string. I did try using the putchar macro from MADS stdio library, and it worked just fine. I'm guessing it is using the IOCB PUT VECTOR call mentioned by @dmsc? As to assemblers, I'll probably stick with MADS. My code looks like it will take few mods to work with it. For specifying the start of a program, I assume the "run main" line means the code starts at label main? If so, is this the common approach across assemblers? Thanks again, everyone. BTW, I thought I had posted this in the programming sub-forum. Apparently not, but it seems to have gotten sufficient attention! Once I've got the basics working, I'll try to remember to post there.
  5. slx - Thanks for the quick reply. It's kind of what I was expecting. FWIW, I tried WUDSN using the quick install, but it failed with some sort of java error, and I didn't bother to delve into installing it the hard way. It looks like it's got a lot of great features, but probably more than I'll need for this project. I've seen references to JSR $F6E2 to get a character and JSR $F6A4 to print one, but it seems like I tried these and had no luck. I'm guessing this may be tied to having BASIC loaded. I'll go with using the IOCBs.
  6. Back in the dawn of time (around '81-82), I wrote a n implementation of TECO (DEC's Text Editor and COrrector) for the 6502. It was written as part of an operating system I developed for the Ohio Scientific line of beasts. The OS was called GenerOS (Generic Operating System), and barely saw the light of day. Years ago I posted the source on Usenet, hoping someone would port it to Atari, Apple, Commodore or whatever, but I think it was forgotten. A few years back someone nudged me about it, hoping to port it to the Atari. No word back on that, so I thought I'd have a look at doing it myself. Digging through what I can find, I've installed Altirra on my windows box and both ATASM and MADS and am looking at the next steps to take. After browsing several assembly language manuals for the Atari, I have a few starter questions that may speed my efforts. No really obvious answers have presented themselves. Is there some preferred starting address for my program? It seems like the start of available memory varies depending on configuration. I'd like a fixed address, and I gather $600 doesn't assure me something else might not live there. Where should I place my text editor buffer? I'd want it to be as large as possible. It seems like there should be simple routines I can JSR to put a character on the screen, check for a key pressed, and return the key pressed, but I can't find them. Do I need to set up an IOCB to do all this? I hear great things about MADS, but my code uses '*=addr' instead of 'ORG addr', and '.BYTE 00' instead of whatever MADS uses. Should I bother converting? I'm not using any macros or conditional compilation. Once I get these basic things running, I should be mostly there. The only other details would be file I/O, which looks manageable. Any help would be appreciated! BTW, this TECO is a pretty full implementation based on TECO for the PDP-11. See: https://en.wikipedia.org/wiki/TECO_(text_editor)
×
×
  • Create New...