flat assembler
Message board for the users of flat assembler.
Index
> Main > Writing 16bit libraries |
Author |
|
Tyler 16 Jan 2011, 03:21
1. Research TSRs and how to patch the IVT. Basically, the only type of library you can make for DOS is one that sets up its own interrupts, then terminates while staying resident(TSR).
|
|||
16 Jan 2011, 03:21 |
|
me239 16 Jan 2011, 05:19
Tyler wrote: 1. Research TSRs and how to patch the IVT. Basically, the only type of library you can make for DOS is one that sets up its own interrupts, then terminates while staying resident(TSR). I've had quite a bit of experience in DOS and TSR's. What I wanted was a non IVT based library that can be called during runtime using DOS functions. The closet I've come to making this is a program I wrote that loads another program in the slack space after the code and hands it parameters. What I want is to be able to call other functions at other locations in the file. |
|||
16 Jan 2011, 05:19 |
|
me239 18 Jan 2011, 05:48
I made a working example! This program finds and loads a library in the current file and executes the programmed functions. I don't know how useful this is, but it's seems pretty neat.
main program: Code: org 100h ;jmp start start: mov ah, 4eh xor cx, cx mov dx, filen int 21h jc error mov ax, 3d02h mov dx, 9eh int 21h xchg ax, bx mov ah, 3fh mov dx, buffer mov cx, 9eh int 21h mov si, msg call printf mov ax, 451d call dec2str mov al, 41h call pchar int 20h error: mov dx, emsg mov ah, 09h int 21h int 20h emsg db "ERROR: File not found. Please ensure that the library is in the current directory$" msg db "Hello!", 0 filen db "library.bin", 0 dec2str = buffer printf = buffer+2 pchar = buffer+4 buffer: library code: Code: org 0 start: jmp dec2str jmp printf jmp pchar dec2str: mov bx, 10d xor cx, cx @@: xor dx, dx div bx push dx cmp ax, 0 je @f inc cx jmp @b @@: pop dx add dl, 30h mov al, dl mov ah, 0eh int 10h cmp cx, 0 je func_ret dec cx jmp @b printf: lodsb cmp al, 0 je func_ret mov ah, 0eh int 10h jmp printf pchar: mov ah, 0eh int 10h func_ret: ret |
|||
18 Jan 2011, 05:48 |
|
rugxulo 20 Jan 2011, 00:49
Causeway? HX? DXE? DJELF? TP6? And there are several more I can't remember (but could probably find) off the top of my head.
|
|||
20 Jan 2011, 00:49 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.