flat assembler
Message board for the users of flat assembler.
Index
> DOS > MOVing register into RAM, DOS |
Author |
|
eek 15 Mar 2007, 21:36
use the ketman interpreter to get a picture for what you're doing.
http://www.btinternet.com/~btketman/tutpage.html While it isn't FASM and is only 16bit it WILL save you asking a few thousand questions. A push puts the value onto the stack. Other areas of memory can be reserved for values of different size or even dynamic values. |
|||
15 Mar 2007, 21:36 |
|
rugxulo 16 Mar 2007, 03:38
Try using GRDB (DOS debugger, but works under Win XP) to view registers before and after instructions. It also allows immediate execution of instructions directly (/and ax,127) without having to assemble and run. It supports at least up through MMX, if not more by now (I forget).
|
|||
16 Mar 2007, 03:38 |
|
DOS386 17 Mar 2007, 05:09
Quote: but works under Win XP Quote: how I do know in DOS which memory address to give to MOV? Code: --------D-2148------------------------------- INT 21 - DOS 2+ - ALLOCATE MEMORY AH = 48h BX = number of paragraphs to allocate Return: CF clear if successful AX = segment of allocated block CF set on error AX = error code (07h,08h) (see #01680 at AH=59h/BX=0000h) BX = size of largest available block Notes: DOS 2.1-6.0 coalesces free blocks while scanning for a block to allocate .COM programs are initially allocated the largest available memory block, and should free some memory with AH=49h before attempting any allocations under the FlashTek X-32 DOS extender, EBX contains a protected-mode near pointer to the allocated block on a successful return SeeAlso: AH=49h,AH=4Ah,AH=58h,AH=83h --------D-2149------------------------------- INT 21 - DOS 2+ - FREE MEMORY AH = 49h ES = segment of block to free Return: CF clear if successful CF set on error AX = error code (07h,09h) (see #01680 at AH=59h/BX=0000h) Notes: apparently never returns an error 07h, despite official docs; DOS 2.1+ code contains only an error 09h exit DOS 2.1-6.0 does not coalesce adjacent free blocks when a block is freed, only when a block is allocated or resized the code for this function is identical in DOS 2.1-6.0 except for calls to start/end a critical section in DOS 3.0+ SeeAlso: AH=48h,AH=4Ah --------D-214A------------------------------- INT 21 - DOS 2+ - RESIZE MEMORY BLOCK AH = 4Ah BX = new size in paragraphs ES = segment of block to resize Return: CF clear if successful CF set on error AX = error code (07h,08h,09h) (see #01680 at AH=59h/BX=0000h) BX = maximum paragraphs available for specified memory block Notes: under DOS 2.1-6.0, if there is insufficient memory to expand the block as much as requested, the block will be made as large as possible DOS 2.1-6.0 coalesces any free blocks immediately following the block to be resized SeeAlso: AH=48h,AH=49h,AH=83h You can also reserve memory just above your executable, see: http://board.flatassembler.net/topic.php?t=6735 (In Main, MZ examples) _________________ Bug Nr.: 12345 Title: Hello World program compiles to 100 KB !!! Status: Closed: NOT a Bug |
|||
17 Mar 2007, 05:09 |
|
rugxulo 29 Mar 2007, 00:33
Quote:
It works under DOS and Win XP (unlike 386SWAT, loaded as a device driver, which needs DOS or QEMU or whatever ...). |
|||
29 Mar 2007, 00:33 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.