;PHY4635/5635 Sp 08 ;Takehome Lab #1 ;Press the emulate button and "single step" slowly. ;Watch the flags and the IP and the registers. mov ax,5555h ;IMMEDIATE ADDRESSING example mov bx,0AAAAh ;leading "0" required by this assembler for chars mov cx,bx ;REGISTER ADDRESSING example and cx,ax ;needed cx so we don't destroy BX contents ;LOOK at CX contents, make sense? shl ax,1 mov cx,bx and cx,ax ;LOOK at CX contents, make sense? shr ax,1 ;restore AX to its original contents mov cx,bx or cx,ax ;LOOk at CX contents, make sense? ;Now, here's a loop - watch carefully ;We're clearing out the AX register (not efficiently, BTW) label: shl ax,1 jnz label mov cx,1234h push cx ;We just placed the contents of CX onto the "stack" mov cx,0ffffh ;You can do lots of stuff with CX pop cx ;...and recover it later by "popping" CX back ;...off the stack. ;We're done for now - play around all you want - it's safe. ;Try running some examples, watch how they work. ret ; return to the operating system.