-
Notifications
You must be signed in to change notification settings - Fork 6
/
assignment8.asm
72 lines (64 loc) · 1.03 KB
/
assignment8.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
%macro scall 4
mov rax,%1
mov rdi,%2
mov rsi,%3
mov rdx,%4
syscall
%endmacro
section .data
msg db "Vender name is:", 0ah
len equ $-msg
nline db 10
msg2 db "After EAX=01H:",10
l1 equ $-msg2
section .bss
string resq 2
string2 resq 2
temp resq 1
temp1 resq 1
section .text
global _start
_start:
scall 1,1,msg,len
mov eax,00h
cpuid
add [string],ebx
add [string+4],edx
add [string+8],ecx
scall 1,1,string,12
scall 1,1,nline,1
scall 1,1,msg2,l1
mov eax,01h
cpuid
mov [string2],eax
call disp
scall 1,1,nline,1
mov [string2],ebx
call disp
scall 1,1,nline,1
mov [string2],edx
call disp
scall 1,1,nline,1
mov [string2],ecx
;scall 1,1,string,16
call disp
scall 1,1,nline,1
mov rax, 60
mov rdi, 0
syscall
disp:
mov bp,4
mov ax,word[string2]
up1:rol ax,4
mov [temp],ax
and ax,0fh
cmp al,09
jbe down1
add al,07
down1:add al,30h
mov [temp1],al
scall 1,1,temp1,1
mov ax,word[temp]
dec bp
jnz up1
ret