Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; multi-segment executable file template.
- include 'emu8086.inc'
- ;Es4) Calcolare a*16b utilizzando opportunamente lo SHIF
- data segment
- ; add your data here!
- a db ?
- b db ?
- due db 2
- ends
- stack segment
- dw 128 dup(0)
- ends
- code segment
- start:
- ; set segment registers:
- mov ax, data
- mov ds, ax
- mov es, ax
- xor ax,ax
- call pthis
- db 13,10, 'Inserisci a:' ,0
- mov ah,1
- int 21h
- sub al,'0'
- mov a,al
- ;
- call pthis
- db 13,10, 'Inserisci b:' ,0
- mov ah,1
- int 21h
- sub al,'0'
- mov b,al
- ;
- ;a*16b
- xor ax,ax
- mov bh,a
- mov al,b
- mov cl,due
- shl cl,4
- mul cl
- mul bh
- ;RIS IN AX
- call pthis
- db 13,10, 'a*16b :' ,0
- mov dl,al
- mov ah,2
- add dl,'0'
- int 21h
- exit:
- mov ax, 4c00h ; exit to operating system.
- int 21h
- ends
- DEFINE_PTHIS
- end start ; set entry point and stop the assembler.
Add Comment
Please, Sign In to add comment