- ;
- ; emulated processor code
- ; written by polynomial
- ; designed to be similar to x86 asm
- ;
- xor_rr ecx, ecx ; _rr suffix means from register to register
- ; the : prefix means it's a label
- :loop
- inc ecx ; familiar? :P
- call !print_value ; the ! indicates literal address reference
- cmp_rl ecx, 10d ; integers are indicated by d on the end
- jl @loop ; the @ means relative, which is used for all jumps
- halt ; halt execution!
- ; another label
- :print_value
- write_r ecx ; write value of register to the console
- write_c 13b ; write char, b suffix means byte
- write_c 10b ; in this case we've written \r\n
- ret ; return from call
Emulated Code
Posted by Anonymous on Fri 29th Apr 2011 02:18
raw | new post
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.