SlideShare a Scribd company logo
1 of 14
Download to read offline
Alex Jhonatan Toapanta Molina | Compiladores | 19 de abril de 2018
Informe de Instalación de
Ensamblador EMU8086
PÁGINA 1
INSTALACION DEL ENSAMBLADOR EMU8086
PÁGINA 2
PÁGINA 3
PÁGINA 4
PÁGINA 5
DECOMPILACION HOLAMUNDO
.model small
.stack
.data
saludo db "Hola mundo!!!n Alex Toapanta - PUCE-SI - Compiladores - 19/4/2018", "$"
PÁGINA 6
.code
main proc ;Inicia proceso
mov ax,seg saludo ;hmm ¿seg?
mov ds,ax ;ds = ax = saludo
mov ah,09 ;Function(print string)
lea dx,saludo ;DX = String terminated by "$"
int 21h ;Interruptions DOS Functions
;mensaje en pantalla
mov ax,4c00h ;Function (Quit with exit code (EXIT))
int 21h ;Interruption DOS Functions
main endp ;Termina proceso
end main
PÁGINA 7
Compilar un programa que permita comparar 2 números del 0 al 9.
name "calc-sum"
org 100h ; directive make tiny com file.
; calculate the sum of elements in vector,
; store result in m and print it in binary code.
; number of elements:
mov cx, 10
; al will store the sum:
mov al, 0
; bx is an index:
PÁGINA 8
mov bx, 0
; sum elements:
next: add al, vector[bx]
; next byte:
inc bx
; loop until cx=0:
loop next
; store result in m:
mov m, al
; print result in binary:
mov bl, m
mov cx, 8
print: mov ah, 2 ; print function.
Mov dl, '0'
test bl, 10000000b ; test first bit.
jz zero
mov dl, '1'
zero: int 21h
shl bl, 1
loop print
; print binary suffix:
mov dl, 'b'
int 21h
mov dl, 0ah ; new line.
int 21h
mov dl, 0dh ; carrige return.
int 21h
; print result in decimal:
mov al, m
call print_al
; wait for any key press:
mov ah, 0
int 16h
ret
; variables:
vector db 5, 4, 5, 2, 1, 9, 1, 2, 5, 7
m db 0
print_al proc
cmp al, 0
jne print_al_r
push ax
mov al, '0'
mov ah, 0eh
int 10h
pop ax
ret
print_al_r:
pusha
mov ah, 0
cmp ax, 0
je pn_done
mov dl, 10
div dl
PÁGINA 9
call print_al_r
mov al, ah
add al, 30h
mov ah, 0eh
int 10h
jmp pn_done
pn_done:
popa
ret
endp
COMPILAR UN PROGRAMA QUE PERMITA SUMAR 10 VALORES ASIGNADOS EN UN
VECTOR
PÁGINA 10
name "calc-sum"
org 100h ; directive make tiny com file.
; calculate the sum of elements in vector,
; store result in m and print it in binary code.
; number of elements:
mov cx, 10
; al will store the sum:
mov al, 0
; bx is an index:
mov bx, 0
; sum elements:
next: add al, vector[bx]
; next byte:
inc bx
; loop until cx=0:
loop next
; store result in m:
mov m, al
; print result in binary:
mov bl, m
mov cx, 8
print: mov ah, 2 ; print function.
Mov dl, '0'
test bl, 10000000b ; test first bit.
jz zero
mov dl, '1'
zero: int 21h
shl bl, 1
loop print
; print binary suffix:
mov dl, 'b'
int 21h
PÁGINA 11
mov dl, 0ah ; new line.
int 21h
mov dl, 0dh ; carrige return.
int 21h
; print result in decimal:
mov al, m
call print_al
; wait for any key press:
mov ah, 0
int 16h
ret
; variables:
vector db 5, 4, 5, 2, 1, 9, 1, 2, 5, 7
m db 0
print_al proc
cmp al, 0
jne print_al_r
push ax
mov al, '0'
mov ah, 0eh
int 10h
pop ax
ret
print_al_r:
pusha
mov ah, 0
cmp ax, 0
je pn_done
mov dl, 10
div dl
call print_al_r
mov al, ah
add al, 30h
mov ah, 0eh
int 10h
jmp pn_done
pn_done:
popa
ret
endp
PÁGINA 12
DECOMPILACION DE UN PROGRAMA ADICIONAL
COMPARAR SI DOS CADENAS SON IGUALES
org 100h
comienzo:
PÁGINA 13
mov si, x
mov al, msg2[si]
cmp msg[si], al ;comparar letra por letra las cadenas, si uno no coincide mand
a directamente a fin y termina el programa
jne fin:
cmp msg[si], "$" ;si es el final y el programa llega aca, quiere decir que son
iguales
jz final:
inc x
loop comienzo
final:
mov dx, offset msg3
mov ah, 9
int 21h
fin:
ret
msg db "hello world $"
msg2 db "hello world $"
msg3 db "Son iguales $"
x dw 0

More Related Content

What's hot

What's hot (19)

Job09
Job09Job09
Job09
 
Java Code for Sample Projects Methods
Java Code for Sample Projects MethodsJava Code for Sample Projects Methods
Java Code for Sample Projects Methods
 
คำสั่ง For
คำสั่ง Forคำสั่ง For
คำสั่ง For
 
Compiladores emu8086
Compiladores emu8086Compiladores emu8086
Compiladores emu8086
 
Kelompok 4
Kelompok 4Kelompok 4
Kelompok 4
 
Instalación de emu8086 y compilados
Instalación de emu8086 y compiladosInstalación de emu8086 y compilados
Instalación de emu8086 y compilados
 
Assignement of programming & problem solving
Assignement of programming & problem solvingAssignement of programming & problem solving
Assignement of programming & problem solving
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
Week 7
Week 7Week 7
Week 7
 
Compiladoresemulador
CompiladoresemuladorCompiladoresemulador
Compiladoresemulador
 
Michael kontopoulos
Michael kontopoulosMichael kontopoulos
Michael kontopoulos
 
Advanced QUnit - Front-End JavaScript Unit Testing
Advanced QUnit - Front-End JavaScript Unit TestingAdvanced QUnit - Front-End JavaScript Unit Testing
Advanced QUnit - Front-End JavaScript Unit Testing
 
Algoritmos ensambladores
Algoritmos ensambladoresAlgoritmos ensambladores
Algoritmos ensambladores
 
algorithmdivs
algorithmdivsalgorithmdivs
algorithmdivs
 
Coding with Vim
Coding with VimCoding with Vim
Coding with Vim
 
Cse presentation ratul
Cse presentation ratulCse presentation ratul
Cse presentation ratul
 
Exp 8...
Exp 8...Exp 8...
Exp 8...
 
Useless Box
Useless BoxUseless Box
Useless Box
 
Python 3 - tutorial
Python 3 - tutorialPython 3 - tutorial
Python 3 - tutorial
 

Similar to Sum 10 Values and Compare Strings in 8086 Assembly

Taller practico emu8086_galarraga
Taller practico emu8086_galarragaTaller practico emu8086_galarraga
Taller practico emu8086_galarragaFabricio Galárraga
 
chapter 7 Logic, shift and rotate instructions
chapter 7 Logic, shift and rotate instructionschapter 7 Logic, shift and rotate instructions
chapter 7 Logic, shift and rotate instructionswarda aziz
 
Emulador de ensamblador emu8086
Emulador de ensamblador emu8086Emulador de ensamblador emu8086
Emulador de ensamblador emu8086Marco Muñoz
 
Chapter 6 Flow control Instructions
Chapter 6 Flow control InstructionsChapter 6 Flow control Instructions
Chapter 6 Flow control Instructionswarda aziz
 
1) (a) Write a code fragment which adds the 32-bit contents of $8100.pdf
1) (a) Write a code fragment which adds the 32-bit contents of $8100.pdf1) (a) Write a code fragment which adds the 32-bit contents of $8100.pdf
1) (a) Write a code fragment which adds the 32-bit contents of $8100.pdfaromanets
 
Assembly language programs 2
Assembly language programs 2Assembly language programs 2
Assembly language programs 2HarshitParkar6677
 
Emuladores
EmuladoresEmuladores
EmuladoresBayoch
 
Microprocessor and micro-controller lab (assembly programming)
Microprocessor and micro-controller lab (assembly programming)Microprocessor and micro-controller lab (assembly programming)
Microprocessor and micro-controller lab (assembly programming)shamim hossain
 
Maicrocontroller lab basic experiments
Maicrocontroller lab basic experimentsMaicrocontroller lab basic experiments
Maicrocontroller lab basic experimentsNoor Tahasildar
 
Maicrocontroller lab basic experiments
Maicrocontroller lab basic experimentsMaicrocontroller lab basic experiments
Maicrocontroller lab basic experimentsnoorahamed tahasildar
 
Calculator 8086 Assembly Language Programming
Calculator 8086 Assembly Language Programming Calculator 8086 Assembly Language Programming
Calculator 8086 Assembly Language Programming Sami Ullah
 
Maicrocontroller lab basic experiments
Maicrocontroller lab basic experiments Maicrocontroller lab basic experiments
Maicrocontroller lab basic experiments noorahamed tahasildar
 
Micro Controller lab basic experiments (1)
Micro Controller lab basic experiments (1)Micro Controller lab basic experiments (1)
Micro Controller lab basic experiments (1)Noor Tahasildar
 

Similar to Sum 10 Values and Compare Strings in 8086 Assembly (20)

Assembler
AssemblerAssembler
Assembler
 
Taller practico emu8086_galarraga
Taller practico emu8086_galarragaTaller practico emu8086_galarraga
Taller practico emu8086_galarraga
 
Taller Ensambladores
Taller EnsambladoresTaller Ensambladores
Taller Ensambladores
 
chapter 7 Logic, shift and rotate instructions
chapter 7 Logic, shift and rotate instructionschapter 7 Logic, shift and rotate instructions
chapter 7 Logic, shift and rotate instructions
 
Emulador de ensamblador emu8086
Emulador de ensamblador emu8086Emulador de ensamblador emu8086
Emulador de ensamblador emu8086
 
Chapter 6 Flow control Instructions
Chapter 6 Flow control InstructionsChapter 6 Flow control Instructions
Chapter 6 Flow control Instructions
 
1) (a) Write a code fragment which adds the 32-bit contents of $8100.pdf
1) (a) Write a code fragment which adds the 32-bit contents of $8100.pdf1) (a) Write a code fragment which adds the 32-bit contents of $8100.pdf
1) (a) Write a code fragment which adds the 32-bit contents of $8100.pdf
 
Assembly language programs 2
Assembly language programs 2Assembly language programs 2
Assembly language programs 2
 
Emuladores
EmuladoresEmuladores
Emuladores
 
Lab report assembly
Lab report assemblyLab report assembly
Lab report assembly
 
Assembly language programs
Assembly language programsAssembly language programs
Assembly language programs
 
Lecture6
Lecture6Lecture6
Lecture6
 
Microprocessor and micro-controller lab (assembly programming)
Microprocessor and micro-controller lab (assembly programming)Microprocessor and micro-controller lab (assembly programming)
Microprocessor and micro-controller lab (assembly programming)
 
Plsql programs(encrypted)
Plsql programs(encrypted)Plsql programs(encrypted)
Plsql programs(encrypted)
 
Mcs 17 solved assignment 2015- 16
Mcs 17 solved assignment 2015- 16Mcs 17 solved assignment 2015- 16
Mcs 17 solved assignment 2015- 16
 
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
 
Calculator 8086 Assembly Language Programming
Calculator 8086 Assembly Language Programming Calculator 8086 Assembly Language Programming
Calculator 8086 Assembly Language Programming
 
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)
 

More from Alex Toapanta

Practica instalación maquinas virtuales en VMware
Practica instalación maquinas virtuales en VMwarePractica instalación maquinas virtuales en VMware
Practica instalación maquinas virtuales en VMwareAlex Toapanta
 
Practica 3 Informática Legal
Practica 3 Informática LegalPractica 3 Informática Legal
Practica 3 Informática LegalAlex Toapanta
 
Practica nro 2 Informática Forense
Practica nro 2 Informática ForensePractica nro 2 Informática Forense
Practica nro 2 Informática ForenseAlex Toapanta
 
Practica recuperar archivo eliminado
Practica recuperar archivo eliminadoPractica recuperar archivo eliminado
Practica recuperar archivo eliminadoAlex Toapanta
 
Taller principios analisis forense
Taller principios analisis forenseTaller principios analisis forense
Taller principios analisis forenseAlex Toapanta
 
Metodología de Análisis Forense
Metodología de Análisis ForenseMetodología de Análisis Forense
Metodología de Análisis ForenseAlex Toapanta
 
Practica 2 Procesamiento de imágenes con matlab
Practica 2 Procesamiento de imágenes con matlabPractica 2 Procesamiento de imágenes con matlab
Practica 2 Procesamiento de imágenes con matlabAlex Toapanta
 
Taller n18: Perito Informático
Taller n18: Perito InformáticoTaller n18: Perito Informático
Taller n18: Perito InformáticoAlex Toapanta
 
Ciclos repetición matlab
Ciclos repetición matlabCiclos repetición matlab
Ciclos repetición matlabAlex Toapanta
 
Practica5 matlab funciontes
Practica5 matlab funciontesPractica5 matlab funciontes
Practica5 matlab funciontesAlex Toapanta
 
Graficas sencillas matlab
Graficas sencillas matlabGraficas sencillas matlab
Graficas sencillas matlabAlex Toapanta
 
La luz y el espectro electromagnetico
La luz y el espectro electromagneticoLa luz y el espectro electromagnetico
La luz y el espectro electromagneticoAlex Toapanta
 
Fundamentos de la teoria del color
Fundamentos de la teoria del colorFundamentos de la teoria del color
Fundamentos de la teoria del colorAlex Toapanta
 

More from Alex Toapanta (20)

Practica pishing 2
Practica pishing 2Practica pishing 2
Practica pishing 2
 
Practica instalación maquinas virtuales en VMware
Practica instalación maquinas virtuales en VMwarePractica instalación maquinas virtuales en VMware
Practica instalación maquinas virtuales en VMware
 
Practica 3 Informática Legal
Practica 3 Informática LegalPractica 3 Informática Legal
Practica 3 Informática Legal
 
Practica nro 2 Informática Forense
Practica nro 2 Informática ForensePractica nro 2 Informática Forense
Practica nro 2 Informática Forense
 
Practica recuperar archivo eliminado
Practica recuperar archivo eliminadoPractica recuperar archivo eliminado
Practica recuperar archivo eliminado
 
Taller segmentacion
Taller segmentacionTaller segmentacion
Taller segmentacion
 
Taller principios analisis forense
Taller principios analisis forenseTaller principios analisis forense
Taller principios analisis forense
 
Metodología de Análisis Forense
Metodología de Análisis ForenseMetodología de Análisis Forense
Metodología de Análisis Forense
 
Practica 2 Procesamiento de imágenes con matlab
Practica 2 Procesamiento de imágenes con matlabPractica 2 Procesamiento de imágenes con matlab
Practica 2 Procesamiento de imágenes con matlab
 
Taller n18: Perito Informático
Taller n18: Perito InformáticoTaller n18: Perito Informático
Taller n18: Perito Informático
 
Imagenes con matlab
Imagenes con matlabImagenes con matlab
Imagenes con matlab
 
Ciclos repetición matlab
Ciclos repetición matlabCiclos repetición matlab
Ciclos repetición matlab
 
Practica5 matlab funciontes
Practica5 matlab funciontesPractica5 matlab funciontes
Practica5 matlab funciontes
 
Graficas sencillas matlab
Graficas sencillas matlabGraficas sencillas matlab
Graficas sencillas matlab
 
Practica3 matlab
Practica3 matlabPractica3 matlab
Practica3 matlab
 
Practica 2 Matlab
Practica 2 MatlabPractica 2 Matlab
Practica 2 Matlab
 
Firma electronica
Firma electronicaFirma electronica
Firma electronica
 
Instalacion matlab
Instalacion matlabInstalacion matlab
Instalacion matlab
 
La luz y el espectro electromagnetico
La luz y el espectro electromagneticoLa luz y el espectro electromagnetico
La luz y el espectro electromagnetico
 
Fundamentos de la teoria del color
Fundamentos de la teoria del colorFundamentos de la teoria del color
Fundamentos de la teoria del color
 

Recently uploaded

(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 

Recently uploaded (20)

DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 

Sum 10 Values and Compare Strings in 8086 Assembly

  • 1. Alex Jhonatan Toapanta Molina | Compiladores | 19 de abril de 2018 Informe de Instalación de Ensamblador EMU8086
  • 2. PÁGINA 1 INSTALACION DEL ENSAMBLADOR EMU8086
  • 6. PÁGINA 5 DECOMPILACION HOLAMUNDO .model small .stack .data saludo db "Hola mundo!!!n Alex Toapanta - PUCE-SI - Compiladores - 19/4/2018", "$"
  • 7. PÁGINA 6 .code main proc ;Inicia proceso mov ax,seg saludo ;hmm ¿seg? mov ds,ax ;ds = ax = saludo mov ah,09 ;Function(print string) lea dx,saludo ;DX = String terminated by "$" int 21h ;Interruptions DOS Functions ;mensaje en pantalla mov ax,4c00h ;Function (Quit with exit code (EXIT)) int 21h ;Interruption DOS Functions main endp ;Termina proceso end main
  • 8. PÁGINA 7 Compilar un programa que permita comparar 2 números del 0 al 9. name "calc-sum" org 100h ; directive make tiny com file. ; calculate the sum of elements in vector, ; store result in m and print it in binary code. ; number of elements: mov cx, 10 ; al will store the sum: mov al, 0 ; bx is an index:
  • 9. PÁGINA 8 mov bx, 0 ; sum elements: next: add al, vector[bx] ; next byte: inc bx ; loop until cx=0: loop next ; store result in m: mov m, al ; print result in binary: mov bl, m mov cx, 8 print: mov ah, 2 ; print function. Mov dl, '0' test bl, 10000000b ; test first bit. jz zero mov dl, '1' zero: int 21h shl bl, 1 loop print ; print binary suffix: mov dl, 'b' int 21h mov dl, 0ah ; new line. int 21h mov dl, 0dh ; carrige return. int 21h ; print result in decimal: mov al, m call print_al ; wait for any key press: mov ah, 0 int 16h ret ; variables: vector db 5, 4, 5, 2, 1, 9, 1, 2, 5, 7 m db 0 print_al proc cmp al, 0 jne print_al_r push ax mov al, '0' mov ah, 0eh int 10h pop ax ret print_al_r: pusha mov ah, 0 cmp ax, 0 je pn_done mov dl, 10 div dl
  • 10. PÁGINA 9 call print_al_r mov al, ah add al, 30h mov ah, 0eh int 10h jmp pn_done pn_done: popa ret endp COMPILAR UN PROGRAMA QUE PERMITA SUMAR 10 VALORES ASIGNADOS EN UN VECTOR
  • 11. PÁGINA 10 name "calc-sum" org 100h ; directive make tiny com file. ; calculate the sum of elements in vector, ; store result in m and print it in binary code. ; number of elements: mov cx, 10 ; al will store the sum: mov al, 0 ; bx is an index: mov bx, 0 ; sum elements: next: add al, vector[bx] ; next byte: inc bx ; loop until cx=0: loop next ; store result in m: mov m, al ; print result in binary: mov bl, m mov cx, 8 print: mov ah, 2 ; print function. Mov dl, '0' test bl, 10000000b ; test first bit. jz zero mov dl, '1' zero: int 21h shl bl, 1 loop print ; print binary suffix: mov dl, 'b' int 21h
  • 12. PÁGINA 11 mov dl, 0ah ; new line. int 21h mov dl, 0dh ; carrige return. int 21h ; print result in decimal: mov al, m call print_al ; wait for any key press: mov ah, 0 int 16h ret ; variables: vector db 5, 4, 5, 2, 1, 9, 1, 2, 5, 7 m db 0 print_al proc cmp al, 0 jne print_al_r push ax mov al, '0' mov ah, 0eh int 10h pop ax ret print_al_r: pusha mov ah, 0 cmp ax, 0 je pn_done mov dl, 10 div dl call print_al_r mov al, ah add al, 30h mov ah, 0eh int 10h jmp pn_done pn_done: popa ret endp
  • 13. PÁGINA 12 DECOMPILACION DE UN PROGRAMA ADICIONAL COMPARAR SI DOS CADENAS SON IGUALES org 100h comienzo:
  • 14. PÁGINA 13 mov si, x mov al, msg2[si] cmp msg[si], al ;comparar letra por letra las cadenas, si uno no coincide mand a directamente a fin y termina el programa jne fin: cmp msg[si], "$" ;si es el final y el programa llega aca, quiere decir que son iguales jz final: inc x loop comienzo final: mov dx, offset msg3 mov ah, 9 int 21h fin: ret msg db "hello world $" msg2 db "hello world $" msg3 db "Son iguales $" x dw 0