2020-11-24から1日間の記事一覧

インラインアセンブラ(x86系MASM, Microsoft Macro Assembler)

動かしてわかる CPUの作り方10講, pp.17-20 1+2+ ... +10=55を計算する。 #include <iostream> int main(void){ uint16_t sum; __asm { mov ax, 0 mov bx, 1 LOOP1: cmp bx, 11 // cmpはcompare je MOUT // jeはjump if equal add ax, bx inc bx jmp LOOP1 MOUT: mov </iostream>…