The actual movement should be simple enough, so you probably mean how to prevent moonwalking? In that case you can look here, there is an explanation to antimoonwalk code and an example of 8-Way antimoonwalking, though I may update it, as the STATE method is better suited for it. If you did mean just the movement, then each keydown is set to the movement, and so when both are pressed, then it works. If you have any questions or want to see a demo, I think I can put one up.
http://game-editor.com/Moonwalkinghttp://game-editor.com/8-Way_Movement