Program-Assembly_Illustration

Program-Assembly_Illustration - Program Assembly...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Program Assembly Illustration ASSEMBLY OF DIRECTIVES AND ASM INSTRUCTIONS Assembly Code Assembled Code (.LST file) label 1 mnemonic 2 operand 3 prog./data machine opcode 5 directive 1 mem. addr. 4 ORG $6000 =00006000 D_REC FCB $AA,$BB,$CC,$FF,$EE,$01 6000 AA BB CC FF EE 01 FCB $A1,$B2,$C3,$F4,$01 6006 A1 B2 C3 F4 01 FCB $81,$72,$63,$54,$45,$E5,$01 600B 81 72 63 54 45 E5 01 RESULT RMB $0A 6012 +000A D_CPY RMB $10 601C +0010 ORG $4000 =00004000 LDS #$8000 4000 CF 8000 LDX # D_REC 4003 CE 6000 LDY # D_CPY 4006 CD 601C LDAA #$0 4009 86 00 PSHA 400B 36 LOOP LDAB 0,X 400C E6 00 STAB 0,Y 400E 6B 40 CMPB #$01 4010 C1 01 BEQ ENDLP 4012 27 05 INX 4014 08 INY 4015 02 INCA 4016 42 BRA LOOP 4017 20 F3 ENDLP PULB 4019 33 PSHY 401A 35 LDY # RESULT 401B CD 6012 STAA B,Y 401E 6A ED PULY 4020 31 INCB 4021 52 PSHB 4022 37 CPX # RESULT 4023 8E 6012 BEQ DONE 4026 27 05 INX 4028 08 INY 4029 02 CLRA 402A 87 BRA LOOP 402B 20 DF DONE TBA 402D 18 0F END Notes: 1. Labels and Directives are used by the assembler to simplify writing code and direct the assembly process. During assembly, all labels are replaced with appropriate hexadecimal values. Directives do not result in any program opcodes, although they can generate data to be stored in memory. 2.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/29/2009 for the course ECE 331 taught by Professor M.shanblatt during the Spring '08 term at Michigan State University.

Page1 / 3

Program-Assembly_Illustration - Program Assembly...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online