User`s manual

LO - Load S-Records from Host
3-111
3
Example
For this example, assume that a host system was used to create the
following program:
.file “test.s”
#
# retrieve contents of the RTC registers
#
.toc
T.FD: .tc FD.4330000080000000[tc] ,1127219200,-2147483648
.toc
T..test:
.tc ..test[tc], test[ds]
T..LDATA:
.tc ..LDATA[tc], .LDATA
T..LRDATA:
.tc ..LRDATA[tc], .LRDATA
#
.align 2
.globl test[ds]
.csect test[ds]
.long .test[pr], TOC[tc0], 0
.globl .test[pr]
.csect .test[pr]
.test:
mfspr r4,4 # load RTC upper register
stw r4,0(r3) # write to caller’s buffer
mfspr r4,5 # load RTC lower register
stw r4,4(r3) # write to caller’s buffer
bclr 0x14,0x0 # return to the caller
FE_MOT_RESVD.test:
.csect [rw]
.align 2
.LDATA:
.csect [rw]
.align 2
.LRDATA:
Also assume program has been compiled and linked to start at
address 65040000, and the program was converted into an S-record
file named test.mx as follows:
S325650400007C8402A6908300007C8502A6908300044E80002000000000650400006504002412
S30D65040020000000000000000069
S7056504000091