flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Tomasz Grysztar 31 May 2017, 20:22
I'm not sure if I could have any control over what initial register values DOS passes to the program when I use function 4Bh of int 21h to execute one. This may also depend on a DOS version/variant.
|
|||
![]() |
|
TomCat 04 Jun 2017, 09:37
I use FreeDOS btw. From a bootable USB drive made by Rufus (https://rufus.akeo.ie).
|
|||
![]() |
|
zhak 04 Jun 2017, 10:11
Hmm I don't get how initial register values can affect your program. Do you depend on AX/BX = 0 on exec start? If yes, then it's not correct, I suppose. Anyway, Ralph Brown gives some info an registers usage, so it seems to work as expected http://www.ctyme.com/intr/rb-2939.htm. You probably could hook the vector and clear registers yourself before exiting, but not sure if this would be the correct approach
|
|||
![]() |
|
TomCat 23 Jul 2017, 21:13
Tomasz,
Acording to RalfBrown you could control the inital value of AX register by the ES:BX parameter block. You should give a valid drive letter in first FCB and second FCB. Then AX will be zero instead of 0FFFFh. And who knows... maybe BX allways has the same value as AX. |
|||
![]() |
|
TomCat 23 Jul 2017, 21:16
oh, and i'm compiling a .com file
|
|||
![]() |
|
TomCat 11 Sep 2017, 00:02
I've done it. FASMD.ASM: after mov ax,0D00h and stosw you need this: stosb mov al, ' ' mov ecx,14 rep stosb. And instead of stosd and xor eax,eax you need this: stosd and inc eax inc eax. It works like a charm
![]() |
|||
![]() |
|
TomCat 11 Sep 2017, 00:06
sry. misstyped .. mov ecx,15
|
|||
![]() |
|
Tomasz Grysztar 11 Sep 2017, 14:57
TomCat wrote: sry. misstyped .. mov ecx,15 |
|||
![]() |
|
TomCat 11 Sep 2017, 19:18
Code: mov edi,buffer+200h lea edx,[edi-buffer] mov ax,0D00h stosw stosb mov al,' ' mov ecx,15 rep stosb lea ebx,[edi-buffer] xor eax,eax stosw mov ax,buffer_segment shl eax,16 mov ax,dx stosd inc eax inc eax stosd stosd mov ax,4B00h xor dx,dx call dos_int |
|||
![]() |
|
Tomasz Grysztar 11 Sep 2017, 21:03
This doesn't look safe enough in my opinion. I'm going to test this on MS-DOS at least, and I may try to fill FCB a bit better.
|
|||
![]() |
|
TomCat 12 Sep 2017, 06:31
Much more safer than it was before
![]() |
|||
![]() |
|
Tomasz Grysztar 12 Sep 2017, 07:04
TomCat wrote: Much more safer than it was before Funny how I seemed to remembers something from the docs that was never there. I must have contracted the rules about environment segment with the ones concerning FCBs and created a false memory. TomCat wrote: But yes, test it on MS-DOS too! Under FreeDOS an empty FCB looks like this: one byte zero and 15 spaces (the zero is critical, we need it for the right inital values of AX and BX). |
|||
![]() |
|
TomCat 12 Sep 2017, 08:49
Can FCB be larger than 16 bytes? Normally FCB1 starts at 5Ch and FCB2 starts at 6Ch when executing a .com file.
|
|||
![]() |
|
Tomasz Grysztar 12 Sep 2017, 09:14
TomCat wrote: Can FCB be larger than 16 bytes? Normally FCB1 starts at 5Ch and FCB2 starts at 6Ch when executing a .com file. BTW, under MS-DOS even with current version of FASMD the AX register is zeroed at the entry of the assembled program. |
|||
![]() |
|
TomCat 12 Sep 2017, 09:26
Ok.
BTW, You should test it with COM file also! ![]() |
|||
![]() |
|
Tomasz Grysztar 12 Sep 2017, 10:00
I tested exclusively with .COM files.
|
|||
![]() |
|
Tomasz Grysztar 12 Sep 2017, 10:13
I tested the update on my DOS machines and gave it a green light. Please try the version from the updated DOS package and let me know if it does the job on your system.
|
|||
![]() |
|
TomCat 12 Sep 2017, 11:33
I've tested your code under FreeDOS - It's WORKING!
![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.