update mult.asm
This commit is contained in:
+29
-3
@@ -1,8 +1,34 @@
|
|||||||
segment .text
|
.model small
|
||||||
|
|
||||||
|
section
|
||||||
global main
|
global main
|
||||||
|
|
||||||
|
section .data
|
||||||
|
a db 8
|
||||||
|
b db 3
|
||||||
|
|
||||||
|
section .bss
|
||||||
|
res db
|
||||||
|
|
||||||
main:
|
main:
|
||||||
|
; initialization
|
||||||
|
mov ax, @data
|
||||||
|
mov ds, ax
|
||||||
|
mov ah, 0
|
||||||
|
|
||||||
|
; load numbers on registers
|
||||||
|
mov ax, a
|
||||||
|
mov bl, b
|
||||||
|
|
||||||
segment .data
|
; multiplication of the two registers
|
||||||
var
|
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