Page 156 - Introduction to Microcontrollers Architecture, Programming, and Interfacing of The Motorola 68HC12
P. 156
PROBLEMS 133
PROBLEMS
1 . Give the SI and S9 records for the program in Figure 1.5.
2 . Give the program source code (in the style of Figure 1.5) for the following S-
record: S10D0800FC0852FD0854137C08564E.
3 . Write a shortest program segment to translate an ASCII SI record located in a 32-
character vector SRECORD, to write its data into SRAM.
4 . Write a parameter file for the 'B32. Its SRAM, EEPROM, and flash memory are to
be the segments, with the same names; the sections are .data, .text, and .pgm; segment
SRAM contains section .data; segment EEPROM contains section .text; and segment
flash contains section .pgm. The starting address, named BEGIN, is to be put in $FFFE.
The input file is to be progB32.o, and the output file is to be called progB32.abs.
5 . Write a parameter file for the 'A4. Its SRAM and EEPROM are to be the
segments, with the same names; the sections are .data and .text; segment SRAM
contains section .data; and segment EEPROM contains section .text. The starting
address, named START, is to be put in $FFFE. The input file is to be progA4.o, and the
output file is to be called progA4.abs.
6 . Write a parameter file for an expanded bus 'A4. Its internal SRAM, extended
memory SRAM at $7000 to $7FFF, internal EEPROM at $4000 to $4FFF, and
external ROM at $8000 to $FFFF, are to be the segments with the names ISRAM,
ESRAM, EEPROM, and ROM; and the sections are .data , .edata, .text, and .pgm.
Segment ISRAM contains section .data, segment ESRAM contains section .edata,
segment EEPROM contains section .text, and segment ROM contains section .pgm.
The starting address, named BEGIN, is to be put in $FFFE. The input files are to be
camcorder 1 .o, camcorder2.o, camcorderS.o, and carncorder4.o, and the output file is to be
called camcorder .abs.
7 . Write a relocatable assembler program that uses fuzzy logic, that has a section .text
that just calls fuzzy logic subroutines FUZZY and ADJUST one after another without
arguments, and a section .pgm that has in it fuzzy logic subroutines FUZZY and
ADJUST, which just have RTS instructions in them. Comment on the use of a
relocatable assembler to break long programs into more manageable parts.
8. Write a relocatable assembler program that has a section .text that just calls
subroutines OUTCH, OUTS, OUTDEC, and OUTHEX one after another. The argument
in Accumulator A, for OUTCH, OUTDEC, and OUTHEX, is $41. The argument for
OUTS, passed in index register X, is the address of string STRING 1. A section .pgm has
in it subroutines OUTCH, OUTS, OUTDEC, and OUTHEX, which just have RTS
instructions in them, and the string STRING1, which is "Well done\r". Comment on the
use of a relocatable assembler to break long programs into more manageable parts.