Aggiungi 'Compito-Assembly/compitostafanacci 1a.asm'
This commit is contained in:
parent
54c651edf4
commit
25c908303d
|
@ -0,0 +1,45 @@
|
|||
; multi-segment executable file template.
|
||||
|
||||
data segment
|
||||
|
||||
; add your data here!
|
||||
pkey db "press any key...$"
|
||||
num1 db 30h
|
||||
num2 db 20h
|
||||
ris db 0h
|
||||
|
||||
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
|
||||
|
||||
mov al, num1
|
||||
mov bl, num2
|
||||
cmp al, bl
|
||||
je salta
|
||||
sub al, bl
|
||||
mov ris, al
|
||||
|
||||
salta: 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
|
||||
|
||||
end start ; set entry point and stop the assembler.
|
Loading…
Reference in New Issue