pastebin - collaborative debugging tool
polynomial.kpaste.net RSS


Emulated Code
Posted by Anonymous on Fri 29th Apr 2011 02:18
raw | new post

  1. ;
  2. ; emulated processor code
  3. ; written by polynomial
  4. ; designed to be similar to x86 asm
  5. ;
  6. xor_rr ecx, ecx     ; _rr suffix means from register to register
  7.                     ; the : prefix means it's a label
  8. :loop
  9. inc ecx             ; familiar? :P
  10. call !print_value   ; the ! indicates literal address reference
  11. cmp_rl ecx, 10d     ; integers are indicated by d on the end
  12. jl @loop            ; the @ means relative, which is used for all jumps
  13. halt                ; halt execution!
  14.                     ; another label
  15. :print_value
  16. write_r ecx         ; write value of register to the console
  17. write_c 13b         ; write char, b suffix means byte
  18. write_c 10b         ; in this case we've written \r\n
  19. ret                 ; return from call

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}





All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at