Hi
I need to enable the hardware watchdog of an msm800 embedded computer.
Unfortunately I hardly know anything about using assembly languages.
This is what the documentation for the device says:
Function: WATCHDOG
Number: EBh
Description:
Enables strobes and disables the Watchdog. After power-up, the Watchdog is always disabled. Once the Watchdog has been enabled, the user application must perform a strobe at least every 800ms, otherwise the watchdog performs a hardware reset
Input values:
AH: 78h DLAG Int15 function
AL: EBh Function request
BL: 00h Disable
BL: 01h Enable
BL: FFh Strobe
01h-FFh Enable Watchdog / retrigger
BH: 00h = BL -> number of sec. / 01h = BL -> number of min.
Output value: AL 01h Watchdog timer time-out occurred
And this is what i came up with:
#include <stdio.h>
int main() {
asm(
"movb $0x78, %ah\n\t"
"movb $0xEB, %al\n\t"
"movb $0x01, %bl\n\t"
"movb $0x00, %bh\n\t"
"int $0x80"
);
return 0;
}
It's wrong though - running results in segmentation fault, I have the right values in registers, but don't know how to actually run the function.
Any help?