The best way to cut out sub floor next to wall is to use a skill saw. Adjust the angle to of the blade toward the wall. Work slow. A saw-saw is another option but is less skilled approach. If all else fails grab a hammer and a chisel.