Skip to content

Instantly share code, notes, and snippets.

View febnug's full-sized avatar
🥴
Drunk

Febriyanto Nugroho febnug

🥴
Drunk
View GitHub Profile
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:
aad -1 ; add al,-1*ah
@febnug
febnug / gabeut.asm
Last active February 19, 2022 08:31
X: les dx,[bx+si]
xchg ax,cx
stosw
jmp X-8
; generate random numbers
in al,40h
rdtsc
xadd ax,bp
imul ax, -7
; 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
cbw
dec ax
; instruksi di atas sama kaya dec al
org 100h
mov cx, 5
push cx
mov ah, 0eh
_loop:
mov al, "*"
int 10h
dec cx
test cx, cx
@febnug
febnug / cetak.asm
Last active November 11, 2021 03:56
.model tiny
.code
org 100h
mulai:
mov ax, 10
cetak_nilai:
mov bx, 10
@febnug
febnug / r.asm
Last active September 26, 2021 04:40
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:
@febnug
febnug / solve.asm
Last active September 26, 2021 06:09
; 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: