ÂÂÂÂ//------
ÂÂÂÂ// Called from the C code. Get the current CPU speed in MHz.
ÂÂÂÂ//------
ÂÂÂÂ.globalÂÂÂÂGetCPUSpeed
ÂÂÂÂ.typeÂÂÂÂGetCPUSpeed,@function
GetCPUSpeed:
ÂÂÂÂlaÂÂÂÂa0, printf_clockÂÂÂÂÂÂÂÂ// Get address of the function
ÂÂÂÂlhuÂÂÂÂa1, 0(a0)ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ// High halfword of the "_pllout" variable address
ÂÂÂÂlhÂÂÂÂa0, 4(a0)ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ// a0 = signed low halfword of the "_pllout" address
ÂÂÂÂsllÂÂÂÂa1, 16
ÂÂÂÂadduÂÂÂÂa1, a0
ÂÂÂÂlwÂÂÂÂa1, 4(a1)ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ// a1 = _pllout value
ÂÂÂÂluiÂÂÂÂv0, 0x431b
ÂÂÂÂoriÂÂÂÂv0, v0, 0xde83
ÂÂÂÂmultuÂÂÂÂa1, v0ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ
ÂÂÂÂmfhiÂÂÂÂv0
ÂÂÂÂsrlÂÂÂÂv0, v0, 0x12
ÂÂÂÂjrÂÂÂÂra