1 2SECTION code_driver 3 4PUBLIC ide_sleep 5 6EXTERN __IO_IDE_COMMAND 7 8EXTERN __IDE_CMD_SLEEP 9 10EXTERN ide_wait_ready 11EXTERN ide_test_error 12 13EXTERN ide_write_byte 14 15;------------------------------------------------------------------------------ 16; Routines that talk with the IDE drive, these should be called by 17; the main program. 18 19; tell the drive to sleep. only recoverable through hard_reset 20 21ide_sleep: 22 push af 23 push de 24 call ide_wait_ready 25 jr nc, error 26 ld e, __IDE_CMD_SLEEP 27 ld a, __IO_IDE_COMMAND 28 call ide_write_byte 29 call ide_wait_ready 30 jr nc, error 31 pop de 32 pop af 33 scf ;carry = 1 on return = operation ok 34 ret 35 36error: 37 pop de 38 pop af 39 jp ide_test_error ;carry = 0 on return = operation failed 40 41