Question(Questions, questions...) 
Author Message
 Question(Questions, questions...)

I am using DEBUG(so I'm kinda cheap...) and would like to know how to get the
command line string. Example source code would be great- last I heard it had
something to do with offset 80h & 81h. Also how do you use LES:
1. I know the parameters(LES Reg, Source)
2. I know what it does(Load segment into ES & offset to Reg)
3. Source has to be a pointer...??- maybe not??
(LES BP, [0000])
BUT, how do you get the value to have as Source if you know the segment &
offset. Again, I am using DEBUG...

*Any help is appreciated!!*
             C.J.



Thu, 15 Feb 2001 03:00:00 GMT  
 Question(Questions, questions...)

Quote:
>I am using DEBUG(so I'm kinda cheap...) and would like to know how to get the
>command line string. Example source code would be great- last I heard it had
>something to do with offset 80h & 81h.

yeah, 80h holds the number of bytes typed on the command line and 81h is a
space.  I put an example at the end but do not know if it will work 'inside'
debug...maybe you know how to  assemble a .com file so you can run it from the
dos prompt...If money is the only reason you use debug to assemble, grab nasm
for free at
http://www.web-sites.co.uk/nasm/link.html
and its free ide at
http://www.inglenook.co.uk/nasmide/title.html
Speaking of which, nasmide has an online help with a very useful list of
opcodes and their functions.
Quote:
>Also how do you use LES:
>1. I know the parameters(LES Reg, Source)
>2. I know what it does(Load segment into ES & offset to Reg)
>3. Source has to be a pointer...??- maybe not??
>(LES BP, [0000])
>BUT, how do you get the value to have as Source if you know the segment &
>offset.

Source has to be a location in memory. LES will far point es:reg to source.
Now a short example to repeat what you type at the command line:
xor      ah,ah  ;ah=0 so only al has value
mov      si,80 ;point si to number of bytes typed after program name
lodsb  ;load that number of bytes into al
mov      di,si ;point di to 1st blank space
add      di,ax ;add #of bytes(point at end of string)
mov      al,36d ;and put a '$' there
stosb   ;so that dos knows its the end of string
mov      dx, 82 ;point dx to 1st char written
mov      ah,9 ;fucntion 21h/9
int      21 ;to print string ending with $
int      20 ;end prog

It is written that when evil threatens the Earth
   the light of the bracelet of protection
        will call forth the Demon Lord
                       ZENKI!!!



Fri, 16 Feb 2001 03:00:00 GMT  
 Question(Questions, questions...)

Quote:
>xor      ah,ah  ;ah=0 so only al has value
>mov      si,80 ;point si to number of bytes typed after program name
>lodsb  ;load that number of bytes into al
>mov      di,si ;point di to 1st blank space
>add      di,ax ;add #of bytes(point at end of string)
>mov      al,36d

Sorry, I meant this to be 36 decimal, but clearly is 36d hex.  You can use the
hex equivelent, 24, instead.
mov     al,24

It is written that when evil threatens the Earth
   the light of the bracelet of protection
        will call forth the Demon Lord
                       ZENKI!!!



Fri, 16 Feb 2001 03:00:00 GMT  
 Question(Questions, questions...)

Quote:
>I am using DEBUG(so I'm kinda cheap...) and would like to know how to get the
>command line string. Example source code would be great- last I heard it had
>something to do with offset 80h & 81h. Also how do you use LES:
>1. I know the parameters(LES Reg, Source)
>2. I know what it does(Load segment into ES & offset to Reg)
>3. Source has to be a pointer...??- maybe not??
>(LES BP, [0000])
>BUT, how do you get the value to have as Source if you know the segment &
>offset. Again, I am using DEBUG...

>*Any help is appreciated!!*
>             C.J.

Well, here my Debug session that dumps to STDOUT the command-line
string.

First the program:

0BBD:0100 8A0E8000      MOV     CL,[0080]
0BBD:0104 30ED           XOR     CH,CH
0BBD:0106 B440          MOV     AH,40
0BBD:0108 BB0100                MOV     BX,0001
0BBD:010B BA8200                MOV     DX,0082
0BBD:010E CD21          INT     21
0BBD:0110 C3                    RET

Then we need to specify the file length:
-rcx
CX 0011
:11
-rbx
BX 0000
:0

Then we specify the name:
-ncmdln.com

Then  we write-out the file to disk:
-w
Writing 00011 bytes
-

Then we can quit:
Q

Test the program:
C:\Projects>cmdln This is a test
This is a test

Goo luck with this.
Josiah

P.S.
If I remember correctly the LES function requires a FAR pointer and
will not be recognizable by DEBUG.



Fri, 16 Mar 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Questions-Questions-Questions-Answers-Answers

2. LOGO-L> Questions-Questions-Questions-Answers-Answers

3. Newbie Question: Realbasic Question

4. Questions Questions

5. Questions and more questions...

6. Browse Question / Report question

7. ***Data buffering question. Long post, lots of questions

8. questions, questions!

9. Questions, questions!

10. MicroWorlds Pro "QUESTION Set Size" question

11. OS/2 REXX Question (Object REXX Question Inside)

12. Doc question and Mount question

 

 
Powered by phpBB® Forum Software