SlideShare a Scribd company logo
1 of 24
-
–
stack


LIFO


       Last
       In
       First
       Out
000F
000E
000D
000C
000B
000A            10h


       (stack
                           segment)

                      SS

                           SS
000F   12h
000E   34h
000D   00h
000C   7Fh
000B
000A
000F
000E
000D
000C
000B
000A



       F
bos
      000F   12h
      000E   34h
      000D   00h
tos
      000C   7Fh                              –
      000B                                –
      000A

                        7Fh - 1234h

                                SP    –

                   SP
                                          10h
                            000Ch
push
        PUSH opnd
   SP




                     -
                    -
pop
       POP opnd
  SP




                      -
            -     –   -   '
(stack
      over/underflow)
-

    •
    •
    •
    •
label:
     •
     •
          -
      •
ret
-
            CALL label

label         -
call
       call        •
IP
              IP   •




                   •
ret           -
     call
                              ret
IP

                  end -
-‫א‬
AL- AH
 AH
         AL-
               -‫ב‬
-

    .1
    .2
    .3
.model small
.stack 100h
.data
.code
begin:         mov ax, @data
               mov ds , as
               mov ah,[50h]
               mov bh,[51h]
               mov ch,[52h]
               mov dh,[53h]
               call add_numbers
sof:            mov ah,4ch
               Int 21h
add_numbers: mov dl, 0            -
             add dl, ah
             add dl, bh
             add dl, ch
             add dl, dh
             ret
               end
.model small
.stack 100h
.data
.code
mov ax, @data
mov ds , as
begin: call add_numbers
sof:    mov ah,4ch
               Int 21h
add_numbers: mov ah,[50h]               -
             mov bh,[51h]
                         mov ch,[52h]
                         mov dh,[53h]
                         mov dl, 0
                         add dl, ah
                         add dl, bh
                         add dl, ch
                         add dl, dh
                         ret
               end
.model small
.stack 100h
.data
x db 5
y db 10
z db 20
w db 17
sum db 0
.code
mov ax, @data
mov ds , as
begin:         call add_numbers
sof:            mov ah,4ch
                Int 21h
add_numbers:                 mov ah, 0     -
                             add ah , x
                             add ah, y
                             add ah, z
                             add ah, w
                             mov sum, ah
                             ret
                end
-       •


    -   •
.model small
.stack 100h
.data
.code
mov ax, @data
mov ds , as
begin:               mov ah ,0
                     mov al, [50h]
                     push ax
                     mov al, [51h]
                     push ax
                     mov al, [52h]
                     push ax
                     mov al, [53h]
                     push ax
                     call add_numbers
sof:    mov ah,4ch
        Int 21h
add_numbers:                    pop bx       -
                                 pop ax
                                 pop dx
                                add dl, al
                                 pop ax
                                add dl, al
                                pop ax
                                add dl, al
                                push bx
                                ret
                     end
-
20
     50h



               -

More Related Content

What's hot (6)

"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!..."A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
 
Concurrency in Python4k
Concurrency in Python4kConcurrency in Python4k
Concurrency in Python4k
 
Exploring slides
Exploring slidesExploring slides
Exploring slides
 
Deferred Gratification
Deferred GratificationDeferred Gratification
Deferred Gratification
 
Problemas de Arreglos en c++
Problemas de Arreglos en c++Problemas de Arreglos en c++
Problemas de Arreglos en c++
 
python-message-0.1.0
python-message-0.1.0python-message-0.1.0
python-message-0.1.0
 

Similar to פרק 6 המחסנית ותת תכניות

Similar to פרק 6 המחסנית ותת תכניות (11)

CoffeeScript for the Rubyist
CoffeeScript for the RubyistCoffeeScript for the Rubyist
CoffeeScript for the Rubyist
 
Lenguaje ensamblador EMU8086
Lenguaje ensamblador EMU8086Lenguaje ensamblador EMU8086
Lenguaje ensamblador EMU8086
 
Lec06
Lec06Lec06
Lec06
 
Instalación de emu8086 y compilados
Instalación de emu8086 y compiladosInstalación de emu8086 y compilados
Instalación de emu8086 y compilados
 
CoffeeScript for the Rubyist
CoffeeScript for the RubyistCoffeeScript for the Rubyist
CoffeeScript for the Rubyist
 
Algoritmos ensambladores
Algoritmos ensambladoresAlgoritmos ensambladores
Algoritmos ensambladores
 
Maicrocontroller lab basic experiments
Maicrocontroller lab basic experimentsMaicrocontroller lab basic experiments
Maicrocontroller lab basic experiments
 
Maicrocontroller lab basic experiments
Maicrocontroller lab basic experimentsMaicrocontroller lab basic experiments
Maicrocontroller lab basic experiments
 
Maicrocontroller lab basic experiments
Maicrocontroller lab basic experiments Maicrocontroller lab basic experiments
Maicrocontroller lab basic experiments
 
Micro Controller lab basic experiments (1)
Micro Controller lab basic experiments (1)Micro Controller lab basic experiments (1)
Micro Controller lab basic experiments (1)
 
Winter training,Readymade Projects,Buy Projects,Corporate Training
Winter training,Readymade Projects,Buy Projects,Corporate TrainingWinter training,Readymade Projects,Buy Projects,Corporate Training
Winter training,Readymade Projects,Buy Projects,Corporate Training
 

More from lizliziz

מערך דו ממדי
מערך דו ממדימערך דו ממדי
מערך דו ממדי
lizliziz
 
מצגת+טו+בשבט ימבל
מצגת+טו+בשבט ימבלמצגת+טו+בשבט ימבל
מצגת+טו+בשבט ימבל
lizliziz
 
פרק 3 ארגון תכניות וביצוען
פרק 3 ארגון תכניות וביצועןפרק 3 ארגון תכניות וביצוען
פרק 3 ארגון תכניות וביצוען
lizliziz
 
פרק 3 ארגון תכניות וביצוען
פרק 3 ארגון תכניות וביצועןפרק 3 ארגון תכניות וביצוען
פרק 3 ארגון תכניות וביצוען
lizliziz
 
פרק 6 המחסנית ותת תכניות
פרק 6 המחסנית ותת תכניותפרק 6 המחסנית ותת תכניות
פרק 6 המחסנית ותת תכניות
lizliziz
 
פרק 6 המחסנית ותת תכניות
פרק 6 המחסנית ותת תכניותפרק 6 המחסנית ותת תכניות
פרק 6 המחסנית ותת תכניות
lizliziz
 
פרק 3 ארגון תכניות וביצוען
פרק 3 ארגון תכניות וביצועןפרק 3 ארגון תכניות וביצוען
פרק 3 ארגון תכניות וביצוען
lizliziz
 
אופטיקה שיעור 1 (1)
אופטיקה   שיעור 1 (1)אופטיקה   שיעור 1 (1)
אופטיקה שיעור 1 (1)
lizliziz
 
תעתועי ראייה
תעתועי ראייהתעתועי ראייה
תעתועי ראייה
lizliziz
 
אופטיקה – שיעור 4
אופטיקה – שיעור 4אופטיקה – שיעור 4
אופטיקה – שיעור 4
lizliziz
 

More from lizliziz (20)

5
55
5
 
מערך דו ממדי
מערך דו ממדימערך דו ממדי
מערך דו ממדי
 
מצגת+טו+בשבט ימבל
מצגת+טו+בשבט ימבלמצגת+טו+בשבט ימבל
מצגת+טו+בשבט ימבל
 
פרק 5
פרק 5פרק 5
פרק 5
 
פרק 3 ארגון תכניות וביצוען
פרק 3 ארגון תכניות וביצועןפרק 3 ארגון תכניות וביצוען
פרק 3 ארגון תכניות וביצוען
 
פרק 3 ארגון תכניות וביצוען
פרק 3 ארגון תכניות וביצועןפרק 3 ארגון תכניות וביצוען
פרק 3 ארגון תכניות וביצוען
 
פרק 5
פרק 5פרק 5
פרק 5
 
פרק 4
פרק 4פרק 4
פרק 4
 
פרק 2
פרק 2פרק 2
פרק 2
 
Cecile
CecileCecile
Cecile
 
פרק 6 המחסנית ותת תכניות
פרק 6 המחסנית ותת תכניותפרק 6 המחסנית ותת תכניות
פרק 6 המחסנית ותת תכניות
 
פרק 6 המחסנית ותת תכניות
פרק 6 המחסנית ותת תכניותפרק 6 המחסנית ותת תכניות
פרק 6 המחסנית ותת תכניות
 
פרק 5
פרק 5פרק 5
פרק 5
 
פרק 4
פרק 4פרק 4
פרק 4
 
פרק 3 ארגון תכניות וביצוען
פרק 3 ארגון תכניות וביצועןפרק 3 ארגון תכניות וביצוען
פרק 3 ארגון תכניות וביצוען
 
פרק 2
פרק 2פרק 2
פרק 2
 
Ovdanut6
Ovdanut6Ovdanut6
Ovdanut6
 
אופטיקה שיעור 1 (1)
אופטיקה   שיעור 1 (1)אופטיקה   שיעור 1 (1)
אופטיקה שיעור 1 (1)
 
תעתועי ראייה
תעתועי ראייהתעתועי ראייה
תעתועי ראייה
 
אופטיקה – שיעור 4
אופטיקה – שיעור 4אופטיקה – שיעור 4
אופטיקה – שיעור 4
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Recently uploaded (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 

פרק 6 המחסנית ותת תכניות

  • 1. -
  • 2.
  • 3. stack LIFO Last In First Out
  • 4. 000F 000E 000D 000C 000B 000A 10h (stack segment) SS SS
  • 5. 000F 12h 000E 34h 000D 00h 000C 7Fh 000B 000A
  • 7. bos 000F 12h 000E 34h 000D 00h tos 000C 7Fh – 000B – 000A 7Fh - 1234h SP – SP 10h 000Ch
  • 8.
  • 9. push PUSH opnd SP - -
  • 10. pop POP opnd SP - - – - '
  • 11. (stack over/underflow)
  • 12. - • • • •
  • 13. label: • • - • ret
  • 14. - CALL label label -
  • 15. call call • IP IP • •
  • 16. ret - call ret IP end -
  • 17. -‫א‬ AL- AH AH AL- -‫ב‬
  • 18. - .1 .2 .3
  • 19. .model small .stack 100h .data .code begin: mov ax, @data mov ds , as mov ah,[50h] mov bh,[51h] mov ch,[52h] mov dh,[53h] call add_numbers sof: mov ah,4ch Int 21h add_numbers: mov dl, 0 - add dl, ah add dl, bh add dl, ch add dl, dh ret end
  • 20. .model small .stack 100h .data .code mov ax, @data mov ds , as begin: call add_numbers sof: mov ah,4ch Int 21h add_numbers: mov ah,[50h] - mov bh,[51h] mov ch,[52h] mov dh,[53h] mov dl, 0 add dl, ah add dl, bh add dl, ch add dl, dh ret end
  • 21. .model small .stack 100h .data x db 5 y db 10 z db 20 w db 17 sum db 0 .code mov ax, @data mov ds , as begin: call add_numbers sof: mov ah,4ch Int 21h add_numbers: mov ah, 0 - add ah , x add ah, y add ah, z add ah, w mov sum, ah ret end
  • 22. - • - •
  • 23. .model small .stack 100h .data .code mov ax, @data mov ds , as begin: mov ah ,0 mov al, [50h] push ax mov al, [51h] push ax mov al, [52h] push ax mov al, [53h] push ax call add_numbers sof: mov ah,4ch Int 21h add_numbers: pop bx - pop ax pop dx add dl, al pop ax add dl, al pop ax add dl, al push bx ret end
  • 24. - 20 50h -