about summary refs log tree commit diff stats
path: root/resources
Commit message (Collapse)AuthorAgeFilesLines
* Read from file if passed, modify USAGEAndinus2021-01-201-0/+4
| | | | | | Previouly, the only way of passing the puzzle was to enter a url. Now octans is able to read from files too. If the file exist & it's readable then octans will read the puzzle from there.
* Re-structure for CPAN upload, include a dictionary file v0.1.0Andinus2021-01-192-0/+355136
bin/octans calls lib/Octans/CLI.rakumod which has the MAIN subroutine.
d='n29' href='#n29'>29 30 31 32 33 34 35 36 37 38 39 40 41 42 43










































                                                                              
fn load-sectors disk: (addr disk), lba: int, n: int, out: (addr stream byte) {
  var curr-lba/ebx: int <- copy lba
  var remaining/edx: int <- copy n
  {
    compare remaining, 0
    break-if-<=
    # sectors = min(remaining, 0x100)
    var sectors/eax: int <- copy remaining
    compare sectors, 0x100
    {
      break-if-<=
      sectors <- copy 0x100
    }
    #
    read-ata-disk disk, curr-lba, sectors, out
    #
    remaining <- subtract sectors
    curr-lba <- add sectors
    loop
  }
}

fn store-sectors disk: (addr disk), lba: int, n: int, in: (addr stream byte) {
  var curr-lba/ebx: int <- copy lba
  var remaining/edx: int <- copy n
  {
    compare remaining, 0
    break-if-<=
    # sectors = min(remaining, 0x100)
    var sectors/eax: int <- copy remaining
    compare sectors, 0x100
    {
      break-if-<=
      sectors <- copy 0x100
    }
    #
    write-ata-disk disk, curr-lba, sectors, in
    #
    remaining <- subtract sectors
    curr-lba <- add sectors
    loop
  }
}