mpl6
mpl6
mov rax, %1
mov rdi, %2
mov rsi, %3
mov rdx, %4
syscall
%endmacro
section .data
arr dw 2710h,03E8H,0064h,000Ah,0001h
cnt db 05
cnt1 db 05
db "3. Exit",10
section .text
global _start
_start:
menu_label:
mov rsi, arr ; Load the address of 'arr' array into RSI
a3:
IO 0,0,num,01 ; Read a single digit from user's input and store it in [num]
mov bx, [rsi] ; Load the value from [rsi] (array element) into BX
mul bx ; Multiply AX by BX
IO 0,0,num,01 ; Read a single digit from user's input (clearing the buffer)
hex_bcd:
mov rsi, arr ; Load the address of 'arr' array into RSI
mov ah, [no1] ; Load the converted value of the first digit into AH
mov al, [no2] ; Load the converted value of the third digit into AL
r2:
mov bx, [rsi] ; Load the value from [rsi] (array element) into BX
exit:
syscall
convert:
mov rsi, num ; Load the address of 'num' buffer into RSI
mov al, [rsi] ; Load the first digit from [num] into AL
mov al, [rsi] ; Load the second digit from [num] into AL
a2:
display_hex:
mov rsi, disparr+03 ; Set RSI to the address where the result will be stored
l4:
add30:
display_bcd:
mov al, [t1] ; Load the BCD digit from [t1] into AL
convert_hex:
mov al, [num] ; Load the ASCII digit from [num] into AL
ret