;; FIRST.ASM .model small .586 .stack 100h .data junk db 3, 5, 42, 7 msg db 'Hello, I forgot my name', 13, 10, '$' msg2 db 13, 10, 10 ; Skip a few lines db '***** THE VALUE IS: ' lo db 'A' hi db 'B' db 13, 10, '$' ; Finally done. msg3 db '***** THE VALUE NOW IS: ' value db 'R' nextval db 'r' db 13, 10, '$' msg4 db '***** THE VALUE NOW IS: ' val4 dw 'rR' db 13, 10, '$' .code Hello PROC mov ax, @data ; Setup mov ds, ax ;; Output a message. mov dx, OFFSET msg ; Output the msg mov ah, 9 int 21h ;; Output another message. ;; Swap the chars. mov al, lo ; Get lo & hi mov ah, hi mov bl, al ; Save al in bl mov al, ah mov ah, bl mov lo, al ; Store them back mov hi, ah mov dx, OFFSET msg2 ; Output the msg mov ah, 9 int 21h mov ax, 4c00h ; Exit int 21h ;; Mess up the value mov al, value ; fetch the value inc al ; add one to it inc al ; add one to it inc al ; add one to it mov value, al ; store it back mov al, nextval ; fetch the value dec al ; add one to it dec al ; add one to it dec al ; add one to it mov nextval, al ; store it back ;; Output the new value. mov dx, OFFSET msg3 ; Output the msg mov ah, 9 int 21h ;; Mess up the value again mov ax, val4 ; fetch the value inc ah dec al mov val4, ax ; store it back ;; Output the newest value. mov dx, OFFSET msg4 ; Output the msg mov ah, 9 int 21h ;; Now, exit the program. mov ah, 4ch ; Exit mov al, 0 ;OR.... mov ax, 4c00h ; Exit int 21h Hello ENDP end Hello