x86-64 Windows Assembly Language. A YASM Assembly Language Program that adds 2 unsigned Integer values and produces formatted console output using the 'C' library function printf().
dat1 db ff
dat2 db ff
res dw ?
In the code segment
mov ax, dat1
add ax, dat2
mov dl,0
adc dl,0 ;initialize the contents of dl and use it to store the
carry flag
mov byte ptr res, ax
mov byte ptr res+1, dl
printf function in assembly :
mov rdi,formatStr ; first argument: format string mov rsi,5 ; second argument (for format string below): integer to print mov al,0 ; magic for varargs (0==no magic, to prevent a crash!) extern printf call printf ret formatStr: db `The int is %d\n`,0
Get Answers For Free
Most questions answered within 1 hours.