flat assembler
Message board for the users of flat assembler.
![]() |
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 |
|||
![]() |
|
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 |
|||
![]() |
|
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 |
|||
![]() |
|
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. |
|||
![]() |
|
dieboy 19 May 2005, 06:15
Ok. Thank you very much!
![]() _________________ ... |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.