Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Block traspher
%macro print 2 mov rax,1 mov rdi,1 mov rsi,%1 mov rdx,%2 syscall %endmacro %macro exit 0 mov rax,60 mov rdi,00 syscall %endmacro ;------------------------------------------------------------------------------- section .data sblock db 11h,22h,33h,44h,55h dblock times 5 db 0 space db " " ano db 10," -----------------------------------",10, db " Assignment 2(a) ",10, db " Block Transfer Without String",10, db " -----------------------------------" anolen equ $-ano smsg db 10," Source Block: " smsglen equ $-smsg dmsg db 10," Destination Block:" dmsglen equ $-dmsg bmsg db 10,10," Before transfer: " bmsglen equ $-bmsg amsg db 10,10," After transfer: " amsglen equ $-amsg emsg db 10,10," GOOD DAY...!",10,10 emsg_len equ $-emsg ;------------------------------------------------------------------------------- section .bss charans resb 16 ;------------------------------------------------------------------------------- section .text global _start _start: print ano,anolen print bmsg,bmsglen print smsg,smsglen mov rsi,sblock call dispblock print dmsg,dmsglen mov rsi,dblock call dispblock call btno print amsg,amsglen print smsg,smsglen mov rsi,sblock call dispblock print dmsg,dmsglen mov rsi,dblock call dispblock print emsg,emsg_len exit ;------------------------------------------------------------------------------- dispblock: mov rbp,5 nextnum: mov al,[rsi] push rsi call disp64 print space,1 pop rsi inc rsi dec rbp jnz nextnum ret btno: ; copies source values to destination mov rsi,sblock mov rdi,dblock mov rcx,5 back: mov al,[rsi] mov [rdi],al inc rsi inc rdi dec rcx jnz back ret disp64: ;displays mov rsi,charans+1 mov rcx,2 mov rbx,16 cnt: mov rdx,0 div rbx cmp dl,9 jbe add30 add dl,07h add30: add dl,30h mov [rsi],dl dec rsi dec rcx jnz cnt print charans,2 ret ;--------------------------------------------------------------------------- ;OUTPUT: ; ----------------------------------- ; Assignment 2(a) ; Block Transfer Without String ; ----------------------------------- ; Before transfer: ; Source Block: 11 22 33 44 55 ; Destination Block:00 00 00 00 00 ; After transfer: ; Source Block: 11 22 33 44 55 ; Destination Block:11 22 33 44 55 ; GOOD DAY...! ;----------------------------------------------------------------------------
run
|
edit
|
history
|
help
0
dfsfdafds
mult
subtract
The Code
dfdffdfdfdfdfdfd
dfdfdfsff
helorasa
lec6-3
sdffdsafdsfsda
gfsdfgdgfdgdgfdfgd