Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;Letto da ingresso un numero di telefono terminato dal segno % stabilire se il numero appartiene a un cellulare o a una rete fissa del distretto di Roma
- #make_com#
- ORG 100H
- jmp start
- ap db ?
- msg db 'Inserisci il numero di telefono terminato da un % :','$'
- msg1 db 13,10,'Il numero appartiene a un cellulare.',13,10,'$'
- msg2 db 13,10,'Il numero appartiene a una rete fissa, ma non di Roma.',13,10,'$'
- msg3 db 13,10,'Il numero appartiene a una rete fissa di Roma.',13,10,'$'
- msg4 db 13,10,'Numero non valido',13,10,'$'
- cont db 00h
- ap2 db ?
- ap3 db ?
- str:
- mov ax,03h
- int 10h
- start:
- lea dx,msg
- mov ah,09h
- int 21h
- mov cl,00h
- jmp step1
- step2:
- cmp al,025h
- je step3
- mov ap,al
- push word ptr ap
- add cont,01h
- step1:
- mov ah,01h
- int 21h
- jmp step2
- step3:
- add cl,01h
- pop word ptr ap
- mov al,byte ptr ap
- mov ap2,al
- mov ah,cont
- mov ap3,ah
- sub ap3,01h
- cmp cl,ap3
- je step4
- cmp cl,cont
- je step5
- jmp step3
- step4:
- cmp ap2,36h
- je fissa
- cmp ap2,39h
- je cel
- jmp step3
- fissa:
- add cl,01h
- pop word ptr ap
- mov al,byte ptr ap
- mov ap2,al
- cmp ap2,30h
- je stampaf
- jmp nv
- stampaf:
- lea dx,msg3
- mov ah,09h
- int 21h
- jmp fine
- cel:
- add cl,01h
- pop word ptr ap
- mov al,byte ptr ap
- mov ap2,al
- cmp ap2,33h
- je stampac
- cmp ap2,30h
- je ff
- jmp nv
- stampac:
- lea dx,msg1
- mov ah,09h
- int 21h
- jmp fine
- step5:
- cmp ap2,30h
- je ff
- jmp nv
- nv:
- lea dx,msg4
- mov ah,09h
- int 21h
- jmp fine
- ff:
- lea dx,msg2
- mov ah,09h
- int 21h
- jmp fine
- fine:
- mov ah,4ch
- int 21h
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement