Advertisement
Guest User

Untitled

a guest
Jun 14th, 2012
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. This code should only have 3 possible outcomes as far as what it prints to screen:
  2.  
  3. "Reading.....Success" periods for each timeout until int13 gives no error
  4. "Reading.....Failure" periods for each timeout until an error other than timeout is given
  5. "Reading............" infinite loop of printing periods because of infinite timeouts
  6.  
  7. ------------------------------------------------------------------------------------------
  8.  
  9. read:
  10. mov $reading_message,%si #prints "Reading" message
  11. call putstr
  12.  
  13. read.retry:
  14. mov $read_retry,%si #prints a '.' for each read attempt
  15. call putstr
  16.  
  17. mov $0x42,%ah
  18. mov drive,%dl
  19. mov $edd_packet,%si
  20. int $0x13 #all registers are set and, extended read call
  21. #is executed
  22.  
  23. jc read.fail #if read had no error then
  24. #print "Success" and return to caller
  25. #if error then jump to read.fail
  26.  
  27. mov $reading_done,%si
  28. call putstr
  29. ret
  30.  
  31. read.fail:
  32. cmp $0x80,%ah #if error was read timeout start another attempt
  33. je read.retry
  34. mov $unknown_fail,%si #for any other error just
  35. #print 'Failure'
  36. #and give up
  37. call putstr
  38.  
  39. --------------------------------------
  40.  
  41. edd_packet: .byte 0x10 # Length
  42. .byte 0 # Reserved
  43. edd_len: .byte 0x0 # Num to read
  44. .byte 0 # Reserved
  45. edd_addr: .word 0x0,0x0 # Seg:Off
  46. edd_lba: .quad 0x00 # LBA
  47.  
  48. ------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement