13G0i1laG2f9v$y@0|13Gyy0i0@09G0i14Gyy@0 n9G0i021Gyy@0 d9G0i026Gyy@0 o9G0i127Gyy@0 X9G0i128Gyy@0 2 13G0x9G0P12Gyy@0o9Gi @ X9Gi @ d9Gi @ n9Gi @ 6G$x5G0P7G$x5G0p0laGyy@0|5Gyy@0 6Gf>2li0lv$y0PJi <-f-3x0i 7Gf>2li3lv$y0PJi <-f-3x0i 8G$vhy20GpaGyy@0yy@0 input1 -> xxxxxxxxxxxxxxxxxxxxxx input2 -> xxxxxxxxxxxxxxxxxxxxxx optput -> xxxxxxxxxxxxxxxxxxxxxx <- output 13G0i1laG2f9v$y@0|13Gyy0i0@09G0i14Gyy@0 d9G0i026Gyy@0 o9G0i127Gyy@0 X9G0i128Gyy@0 13G0i0laG2f9v$y@0|13Gyy0i1@0913G0i19G0i04Gyy@0 d9G0i126Gyy@0 o9G0i127Gyy@0 X9G0i028Gyy@0 2G12G 0 -------------------------------------------------------------------------------------------------------------------------- [instruction] a simple ALU simulator build with vim macro by ayazumi [usage] please put in bin numbers after input 1 and 2, put options in optput, start by typing 5Gyy@0 in normal mode. [manual] 04 for plusing, 23 for minus, 25 for +1, 22 for <<, 29 for arithmetic >>, 30 for logic >> (last 3 input 2) 21 for NOT(input 2), 26 for AND, 27 for OR, 28 for XOR -------------------------------------------------------------------------------------------------------------------------- 7G$x22G0PaGfnlv$y@0|yy@0 7G$vF llx9G0P0xf i00i @ 3G$i9Gvf hx7G$a3p12Gf1xa5fGayy@025G0i9Gf x9Gvf hx7G$a3p12Gf2i12lxl4x3GvfPd13G0r04Gyy@021Gyy@0 7G$x5G0Pi0laGyy@0|5Gyy@0 11Gf4i2Gf4i210Gf4i21Gf4i27G$x5G0Pi1laGyy@0|5Gyy@0 6G$x22G0P7G$x22G0p0laGfdlv$y@0|yy@0 6G$x22G0P7G$x22G0p0laGfolv$y@0|yy@0 6G$x22G0P7G$x22G0p0laGfXlv$y@0|yy@0 7G$vF llx9G0P0vyPf hx0i @ 7G$vF llx9G0P0i0f hx0i @ -------------------------------------------------------------------------------------------------------------------------- [ASM_manual] add for 54 sub for 56 and for 57 or for 58 mov for 49 end for 51 out for 52 jnc for 59 rax for 37 rbx for 38 rcx for 39 rdx for 40 __ for 60 ;; for 60 -------------------------------------------------------------------------------------------------------------------------- 49Gyy@0jdiwdjiwjdiwdjiwdjw -------------------------------------------------------------------------------------------------------------------------- 1 2 3 4 5 6 7 8 -------------------------------------------------------------------------------------------------------------------------- G?__ start mAggV29j"ayGV"by47Gyy@0 `Aj0 bmAvey48G0igg/ASM_manual /pa 2wvey35GPaGyy@0yy@0yy@0 buffer `Awvey50G0igg/ASM_manual /pa 2wvey35GPaGddOmB`A3wvey`Bp47Gyy@0yy@0yy@0 buffer G?STDOUT @ `Awvey53G0igg/ASM_manual /pa 2wvey35GPaG0veyG?STDOUT $a p47Gyy@0yy@0yy@0 buffer ggV29j"apGV"bp8G$vbc04`Awvey55G0igg/ASM_manual /pa 2wvey35GPaGvey6G$vbpyy@0`A3wvey55G0igg/ASM_manual /pa 2wvey35GPaGvey7G$vbp`Awvey55G0igg/ASM_manual /pa 2wvey12GA`Awvey55G0igg/ASM_manual n/pa 2wvey35GPaGmB9Glvey`Bvep47Gyy@0yy@055Gyy@05Gyy@055Gyy@0yy@0 buffer ggV29j"apGV"bp8G$vbc23`Awvey55G0igg/ASM_manual /pa 2wvey35GPaGvey6G$vbpyy@0`A3wvey55G0igg/ASM_manual /pa 2wvey35GPaGvey7G$vbp`Awvey55G0igg/ASM_manual /pa 2wvey12GA`Awvey55G0igg/ASM_manual n/pa 2wvey35GPaGmB9Glvey`Bvep47Gyy@0yy@055Gyy@05Gyy@055Gyy@0yy@0 ggV29j"apGV"bp8G$vbc26`Awvey55G0igg/ASM_manual /pa 2wvey35GPaGvey6G$vbpyy@0`A3wvey55G0igg/ASM_manual /pa 2wvey35GPaGvey7G$vbp`Awvey55G0igg/ASM_manual /pa 2wvey12GA`Awvey55G0igg/ASM_manual n/pa 2wvey35GPaGmB9Glvey`Bvep47Gyy@0yy@055Gyy@05Gyy@055Gyy@0yy@0 ggV29j"apGV"bp8G$vbc27`Awvey55G0igg/ASM_manual /pa 2wvey35GPaGvey6G$vbpyy@0`A3wvey55G0igg/ASM_manual /pa 2wvey35GPaGvey7G$vbp`Awvey55G0igg/ASM_manual /pa 2wvey12GA`Awvey55G0igg/ASM_manual n/pa 2wvey35GPaGmB9Glvey`Bvep47Gyy@0yy@055Gyy@05Gyy@055Gyy@0yy@0 9G0vy62G0i6paGyy@0yy@0 47Gyy@0 `Aw vey62G0iG?__ start /__ pa mA47Gyy@0yy@0 buffer -------------------------------------------------------------------------------------------------------------------------- [ASM_usage] __word to set flags, and __word to use it, only support one blank line between codes, use ;;sentence as comments, if just comment in line, no space before comments, if after code, code;;comment only support tabs for indentation, only support mov register,number, so if you need mov rax,rbx , you write mov rax,0000 add rax,rbx, __start and end must be set. -------------------------------------------------------------------------------------------------------------------------- STDOUT -------------------------------------------------------------------------------------------------------------------------- please write asm below here, 46G$yy@0 yy@0 here to run __ start ;; this is comment mov rax,0000000000001 ;; this is comment mov rbx,0000000000001 ;; this is comment mov rcx,0000000001010 ;; this is comment out rax __ loop ;; this is comment out rax mov rdx,0000000000000 add rdx,rax add rax,rbx mov rbx,0000000000000 add rbx,rdx mov rdx,0000000000001 sub rcx,rdx jnc __loop ;; this is comment end ;; this is comment mov rax,0110 ;; this is comment mov rbx,0011 ;; this is comment mov rcx,0000 ;; this is comment __ compare ;; this is comment mov rdx,0000 add rdx,rax sub rdx,rbx jnc __no_swap ;; this is comment __ swap mov rcx,0000 add rcx,rax mov rax,0000 add rax,rbx mov rbx,0000 add rbx,rcx __ no_swap out rax out rbx end 13G0i0laG2f9v$y@0|13Gyy0i0@09G0i04Gyy@0 n9G0i121Gyy@0 d9G0i026Gyy@0 o9G0i027Gyy@0 X9G0i028Gyy@0