flat assembler
Message board for the users of flat assembler.
  
       
      Index
      > Main > MOV DL,[DH+1] Doesn't wok? :P | 
  
| Author | 
  | 
              
| 
                  
                   sid123 27 Oct 2013, 05:04 
                  Alright I agree I am a pure noob in ASM,
 
                  When I try this code it says "Invalid Operand Address","Invalid Operand" Code: MOV DL,[DH + 1] What I wanted to simply do is assign the value of DH + 1, to DL, Note: DH needs to be preserved before calling the function, so I can't use : Code: INC DH ; This would destroy the current value of DH lol I know this is one of the WORST questions EVER! But I can't get my code work![/code] _________________ "Those who can make you believe in absurdities can make you commit atrocities" -- Voltaire https://github.com/Benderx2/R3X XD  | 
              |||
                  
  | 
              
| 
                  
                   sid123 27 Oct 2013, 05:10 
                  Why didn't I think about that? That's common sense. I guess my question was pretty lame. Thanks! 
                  
                 | 
              |||
                  
  | 
              
| 
                  
                   cod3b453 27 Oct 2013, 10:46 
                  A useful reference is http://ref.x86asm.net/coder32-abc.html#modrm_byte_16 which shows the valid effective addresses in 16bit; note that the only registers you can use are bx/si/di/bp. (This is somethign that gets me every time I change my boot loader because I'm used to 64bit code  
                  
                 | 
              |||
                  
  | 
              
| 
                  
                   shutdownall 27 Oct 2013, 11:51 
                  Helpful are the instructions
 
                  
                MOVZX MOVSX as well. MOVZX will clear the upper part of a register when transferring the lower part. Like MOVZX CX,DL which is a combination of XOR CX,CX MOV CL,DL  | 
              |||
                  
  | 
              
| 
                  
                   revolution 27 Oct 2013, 14:39 
                  shutdownall wrote: Like MOVZX CX,DL which is a combination of  | 
              |||
                  
  | 
              
| 
                  
                   shutdownall 27 Oct 2013, 16:30 
                  Okay, lets write:
 
                  
                MOV CH,0 MOV CL,DL  | 
              |||
                  
  | 
              
| 
                  
                   sid123 28 Oct 2013, 09:53 
                  Also I have one more question, How would I do this :
 
                  
                MOV SI,AL?  | 
              |||
                  
  | 
              
< Last Thread | Next Thread >  | 
    
Forum Rules: 
  | 
    
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.