Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
8
Task/Enumerations/8086-Assembly/enumerations-1.8086
Normal file
8
Task/Enumerations/8086-Assembly/enumerations-1.8086
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
Sunday equ 0
|
||||
Monday equ 1
|
||||
Tuesday equ 2
|
||||
Wednesday equ 3
|
||||
Thursday equ 4
|
||||
Friday equ 5
|
||||
Saturday equ 6
|
||||
Sunday equ 7
|
||||
13
Task/Enumerations/8086-Assembly/enumerations-2.8086
Normal file
13
Task/Enumerations/8086-Assembly/enumerations-2.8086
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
mov ax,seg DaysOfTheWeek
|
||||
mov ds,ax
|
||||
mov si,offset DaysOfTheWeek
|
||||
|
||||
mov bx,2 ;desired enumeration of 2 = Tuesday
|
||||
add bx,bx ;double bx since this is a table of words
|
||||
mov ax,[bx+si] ;load the address of the string "Tuesday" into ax
|
||||
mov si,ax ;we can't load indirectly from AX, so move it into SI. We don't need the old value of SI anymore
|
||||
mov al,[si] ;load the byte at [SI] (in this case, the "T" in Tuesday.)
|
||||
ret
|
||||
|
||||
DaysOfTheWeek word Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday
|
||||
;each is a pointer to a string containing the text you would expect.
|
||||
Loading…
Add table
Add a link
Reference in a new issue