Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; multi-segment executable file template.
- INCLUDE 'emu8086.inc'
- data segment
- ; add your data here!
- pkey db "press any key...$"
- msga db "inserire il valore a: $",10,13
- msgb db "inserire il valore b: $",10,13
- msgc db "inserire il valore c: $",10,13
- msgd db "inserire il valore d: $",10,13
- a db (00)
- b db (00)
- c db (00)
- d db (00)
- ends
- stack segment
- dw 128 dup(0)
- ends
- code segment
- start:
- ; set segment registers:
- mov ax, data
- mov ds, ax
- mov es, ax
- ; add your code here
- ;carica_a
- lea dx,msga
- mov ah,9
- int 21h
- mov ah,1
- int 21h
- call controllo
- xor ax, ax
- ;carica_b
- lea dx,msgb
- mov ah,9
- int 21h
- mov ah,1
- int 21h
- call controllo
- xor ax, ax
- ;carica_c
- lea dx,msgc
- mov ah,9
- int 21h
- mov ah,1
- int 21h
- call controllo
- xor ax, ax
- ;carica_d
- lea dx,msgd
- mov ah,9
- int 21h
- mov ah,1
- int 21h
- call controllo
- xor ax, ax
- jmp exit
- controllo proc
- cmp al,48
- je numero
- cmp al,49
- je numero
- cmp al,50
- je numero
- cmp al,51
- je numero
- cmp al,52
- je numero
- cmp al,53
- je numero
- cmp al,54
- je numero
- cmp al,55
- je numero
- cmp al,56
- je numero
- cmp al,57
- je numero
- call PTHIS
- db 13, 10, "Non e' un numero",10,13, 0
- je fine
- numero:
- call PTHIS
- db 13, 10, "e' un numero",10,13, 0
- je fine
- fine: ret
- controllo endp
- exit:
- lea dx, pkey
- mov ah, 9
- int 21h ; output string at ds:dx
- ; wait for any key....
- mov ah, 1
- int 21h
- 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