home *** CD-ROM | disk | FTP | other *** search
/ Chip: Shareware for Win 95 / Chip-Shareware-Win95.bin / ostatni / sms32 / mov.asm < prev    next >
Encoding:
Assembly Source File  |  1997-03-15  |  1.3 KB  |  41 lines

  1. ;   A program to demonstrate MOV commands.
  2.  
  3. ;   Mov is short for move.  
  4.  
  5. ;   REGISTER TO REGISTER MOVES
  6. ;    These are NOT supported by this simulator
  7. ;       MOV    AL,BL    This is commented out!  It wouldn't work.
  8. ;       To do this use PUSH BL followed by POP AL.
  9.  
  10.     CLO        ; Close unwanted windows.
  11.  
  12. ;   IMMEDIATE MOVES
  13. ;    A hexadecimal number is copied into a register.
  14.     MOV    AL,15    ; Copy 15 HEX into the AL register
  15.     MOV    BL,40    ; Copy 40 HEX into the BL register
  16.     MOV    CL,50    ; Copy 50 HEX into the CL register
  17.     MOV    DL,60    ; Copy 60 HEX into the DL register
  18. Foo:
  19.     INC    AL    ; Increment AL for no particular reason.
  20.      
  21. ;   INDIRECT MOVES
  22. ;    A value is moved to or from RAM.
  23. ;       The ram address is given as a number like [22] in
  24. ;    square brackets.
  25.     MOV    [A0],AL    ; Copy value in AL to RAM location [40]
  26.     MOV    BL,[40]    ; Copy value in RAM location [A0] into BL
  27.  
  28. ;    REGISTER INDIRECT MOVES
  29. ;    Copy a value from RAM to a register or
  30. ;     copy a value from a register to RAM.
  31. ;    The RAM address is contained in a second register
  32. ;    enclosed in square brackets like this [CL].
  33.     MOV    [CL],AL    ; Copy the value in AL to the RAM
  34.             ; location that CL points to.
  35.     MOV    BL,[CL]    ; Copy the RAM location that CL points
  36.             ; to into the BL register.
  37.  
  38.     JMP    Foo    ; PRESS ESCAPE TO STOP THE PROGRAM
  39.  
  40.     END
  41.