update mult.asm
This commit is contained in:
+29
-3
@@ -1,8 +1,34 @@
|
||||
segment .text
|
||||
.model small
|
||||
|
||||
section
|
||||
global main
|
||||
|
||||
section .data
|
||||
a db 8
|
||||
b db 3
|
||||
|
||||
section .bss
|
||||
res db
|
||||
|
||||
main:
|
||||
; initialization
|
||||
mov ax, @data
|
||||
mov ds, ax
|
||||
mov ah, 0
|
||||
|
||||
; load numbers on registers
|
||||
mov ax, a
|
||||
mov bl, b
|
||||
|
||||
segment .data
|
||||
var
|
||||
; multiplication of the two registers
|
||||
mul bl
|
||||
|
||||
; save result
|
||||
mov dl, al
|
||||
add dl, 48
|
||||
|
||||
mov ah, 02
|
||||
int 21h
|
||||
|
||||
mov ah, 04Ch
|
||||
int 21h
|
||||
Reference in New Issue
Block a user