-
Notifications
You must be signed in to change notification settings - Fork 0
/
Structs.txt
68 lines (67 loc) · 1.33 KB
/
Structs.txt
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
include irvine32.inc
Employee STRUCT
IdNum BYTE "000000000"
LastName BYTE 30 DUP(0)
Years WORD 0
SalaryHistory DWORD 0 ,0 ,0 ,0
Employee ENDS
.data
message1 byte "Enter Employee's data. In the order ID, Last Name, Years Worked and salary history",0
message2 byte "Employee's Record, In the order ID, Last Name, Years Worked and salary history", 0
person1 Employee <"555223333">
person2 Employee {"555223333"}
person3 Employee <, "Jones ">
person4 Employee <,,,2 DUP (20000)>
person5 Employee<,,5>
.code
main PROC
mov edx, offset message1
call writestring
call crlf
xor eax,eax
;Enter ID
mov edx, offset person1.IdNum
mov ecx, (sizeof person1.IdNum)
call readstring
;Enter LastName
mov edx, offset person1.LastName
mov ecx, (sizeof person1.LastName)
call readstring
;Enter Years Worked
call readint
mov person1.Years, ax
;Enter Salary History
mov cx, 4
mov esi, offset person1.SalaryHistory
L1:
call readint
mov DWORD PTR [esi], eax
add esi,4
Loop L1
mov edx, offset message2
call writestring
call crlf
;Show Id
mov edx, offset person1.IdNum
call writestring
call crlf
;Show LastName
mov edx, offset person1.LastName
call writestring
call crlf
;Show Years worked
mov ax, person1.years
call writedec
call crlf
;Show Salary history
mov cx, 4
mov esi, offset person1.SalaryHistory
L2:
mov eax, [esi]
call writedec
call crlf
add esi,4
Loop L2
exit
main ENDP
end main