



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Notes; Professor: Li; Class: MICROPROCESSOR APPLIC; Subject: ENGINEERING: ELECTRICAL; University: University of Florida; Term: Unknown 1989;
Typology: Study notes
1 / 7
This page cannot be seen from the preview
Don't miss anything!




Dr. Tao Li 1
Dr. Tao Li 2
Dr. Tao Li 3
Dr. Tao Li 4
Dr. Tao Li 5
Dr. Tao Li 6
Dr. Tao Li 7
Dr. Tao Li 8
Dr. Tao Li 9
Dr. Tao Li 10
Dr. Tao Li 11
Dr. Tao Li 12
Dr. Tao Li 19
Dr. Tao Li 20
Dr. Tao Li 21
Dr. Tao Li 22
Dr. Tao Li 23
Dr. Tao Li 24
Dr. Tao Li 25
Dr. Tao Li 26
Dr. Tao Li 27
Dr. Tao Li 28
12 ;; ExampleSource File:program hello.asm to print "Hello World" 34 ;; Author:Created: F. 4/97 M. Cady 0000 56 ; EOS:^ Constant^ EQU equates 0 ; End of string 0000 78 ; printf:^ Debug-12^ EQU Monitor^ $FE06 equates ; Print a string 0000 109 ; PROG:^ Memory^ map EQU^ equates $0800 ; RAM in the EVB 00000000 1112 DATA:STACK: EQUEQU $0900$0a00 ;; MiddleStack pointerof RAM (^0800 1314) ; Initialize ORG (^) stack PROG pointer ; Locate the program 0800 CF0A00 (^1516) ; Print Hello lds (^) World! #STACK string 08030806 CC080CFEFE06 1718 lddldx #HELLOprintf ;; PassThe adrthe ofadr the of printfthe string routine 0809 1500 19 jsr 0,x 080B 3F 2021 ;^ Return^ to swi^ the^ monitor 080C 48656C6C 2223 ; HELLO:^ Define^ the DC.B^ string 'Hello^ to^ print World!',EOS 6F20576F 726C 00 Dr. Tao Li 29
Dr. Tao Li 30
Dr. Tao Li 37
12 ;; Macroshift definitionleft of the for A register a variable arithmetic 0000 34 $MACRO ; Shift (^) the alsa_n A register num left num bits 56 ;; whereSave Bn tois seta parameter up a loop in counter the macro call. 78 pshbldab (^) #%1 ; Save B on the stack 109 loop:^ asladbne^ b,loop ;;^ ShiftDecr andthe branchA^ reg if (^1112) pulb ;; notrestore zero the B reg 0000 1314 $MACROEND ; 1516 ;; The macro call is with a parameter 00000000 macro 37 1718 PSHB alsa_n 3 00010003 C603 48 1920 LDABLOOP: #%1 ASLA 00040007 0431FC 33 2122 DBNEPULB B,LOOP Dr. Tao Li 38
Dr. Tao Li 39
… 5 …; … Constant equates 0000 67 EOS ; Debug-12: EQU Monitor (^0) equates; End of string 0000 89 printf ; Memory: (^) mapEQU equates $FE06 ; Print a string 00000000 1011 PROGDATA:: EQUEQU $0800$0900 ;; RAMMiddle in theof RAMEVB 00000800 1213 STACK : EQUORG (^) PROG$0a00 ;; StackLocate pointer the program 0800 CF0A00 1415 ;^ Initializelds^ stack #STACKpointer 0803 CC080C 1617 ;^ Print^ Helloldd^ World!#HELLO^ string ; Pass the adr of the string 08060809 FEFE06 1500 1819 ldxjsr printf0,x ; The adr of the printf routine 080B 3F 2021 ;^ Return^ toswi^ the^ monitor 080C 48656C6C 2223 ; HELLO^ Define: theDB^ string'Hello^ to^ print World!',EOS 6F20576F 726C 00