flat assembler
Message board for the users of flat assembler.
Index
> Projects and Ideas > MiniDOS - minimalistic DOS clone [DONE] Goto page Previous 1, 2, 3 |
Author |
|
Dex4u 18 Feb 2008, 14:40
Cool, the functions for time and date are in "FBrowser" code they just need adding to MiniDos.
See here: http://board.flatassembler.net/topic.php?t=8281 |
|||
18 Feb 2008, 14:40 |
|
asiekierka 18 Feb 2008, 15:17
Sad, i actually wrote the time code form scratch, only my friend wrote the get_BCD code.
Code: cmp ah,2Ch ; Does AH = 0x2C je int21_2C ; Get time (BIOS procedures) cmp ah,2Dh ; Does AH = 0x2D je int21_2D ; Set time (BIOS procedures) Code: get_BCD: mov bl, al and bl, 0x0f shr al, 4 mov bh, 10 mul bh add al, bl ret int21_2C: ; get time T_T push bx mov ah,2 int 1Ah add ch, dl xor dl,dl mov al,ch jmp get_BCD mov ch,al mov al,cl jmp get_BCD mov cl,al mov al,dh jmp get_BCD mov dh,al xor al,al pop bx jmp int21_exit int21_2D: ; set time xor dl,dl xor al,al mov AH,3 int 1Ah jmp int21_exit |
|||
18 Feb 2008, 15:17 |
|
Dex4u 18 Feb 2008, 23:10
Thanks, but i already have the time/date code.
Last edited by Dex4u on 05 May 2008, 03:01; edited 1 time in total |
|||
18 Feb 2008, 23:10 |
|
penang 04 May 2008, 14:56
[quote="vid"][url]http://decard.net/article.php[/url]
gets you a little bit further ;)[/quote] For late comers, the above isn't working anymore. |
|||
04 May 2008, 14:56 |
|
Goplat 04 May 2008, 18:35
A shorter way to convert a BCD byte into a number:
Code: aam 16
aad |
|||
04 May 2008, 18:35 |
|
LocoDelAssembly 04 May 2008, 22:19
Well, I think that readers figured out that those "jmp get_BCD" in fact should be "call get_BCD".
---Most readers won't learn anything new from the text below--- Since Goplat suggested a much more shorter BCD unpacker I'll add for the record the pseudo-code of those BCD instructions to show why only those instructions are equivalent to the whole get_BCD "function". Code: ; AAM - ASCII Adjust AX Before Multiply tempAL <- AL; AH <- tempAL / imm8; (* imm8 is set to 0AH for the AAM mnemonic *) AL <- tempAL MOD imm8; ; AAD - ASCII Adjust AX Before Division tempAL <- AL; tempAH <- AH; AL <- (tempAL + (tempAH * imm8)) AND FFH; (* imm8 is set to 0AH for the AAD mnemonic.*) AH <- 0; So, "aam 16" splits AL's nibbles into AH:AL, then with "aad" AH is multiplied by 10 and added to AL which is exactly what get_BCD stores in AL just before returning. If I made a mistake in the explanation or wasn't clear enough please correct. |
|||
04 May 2008, 22:19 |
|
Synaps3 29 Mar 2012, 04:20
I know that this topic is old, but I had two questions about this.
I tested a few < 64K exes on minidos and only one worked. Despite my lack of skills with assembly, I was thinking about adding some more functions to this. The problem is that I don't know which functions I need to implement in order for certain programs to work. Is there a DOS program that will scan another DOS program and report which ints it uses? Would adding support for exes > 64K be hard, or is it something that would only require a few lines to tweak? |
|||
29 Mar 2012, 04:20 |
|
Stephen 29 Mar 2012, 15:11
you can run the exe through a disassembler. that will turn the exe into an assembly language source code file. You can then load that file into a text editor and do a search for 'int'. that will very likely give you all the system calls, unless they direct called some things or it's self modifying code....
|
|||
29 Mar 2012, 15:11 |
|
Dex4u 31 Mar 2012, 00:02
Its a long time since i worked on miniDos, but i think you can load a exe bigger than 64k, i even have a fasm port for it some where.
If not, it would be easy to add. There was a TSR called Dostap you could get from here: http://www.smxrtos.com/rtos/dos/undwinpb.htm Not sure if its still available, but Stephen's way will work OK, it should be simple to code a TSR DOS app, to log function numbers used by a program. |
|||
31 Mar 2012, 00:02 |
|
bubach 20 Apr 2012, 14:36
Why not try modifying the code to print "int 21h called with arguments, ah=xx, al=xx" on any empty functions? It could then force the program to exit and you would know what functions needs work for it to start.
I might try adding to it in the near future depending on how much time I'll spend on my own OS. |
|||
20 Apr 2012, 14:36 |
|
bamboo202 01 Apr 2016, 14:21
The link went down
|
|||
01 Apr 2016, 14:21 |
|
revolution 01 Apr 2016, 14:27
Which link? There are quite a few scattered inside this topic.
|
|||
01 Apr 2016, 14:27 |
|
Dex4u 02 Apr 2016, 16:08
Hi bamboo202,
If your talking about the minidos code, here it is
|
|||||||||||
02 Apr 2016, 16:08 |
|
ford 04 Apr 2016, 13:46
@Dex4u, I have used your MiniDOS as learning material for some time now, and I always end up using it to help others learn. Thank you very much for your hard work!
|
|||
04 Apr 2016, 13:46 |
|
Goto page Previous 1, 2, 3 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.