flat assembler
Message board for the users of flat assembler.
![]() Goto page 1, 2, 3 Next |
Author |
|
roboman
OpenDos / DR dos might be a good starting point to look at http://drdosprojects.de/
It's in asm open source and has a good batch processor (nearly the same as ms dos) Batch 'programs' are stored in a *.bat file. They were a left over thing from mainframes, where you would write a little script that would run a batch of programs over night or over the weekend. When desktops came around, IBM / Microsoft included the ability to run batch scripts and even expanded it a little. MS & DR dos will both run a batch file called autoex.bat when they start and a lot of programs for Dos were started with a bat file, to make sure the drivers and other things were setup right |
|||
![]() |
|
adroit
Thanks for the info.
![]() I checked out DR DOS and, but it's a bit complicated. I was thinking of designing my interpreter purely from assembly. Do you know any open sources like that where I can study the code. |
|||
![]() |
|
DOS386
> OpenDos / DR dos might be a good starting point to look at http://drdosprojects.de/
> It's in asm open source and has a good batch processor (nearly the same as ms dos) Only the kernel is in (not-F)ASM, command thing is in C ![]() > I'd like to announce my idea of a command-line interpreter. DOS or Win32 ??? > Do you know any open sources like that where I can study the code. NO. All known are in C ![]() |
|||
![]() |
|
adroit
Oh OK! Thanks!!
|
|||
![]() |
|
baldr
MeshNix,
MS-DOS command.com had strange but useful feature: it closed the batch file after the line was parsed (remembering the offset at which the next line will be, to reopen and read later), so current command can modify .Bat and enjoy the possibility of self-modifying batch. 4DOS shell simulated this behavior and have separate .BTM (Batch-to-memory) files for immutable contract. ![]() |
|||
![]() |
|
adroit
That is similar to call, and ret, but instead, it closes and returns to the offset at which it was closed
|
|||
![]() |
|
baldr
MeshNix,
Yes, but .Bat file can be changed in transit. Hell to debug, but fun to see one. Do you have specs for syntax/semantics of your batch lang? |
|||
![]() |
|
adroit
Yes- I've designed some syntax for some instructions!
I not sure what to do after this. |
|||
![]() |
|
baldr
MeshNix,
Now you need (at least) function to read one line from file. ![]() Can you present those design docs? To put it under scrutiny of some constructive critique. |
|||
![]() |
|
adroit
I have a draft document.
|
|||
![]() |
|
adroit
Quote: Now you need (at least) function to read one line from file. What I was planning to do was to read the entire content of the file and store it into a variable, then parse each line until 0Dh (carriage return) is met, then that signifies the end of that line. The problem is, what if the file contains more than 256 characters. Then it cannot store into the variable. |
|||
![]() |
|
ManOfSteel
And why should that "variable" be limited to 256 bytes? Why not allocate as much as you need and load the entire script?
|
|||
![]() |
|
adroit
I don't understand
|
|||
![]() |
|
revolution
Allocate a buffer of whatever size needed to store the entire file. No need to limit things to 256 bytes, is there?
|
|||
![]() |
|
adroit
I guess not. Do i use rb instead of db?
|
|||
![]() |
|
revolution
Probably best to allocate it dynamically. At runtime, get the file size first and then allocate the needed amount.
|
|||
![]() |
|
DOS386
MeshNix wrote: I guess not. Do i use rb instead of db? You reasonably won't use db for this buffer or any buffer at all ![]() Set some limit (maybe 4 KiB for the beginning), do GetFileSizeEx, check against your limit, reject if too bloated, if good hog the memory, and start processing, be aware of the CR vs LF vs CRLF mess, also don't forget to check for invlaid characters (ZERO) and handle them in a well defined way ![]() |
|||
![]() |
|
adroit
CRLF it will be used for EOL.
In using DOS interrupts not Win32 APIs. |
|||
![]() |
|
adroit
I'm seeking advice for my project (codename: Quantum-lite)
(1) My CLI supports loop statements like FOR loop, and WHILE loop. These loops are mutli-line loops example: Code: .start FOR A = 1 TO 5: { PRINT "Repetition was successive " %A " times" } .ENDFOR .end PRINT writes text to screen. %A is a variable in the shell. In that script, how would the shell do a repeat when it only processes line-by-line. Please give some advices. (2) What type of commands would you like into be implemented in my shell? Please provide: - Command/Statement name - Syntax - Description Last edited by adroit on 24 Mar 2010, 22:59; edited 3 times in total |
|||
![]() |
|
Goto page 1, 2, 3 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.