Buscar

Codigo Assembly- Solução exercicio

Esta é uma pré-visualização de arquivo. Entre para ver o arquivo original

;-------------------------------------------------------------------------------
; MSP430 Assembler Code Template for use with TI Code Composer Studio
;
;
;-------------------------------------------------------------------------------
 .cdecls C,LIST,"msp430.h" ; Include device header file
 
;-------------------------------------------------------------------------------
 .def RESET ; Export program entry-point to
 ; make it known to linker.
;-------------------------------------------------------------------------------
 .text ; Assemble into program memory.
 .retain ; Override ELF conditional linking
 ; and retain current section.
 .retainrefs ; And retain any sections that have
 ; references to current section.
;-------------------------------------------------------------------------------
RESET mov.w #__STACK_END,SP ; Initialize stackpointer
StopWDT mov.w #WDTPW|WDTHOLD,&WDTCTL ; Stop watchdog timer
;-------------------------------------------------------------------------------
; Main loop here
;-------------------------------------------------------------------------------
	mov #vetorr,R5
	mov.w @R5,R9
	incd R5
	mov.w @R5,R6
	mov #1,R8
	call #maiorele
	jmp $
	nop
maiorele:
	dec R9
	cmp #0,R9
	jeq stop
	incd R5
	cmp.w @R5,R6
	jlo ehmaior
	cmp.w @R5,R6
	jeq ehigual
	jmp maiorele
ehmaior:
	mov.w @R5,R6
	mov #1,R8
	jmp maiorele
ehigual:
	inc R8
	jmp maiorele
stop:
	ret
;-------------------------------------------------------------------------------
; Stack Pointer definition
;-------------------------------------------------------------------------------
 .global __STACK_END
 .sect .stack
 
;-------------------------------------------------------------------------------
; Interrupt Vectors
;-------------------------------------------------------------------------------
 .sect ".reset" ; MSP430 RESET Vector
 .short RESET
 .data
vetorr: .byte 6,0, "JOAQUIMJOSE",0

Teste o Premium para desbloquear

Aproveite todos os benefícios por 3 dias sem pagar! 😉
Já tem cadastro?

Outros materiais