Linguagem De Montagem
Dissertações: Linguagem De Montagem. Pesquise 862.000+ trabalhos acadêmicosPor: Niddy • 4/8/2013 • 3.743 Palavras (15 Páginas) • 465 Visualizações
Objetivo:
Uma linguagem de montagem ou assembly é uma notação legível por humanos para o código de máquina que uma arquitetura de computador específica usa.
Compreensão de tal linguagem permite programar processadores no nível de máquina além de promover o entendimento de conceitos básicos de arquitetura de computadores.
PORTAA EQU $00
PORTAB EQU $01
PORTAD EQU $03
DDRA EQU $04
DDRB EQU $05
DDRD EQU $07
VDELAY EQU $88
CONTADC EQU $3C
REGADC EQU $3D
CONFADC EQU $3E
DOG EQU $1F
TIMEC EQU $20
TIMEVH EQU $23
TIMEVL EQU $24
TESTE EQU $81
TESTEH EQU $82
TESTEL EQU $83
ORG $EC00
INICIO MOV #%0000000,PORTAA
CLR PORTAB
CLR PORTAD
MOV #%0000000,DDRA
MOV #%11110001,DDRB
MOV #%11111111,DDRD
JSR INICLCD
MOV #'L',PORTAD
JSR ENV_CHAR
MOV #'O',PORTAD
JSR ENV_CHAR
MOV #'A',PORTAD
JSR ENV_CHAR
MOV #'D',PORTAD
JSR ENV_CHAR
MOV #'I',PORTAD
JSR ENV_CHAR
MOV #'N',PORTAD
JSR ENV_CHAR
MOV #'G',PORTAD
JSR ENV_CHAR
MOV #'.',PORTAD
JSR ENV_CHAR
MOV #'.',PORTAD
JSR ENV_CHAR
MOV #'.',PORTAD
JSR ENV_CHAR
MOV #02T,VDELAY
JSR DELAY
JSR LIMP
;JSR RESET
JSR LIMP
JSR TESTTECLA
JMP INICIO
;#############################################################################
; RESET
RESET JSR INICLCD
MOV #':',PORTAD
JSR ENV_CHAR
RTS
;#############################################################################
;#############################################################################
;BCD
BCD
LDA REGADC
LDX #2T
MUL
STX TESTEH
STA TESTEL
BRCLR 0,TESTEH,ENTAO
SENAO LDHX #256T
BRA FORA1
ENTAO LDHX #00T
FORA1 LDA TESTEL
LDX #100T
DIV
STA TESTE
LDA TESTE
ADD #$30
STA PORTAD
JSR ENV_CHAR
MOV #'.',PORTAD
JSR ENV_CHAR
STHX TESTEH
LDHX #00T
LDA TESTEH
LDX #10T
DIV
STA TESTE
LDA TESTE
ADD #$30
STA PORTAD
JSR ENV_CHAR
STHX TESTEH
LDHX #00T
LDA TESTEH
STA TESTE
LDA TESTE
ADD #$30
STA PORTAD
JSR ENV_CHAR
RTS
;#############################################################################
;#############################################################################
...