You are on page 1of 16

Programação

Orientada a Objeto
Luiz Carlos do Nascimento
e-mail: nascimentolc@ufsj.edu.br

Departamento de Engenharia Elétrica – DEPEL


Universidade Federal de São João del-Rei - UFSJ
Ementa
 Linguagem C++;Programação Orientada a Objetos;
Estrutura de dados;
 Programação Orientada a Componentes - Standard
Template Library;
 Programação Concorrente (Linhas de Execução ou
Threads);
 Aplicação em sistemas elétricos;
Objetivo
 Introduzir a linguagem c++.
 Utilizar diagrama de classes para modelar sistemas elétricos.
 Utilizar estruturas de dados e STL em programas para programas
de complexidade elevada e programação concorrentes para
ferramentas computacionais com alto tempo computacional.
Avaliação
 Avaliações
 Trabalhos
Bibliografia
 DEITEL, H. M.; DEITEL, P. J. C++ Como Programar. 3ª Edição.
Bookman. 2001.
 Wiener, Richard. Programacao orientada para objeto e C++. Sao
Paulo: Makron, 1991.
 Ezzell, Ben. Programacao em Turbo C++: uma abordagem orientada
por objeto. Rio de Janeiro: Ciencia Moderna, 1991.
 SEBESTA, R. W. Conceitos de Linguagens de Programação. 5ª
Edição. Bookman 2003.
 HORSTMANN, C. Conceitos de Computação com o Essencial de C++,
3ª edição, Bookman, 2003.
 RUMBAUGH, J.; JACOBSON, I.; BOOCH, G. The Unified Modeling
Language Reference Manual. 2nd Edition. Addison-Wesley. 2005.
 LARGMAN, G. Applying UML and Patterns – An Introduction to Object-
Oriented Analysis and Design. Prentice Hall. 1998.
 BEZERRA, E. Princípios de Análise e Projeto de Sistemas com UML.
Editora Campus. 2003.
Ferramentas
 Visual Studio Express (Visual Studio Community 2015)
 Link
 https://www.visualstudio.com/pt-br/products/visual-studio-express-
vs.aspx
Linguagem Assembler
Código C++
int main()
{
int linha = 2;
bool tipo = 1;

if (tipo == 1)
linha = 3;

return 0;
}
Linguagem Assembler
; Listing generated by Microsoft (R) Optimizing _tipo$ = -17; size = 1 jneSHORT $LN2@main
Compiler Version 19.00.23026.0 _linha$ = -8; size = 4
_mainPROC; COMDAT ;9 : linha = 3;
TITLEC:\Gdrive\Atual\02-
2016\teste1\aula\Source.cpp ;4 :{ movDWORD PTR _linha$[ebp], 3
.686P $LN2@main:
.XMM pushebp
include listing.inc movebp, esp ; 10 :
.modelflat subesp, 216; 000000d8H ; 11 : return 0;
pushebx
INCLUDELIB MSVCRTD pushesi xoreax, eax
INCLUDELIB OLDNAMES pushedi
leaedi, DWORD PTR [ebp-216] ; 12 : }
PUBLIC_main movecx, 54; 00000036H
EXTRN__RTC_InitBase:PROC moveax, -858993460; ccccccccH popedi
EXTRN__RTC_Shutdown:PROC rep stosd popesi
;COMDAT rtc$TMZ popebx
rtc$TMZSEGMENT ;5 : int linha = 2; movesp, ebp
__RTC_Shutdown.rtc$TMZ DD popebp
FLAT:__RTC_Shutdown
movDWORD PTR _linha$[ebp], 2 ret0
rtc$TMZENDS
_mainENDP
;COMDAT rtc$IMZ
;6 : bool tipo = 1; _TEXTENDS
rtc$IMZSEGMENT
END
__RTC_InitBase.rtc$IMZ DD
FLAT:__RTC_InitBase movBYTE PTR _tipo$[ebp], 1
rtc$IMZENDS
; Function compile flags: /Odtp /RTCsu /ZI ;7 :
; File c:\gdrive\atual\02- ;8 : if (tipo == 1)
2016\teste1\aula\source.cpp
;COMDAT _main movzxeax, BYTE PTR _tipo$[ebp]
_TEXTSEGMENT cmpeax, 1
Linguagem Assembler
;5 : int linha = 2;
movDWORD PTR _linha$[ebp], 3
movDWORD PTR _linha$[ebp], 2 $LN2@main:

;6 : bool tipo = 1; ; 10 :
; 11 : return 0;
movBYTE PTR _tipo$[ebp], 1

;7 :
;8 : if (tipo == 1)

movzxeax, BYTE PTR _tipo$[ebp]


cmpeax, 1
jneSHORT $LN2@main

;9 : linha = 3;
Processador 8085
Intel 8085 foi um microprocessador de 8 bits produzido
pela Intel em meados dos anos 1970. Ele era compatível
a nível binário com o popular Intel 8080, mas precisava
de menos hardware de suporte, permitindo assim a
construção de sistemas mais simples e menos
dispendiosos. (Fonte wikipedia)
Configuração:
 processador
 2k bytes de EPROM ou ROM
 256 bytes de RAM
 1 timer
 3 entradas de interrupção
 38 linhas de E/S
Processador 8085

Fonte: http://www.dgtal-sysworld.co.in/
Processador 8085
Registradores

Fonte: http://www.dgtal-sysworld.co.in/
Linguagem Assembler
Somar dois números

MVI D, 8BH
MVI C, 6FH
MOV A, C
ADD D
OUT PORT1
HLT
Linguagem Assembler
Definir qual o maior número
MVI B, 30H
MVI C, 40H
MOV A, B
CMP C
JZ EQU
JC GRT
OUT PORT1
HLT
EQU: MVI A, 01H
OUT PORT1
HLT
GRT: MOV A, C
OUT PORT1
HLT
Linguagem Assembler
Definir qual o maior número HLT
MVI B, 30H saida:
MVI C, 40H OUT PORT1
MOV A, B ret
CMP C
JZ EQU
JC GRT
call saida
HLT
EQU: MVI A, 01H
call saida
HLT
GRT: MOV A, C
call saida
Linguagem Assembler – código binário

Fonte: Intel
8080/8085
ASSEMBLY
LANGUAGE
PROGRAMMING
MANUAL

You might also like