Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. //please forgive me... :(
  2.  
  3. #include <stdio.h>
  4. #include <string.h>
  5. #include <stdlib.h>
  6.  
  7. #define MAX_LEN 6 //maximum instruction length is 6 characters: jmp, jpi, jpz, jpc, jps, stm, ldm
  8. #define MED_LEN 5 //medium length: mov r, clr r
  9. #define MIN_LEN 3 //minimum length: nop, add, sub, and, or, not, xor
  10.  
  11. int main()
  12. {
  13.  
  14. FILE *file = fopen("input.asm","rb");
  15.  
  16. char str_buf[MIN_LEN + 1];
  17. fgets(str_buf, MIN_LEN + 1, file);
  18. printf("%s\n", str_buf);
  19.  
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement