Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; multi-segment executable file template.
- data segment
- ; add your data here!
- msg db "Benvenuti nella programmazione Assembler $"
- ; Walter Serlenga!
- othamsg db "Walter Serlenga$"
- ; il $ indica il fine stringa, come il \0 in C
- ; DICHIARAZIONE COSTANTI PER L'OPERAZIONE Y=a-b+2c
- ;perche scrivi 'a' e non "a"?
- ; perche 'a' e un carattere
- ;"a" e una stringa
- ;quindi dovresti scrivere "a$"
- ;a=9,b=5,c=3
- a EQU '9'
- b EQU '5'
- c EQU '6'
- ends
- stack segment
- dw 128 dup(0)
- ends
- code segment
- start:
- ; set segment registers: Y=a-b+2c
- mov ax, data
- mov ds, ax
- mov es, ax
- mov bx, a
- mov cx, b
- mov dx, c
- sub bx, cx
- add bx, dx
- ; add your code here
- lea dx, msg ; load effective address of msg into dx.
- mov ah, 9 ; print function.
- int 21h ; do it!
- lea dx, othamsg ; load effective address of msg into dx.
- mov ah, 9 ; print function.
- int 21h ; do it!
- ; wait for any key....
- mov ah, 1 ; keyboard input
- int 21h ; do it!
- mov ax, 4c00h ; exit to operating system.
- int 21h
- ends
- end start ; set entry point and stop the assembler.
Add Comment
Please, Sign In to add comment