flat assembler
Message board for the users of flat assembler.
Index
> DOS > PUSH -> "clear" code doesn't work |
Author |
|
YONG 18 May 2005, 19:45
Try this:
Code: sub sp, 2 mov bp, sp mov [bp], ax Your error was not related to ss. It was about [sp] which is illegal. Listed below are the legal 16-bit Memory Addressing Modes: - Displacement - bx or bp - si or di - Any combinations of the above three YONG |
|||
18 May 2005, 19:45 |
|
mike.dld 18 May 2005, 19:53
In 16-bit code there is no SP-relative addressing (only BP,BX,SI,DI can be used). But you can probably write
Code: sub sp, 2 mov [esp], ax |
|||
18 May 2005, 19:53 |
|
YONG 18 May 2005, 20:21
One more point.
Even though the [bp] addressing mode uses ss by default, you may code [ss:bp] to make it clear and unambiguous. YONG |
|||
18 May 2005, 20:21 |
|
MazeGen 18 May 2005, 20:59
mike.dld wrote: In 16-bit code there is no SP-relative addressing (only BP,BX,SI,DI can be used). But you can probably write You can never be sure that high word of ESP is zero, so MOVZX ESP,SP should be used before such code. |
|||
18 May 2005, 20:59 |
|
dieboy 19 May 2005, 06:15
Ok. Thank you very much!
_________________ ... |
|||
19 May 2005, 06:15 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.