

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
An assembly program illustration, explaining the use of labels, directives, mnemonics, operands, and memory organization. The program copies data from one record to another, counting the number of bytes in each record. It also differentiates between program and data memory, and instruction, directives, and opcodes.
Typology: Study notes
1 / 3
This page cannot be seen from the preview
Don't miss anything!


label 1 mnemonic^2 operand 3 prog./data machine opcode^5 directive 1 mem. addr. 4 ORG $6000 = 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 + ORG $4000 = 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 F 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
YELLOW HIGHLIGHTS show memory addresses GREEN HIGHLIGHTS show data for data memory PINK HIGHLIGHTS show reserved memory bytes in data memory, initiated with value 00 BLUE HIGHLIGHTS show ASM program opcodes to be stored in program memory
MEMORY
MCU Registers
Program
Data
Stack
Unused/ Reserved
Unused/ Reserved
ADDRESS
$
$
$
$
4000 CF 4001 80 4002 00
402D 18 402E 0F
. . .
6000 AA 6001 BB
602B 00 602C 00
. . .
7FFF
top of program
top of data
end of data
bottom of stack
top of stack (varies)
end of program
more data /sta ck
more progra m