This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xor dx,dx ; zf = 0 | |
div sp ; or any other reg that <> 0 | |
jnz .AMD ; on any div/idiv operation ZF flag will not be changed on Intel but will be set on AMD | |
.Intel: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aad -1 ; add al,-1*ah |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
X: les dx,[bx+si] | |
xchg ax,cx | |
stosw | |
jmp X-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; generate random numbers | |
in al,40h | |
rdtsc | |
xadd ax,bp | |
imul ax, -7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; feel like jump into the abyss | |
global _start | |
section .text | |
_start: | |
mov byte [esp+0], 0x90 ; simpan instruksi nop di register esp | |
jmp esp ; lompat ke instruksi nop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cbw | |
dec ax | |
; instruksi di atas sama kaya dec al |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
org 100h | |
mov cx, 5 | |
push cx | |
mov ah, 0eh | |
_loop: | |
mov al, "*" | |
int 10h | |
dec cx | |
test cx, cx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.model tiny | |
.code | |
org 100h | |
mulai: | |
mov ax, 10 | |
cetak_nilai: | |
mov bx, 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JMP start | |
ibu_kota_negara: DB "minsk" ; <-- nama ibu kota negara, harus huruf kecil semua | |
DB 0 | |
start: | |
MOV C, ibu_kota_negara | |
MOV D, 232 | |
.loop: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; test code di : https://schweigi.github.io/assembler-simulator/index.html | |
; | |
; Febriyanto Nugroho | |
MOV A, 0x32 | |
MOV B, 20 | |
MOV C, 14 | |
MOV D, 232 | |
loop: |